Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

cordova-hcp server command issue: Could not create tunnel #9

Closed
nikDemyankov opened this issue Oct 7, 2015 · 12 comments
Closed

cordova-hcp server command issue: Could not create tunnel #9

nikDemyankov opened this issue Oct 7, 2015 · 12 comments
Labels

Comments

@nikDemyankov
Copy link
Member

Issues originally created in the plugin's repo: nordnet/cordova-hot-code-push#22

@JosephDAM asked:

Running server
Could not create tunnel: [Error: panic: runtime error: invalid memory address or nil pointer dereference

github.com/inconshreveable/olive/recover.go:40
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
< autogenerated >:132
github.com/inconshreveable/olive/recover.go:29
runtime/asm_386.s:412
runtime/panic.go:387
github.com/inconshreveable/olive/error.go:37
runtime/asm_386.s:412
runtime/panic.go:387
runtime/panic.go:42
runtime/os_windows.go:42
github.com/inconshreveable/go-tunnel/client/reconnecting.go:42
github.com/inconshreveable/go-tunnel/client/session.go:97
ngrok/tunnel_session.go:128
ngrok/web_api.go:95
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/error.go:41
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/recover.go:32
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/logger.go:17
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:250
github.com/go-martini/martini/router.go:120
github.com/inconshreveable/ngrok/web.go:25
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
github.com/go-martini/martini/martini.go:173
github.com/go-martini/martini/martini.go:69
]

Well, when I did "npm install -g cordova-hot-code-push-cli" I got a lot of errors too. Something like "Can't find Python executable 'python'", and it seems related to node-gyp too...

@nikDemyankov
Copy link
Member Author

@JosephDAM On what machine you are running it: windows or mac?

@JosephDAM
Copy link

Windows 7 32-bit, I already got python 2.7, problem now is MSBUILD : error MSB3428.
My visual studio and visual c++:

captura

Other versions:

captura2

I also tried to install via: npm install -g cordova-hot-code-push-cli --msvs_version=2013
and directly change the global config: npm config set msvs_version 2013 --global

Doesn't work either, thing is, when I installed Visual Studio Express 2013, no Visual C++ was installed. I mean that all the Microsoft Visual C++ I have where there before Visual Studio installation.

I also set the path variable: PATH: C:\Program Files\Microsoft Visual Studio 12.0\VC\vcpackages
Another strange thing is that when I installed VS 2013 this was the result:

captura3

@nikDemyankov
Copy link
Member Author

I think this is a node issue, not this CLI issue. Try to look in the http://stackoverflow.com/questions/21365714/nodejs-error-installing-with-npm, http://stackoverflow.com/questions/17496189/error-in-installing-node-js-module-using-npm .

Maybe do a clean install on node, npm and Visual Studio.

@sumit6b
Copy link

sumit6b commented Sep 9, 2016

This is recurring on my Mac,

Running
cordova-hcp server

