nordnet / cordova-hot-code-push-cli

[DEPRECATED] - This is a command line utility for Cordova Hot Code Push Plugin.
https://github.com/nordnet/cordova-hot-code-push-cli/issues/79
143 stars 139 forks source link

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

Closed nikDemyankov closed 6 years ago

nikDemyankov commented 8 years ago

Issues originally created in the plugin's repo: https://github.com/nordnet/cordova-hot-code-push/issues/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 commented 8 years ago

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

JosephDAM commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

sumit6b commented 8 years ago

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 queue-async@1.0.7: renamed to d3-queue npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue`

ngrok@2.2.2 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 | leveldown@1.4.6 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 cordova-hot-code-push-cli@1.1.1 /usr/local/lib/node_modules/cordova-hot-code-push-cli ├── q@1.4.1 ├── async@1.5.2 ├── crypto@0.0.3 ├── es6-promise@2.3.0 ├── compression@1.6.2 (on-headers@1.0.1, bytes@2.3.0, vary@1.1.0, debug@2.2.0, compressible@2.0.8, accepts@1.3.3) ├── minimatch@3.0.3 (brace-expansion@1.1.6) ├── readdirp@2.1.0 (set-immediate-shim@1.0.1, graceful-fs@4.1.6, readable-stream@2.1.5) ├── watch@0.16.0 (minimist@1.2.0, exec-sh@0.2.0) ├── recursive-readdir@1.3.0 (minimatch@0.3.0) ├── yargs@3.32.0 (decamelize@1.2.0, y18n@3.2.1, camelcase@2.1.1, window-size@0.1.4, os-locale@1.4.0, cliui@3.2.0, string-width@1.0.2) ├── express@4.14.0 (escape-html@1.0.3, array-flatten@1.1.1, cookie-signature@1.0.6, utils-merge@1.0.0, encodeurl@1.0.1, merge-descriptors@1.0.1, content-type@1.0.2, vary@1.1.0, methods@1.1.2, content-disposition@0.5.1, cookie@0.3.1, fresh@0.3.0, etag@1.7.0, serve-static@1.11.1, parseurl@1.3.1, path-to-regexp@0.1.7, range-parser@1.2.0, depd@1.1.0, qs@6.2.0, debug@2.2.0, on-finished@2.3.0, finalhandler@0.5.0, proxy-addr@1.1.2, accepts@1.3.3, type-is@1.6.13, send@0.14.1) ├── fs-extra@0.22.1 (graceful-fs@4.1.6, jsonfile@2.3.1, rimraf@2.5.4) ├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.4.0, read@1.0.7, winston@0.8.3, utile@0.2.1) ├── socket.io@1.4.8 (has-binary@0.1.7, debug@2.2.0, socket.io-parser@2.2.6, socket.io-adapter@0.4.0, engine.io@1.6.11, socket.io-client@1.4.8) ├── lodash@3.10.1 ├── hidefile@1.1.0 (winattr@1.1.0) ├── ngrok@2.2.2 (xtend@4.0.1, async@0.9.2, lock@0.1.3, node-uuid@1.4.7, decompress-zip@0.3.0, tar.gz@1.0.5, request@2.74.0) ├── level@1.4.0 (level-packager@1.2.0, leveldown@1.4.6) └── s3-sync-aws@1.1.1 (once@1.1.1, mime@1.2.11, xtend@4.0.1, queue-async@1.0.7, backoff@2.3.0, event-stream@3.0.16, level-write-stream@1.0.0, aws-sdk@2.5.5)`

hewstone commented 7 years ago

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 s3-sync-aws@1.1.1 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 commented 7 years ago

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 ngrok@2.1.6 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 commented 7 years ago

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 s3-sync-asw@1.1.1 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. (/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. (/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 commented 6 years ago

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

yidaimi commented 6 years ago

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 commented 6 years ago

👋 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.