Getting the following error
Could not create tunnel: [Error: panic: runtime error: invalid memory address or nil pointer dereference

@nikDemyankov
Copy link
Member Author

@sumit6b What npm and node version you are using? And are you using the latest version of cordova-hcp utility?

@sumit6b
Copy link

sumit6b commented Sep 9, 2016

Node version: v4.4.7
Npm version: 2.15.8
Cordova version: 6.3.1
Then i did: npm install -g cordova-hot-code-push-cli
I got the following packages installed:

npm WARN peerDependencies The peer dependency level@~1.4.0 included from s3-sync-aws will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated [email protected]: renamed to d3-queue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue`

[email protected] postinstall /usr/local/lib/node_modules/cordova-hot-code-push-cli/node_modules/ngrok
node ./postinstall.js`

ngrok - downloading binary https://bin.equinox.io/a/bZszyrZZM3G/ngrok-2.1.1-darwin-amd64.zip ...
ngrok - binary downloaded...
ngrok - binary unpacked.
npm ERR! fetch failed https://registry.npmjs.org/after/-/after-0.8.2.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 400
|
[email protected] install /usr/local/lib/node_modules/cordova-hot-code-push-cli/node_modules/level/node_modules/leveldown
prebuild --install`

/usr/local/bin/cordova-hcp -> /usr/local/lib/node_modules/cordova-hot-code-push-cli/bin/cordova-hcp
[email protected] /usr/local/lib/node_modules/cordova-hot-code-push-cli
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])`

@hewstone
Copy link

hewstone commented Oct 4, 2016

Any update on a solution to this? I get the same error running on Windows 7 with VS 2015 installed.
Node: v4.6.0
NPM: v3.10.8

running cmd> npm install -g cordova-hot-code-push-cli
it installs but gives warning "npm WARN [email protected] requires a peer of level@~1.4.0 but none was installed." even though I explicitly installed level prior to running the command above. (Ideas on that one?)

Since it appears to be used for AWS and I'm not using AWS I ignored the warning. I ran
cordova-hcp server www

Here is the output
Running server
Could not create tunnel: [Error: panic: runtime error: invalid memory address or nil pointer dereference

github.com/inconshreveable/olive/recover.go:40
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
:132
github.com/inconshreveable/olive/recover.go:29
runtime/asm_amd64.s:479
runtime/panic.go:458
github.com/inconshreveable/olive/error.go:37
runtime/asm_amd64.s:479
runtime/panic.go:458
runtime/panic.go:62
runtime/signal_windows.go:161
lib/tunnel/client/reconnecting.go:39
lib/tunnel/client/session.go:97
ngrok/tunnel_session.go:143
ngrok/web_api.go:95
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/error.go:41
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/recover.go:32
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/logger.go:17
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:250
github.com/go-martini/martini/router.go:120
ngrok/src/ngrok/web.go:27
runtime/asm_amd64.s:480
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
github.com/go-martini/martini/martini.go:173
github.com/go-martini/martini/martini.go:69
]

@nikDemyankov nikDemyankov reopened this Oct 4, 2016
@nikDemyankov nikDemyankov added bug and removed question labels Oct 4, 2016
@nikDemyankov nikDemyankov changed the title cordova-hcp server command issue cordova-hcp server command issue: Could not create tunnel Oct 4, 2016
@nikDemyankov
Copy link
Member Author

No, since I could not reproduce that... AWS warnings can be ignored, since it is not used for server command.

Feels like ngrok package is not properly installed. Can you run npm i [email protected] to check, that it can be installed? And then run ngrok http 8080 to check, that it can launch server.

You can do this in any tmp folder.

@MichaelTague
Copy link

MichaelTague commented Jul 27, 2017

Hi, any new word on this? Today I did the example cordova installation and got the same result. I'm running on Fedora 25 Linux. As root I did:

npm install -g cordova-hot-code-push-cli

And also got the

npm WARN [email protected] requires a peer of level@~1.4.0 but none was installed

Then, the TestProject "cordova-hcp server" produces the panic error, outputs a lot then hangs. I'm dead in the water. Output of "npm version" and "cordova --version"
{ npm: '3.10.10',
ares: '1.10.1-DEV',
http_parser: '2.7.1',
icu: '57.1',
modules: '48',
node: '6.10.3',
openssl: '1.0.2k-fips',
uv: '1.10.2',
v8: '5.1.281.101',
zlib: '1.2.8' }

cordova --version
7.0.1

Here is the output:

cordova-hcp server
Running server
Could not create tunnel: Error: panic: runtime error: invalid memory address or nil pointer dereference

github.com/inconshreveable/olive/recover.go:40
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
:132
github.com/inconshreveable/olive/recover.go:29
runtime/asm_amd64.s:514
runtime/panic.go:489
github.com/inconshreveable/olive/error.go:37
runtime/asm_amd64.s:514
runtime/panic.go:489
runtime/panic.go:63
runtime/signal_unix.go:290
lib/tunnel/client/reconnecting.go:39
lib/tunnel/client/session.go:97
ngrok/tunnel_session.go:138
ngrok/web_api.go:97
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/error.go:41
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/recover.go:32
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/logger.go:17
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:250
github.com/go-martini/martini/router.go:120
ngrok/src/ngrok/web.go:27
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
github.com/go-martini/martini/martini.go:173
github.com/go-martini/martini/martini.go:69

at Request._callback (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/ngrok/index.js:177:10)
at Request.self.callback (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/request/request.js:1091:12)
at IncomingMessage.g (events.js:292:16)
at emitNone (events.js:91:20)

@artdong
Copy link

artdong commented Feb 1, 2018

这个bug还没解决吗?怎么避开呢

@yidaimi
Copy link

yidaimi commented Feb 2, 2018

I have solved this exception. It's a network problem.
Here is my log info:
Running server
Could not create tunnel: Error: panic: runtime error: invalid memory address or nil pointer dereference
github.com/inconshreveable/olive/recover.go:40
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
:132
github.com/inconshreveable/olive/recover.go:29
runtime/asm_amd64.s:514
runtime/panic.go:489
github.com/inconshreveable/olive/error.go:37
runtime/asm_amd64.s:514
runtime/panic.go:489
runtime/panic.go:63
runtime/signal_windows.go:161
lib/tunnel/client/reconnecting.go:39
lib/tunnel/client/session.go:97
ngrok/tunnel_session.go:138
ngrok/web_api.go:97
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/error.go:41
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/recover.go:32
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/logger.go:17
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:250
github.com/go-martini/martini/router.go:120
ngrok/src/ngrok/web.go:27
runtime/asm_amd64.s:515
reflect/value.go:434
reflect/value.go:302
github.com/codegangsta/inject/inject.go:102
github.com/go-martini/martini/martini.go:173
github.com/go-martini/martini/martini.go:69
at Request._callback (D:\sgmuserprofile\s22h2d\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\ngrok\index.js:183:10)
at Request.self.callback (D:\sgmuserprofile\s22h2d\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\request\request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (D:\sgmuserprofile\s22h2d\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\request\request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (D:\sgmuserprofile\s22h2d\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\request\request.js:1085:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)`

I noticed that :\cordova-hot-code-push-cli\node_modules\ngrok\index.js:183:10
I found the code:

function _runTunnel(opts, cb) {
var retries = 100;
opts.name = String(opts.name || uuid.v4());
var retry = function() {
api.post(
{url: 'api/tunnels', json: opts},
function(err, resp, body) {
if (err) {
return cb(err);
}
var notReady = resp.statusCode === 500 && /panic/.test(body) ||
resp.statusCode === 502 && body.details &&
body.details.err === 'tunnel session not ready yet';

			if (notReady) {
				return retries-- ?
					setTimeout(retry, 200) :
					 **cb(new Error(body));**
			}
			var publicUrl = body && body.public_url;
			if (!publicUrl) {
				var err = Object.assign(new Error(body.msg || 'failed to start tunnel'), body);
				return cb(err);
			}
			tunnels[publicUrl] = body.uri;
			if (opts.proto === 'http' && opts.bind_tls !== false) {
				tunnels[publicUrl.replace('https', 'http')] = body.uri + ' (http)';
			}
			var uiUrl = url.parse(resp.request.uri);
			uiUrl = uiUrl.resolve('/').slice(0, -1);
			return cb(null, publicUrl, uiUrl);
		});
};

`
It's a network module. So I think maybe it's due to the network permission. I was in my office where we just can access internet by proxy. I open my iphone adhoc and connect it by wifi. It works!!!

Running server
Checking: D:\cordova_workspace\cordova-vue-hybridapp\hybridApp\www
local_url http://localhost:31284
Build 2018.02.02-13.31.10 created in D:\cordova_workspace\cordova-vue-hybridapp\hybridApp\www
cordova-hcp local server available at: http://localhost:31284
cordova-hcp public server available at: https://efa5debd.ngrok.io

@nordnet-deprecation-bot
Copy link
Contributor

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-hot-code-push-cli anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #79 for more information.

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants