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

Can't connect to NodeJS instance 0.4.1 #497

Closed
warnero opened this issue May 2, 2013 · 29 comments
Closed

Can't connect to NodeJS instance 0.4.1 #497

warnero opened this issue May 2, 2013 · 29 comments
Labels

Comments

@warnero
Copy link

warnero commented May 2, 2013

I first tried just launching and connecting that failed, then managed to get it started via the command-line and instead of failing completely it now tells me that the Node process suddenly quit and to check the console. I've been going through the console logs but don't know what I'm looking for and nothing pops up. Is there a specific log file to look at? I tried the lighttable server.log but there didn't seem to be much in there (and nothing new when I tried to connect, just a netty error).

Really would love to start using this for my Node development so any help is greatly appreciated!

@warnero
Copy link
Author

warnero commented May 2, 2013

Just tried it with a simpler node app and it works so it's something specific with this one (which has a lot of modules).

@ibdknox
Copy link
Member

ibdknox commented May 2, 2013

can you try the suggestion in #491?

@warnero
Copy link
Author

warnero commented May 2, 2013

It connected for about 10 seconds and then died with the same error message. So, better :P. Is there a log file I can look at to give you more info?

@ibdknox
Copy link
Member

ibdknox commented May 2, 2013

And nothing was printed to the bottom console?

@warnero
Copy link
Author

warnero commented May 2, 2013

/Users/warnero/.lighttable/plugins/nodejs/ltnodeclient.js:96
vm.runInContext(fs.readFileSync(path), sb, path);
^
AssertionError: false == true
at Object.exports.assert (console.js:75:23)
at Object.configurable
(/Users/warnero/code/clipppr/phoenix/node_modules/everyauth/lib/modules/everymodule.js:56:15)
at
/Users/warnero/code/clipppr/phoenix/node_modules/everyauth/lib/modules/password.js:127:4
at sbRequire
(/Users/warnero/.lighttable/plugins/nodejs/ltnodeclient.js:96:10)
at req (/Users/warnero/.lighttable/plugins/nodejs/ltnodeclient.js:78:12)
at Object.
(/Users/warnero/code/clipppr/phoenix/node_modules/everyauth/index.js:162:63)
at /Users/warnero/code/clipppr/phoenix/app.js:47:12
at sbRequire
(/Users/warnero/.lighttable/plugins/nodejs/ltnodeclient.js:96:10)
at init
(/Users/warnero/.lighttable/plugins/nodejs/ltnodeclient.js:113:3)
at Socket.
(/Users/warnero/.lighttable/plugins/nodejs/ltnodeclient.js:20:5)

On Thu, May 2, 2013 at 9:09 AM, Chris Granger notifications@github.com
wrote:

And nothing was printed to the bottom console?


Reply to this email directly or view it on GitHub.

@Quebecisnice
Copy link

Have you linked your local NPM modules to your global NPM modules ?

@ibdknox
Copy link
Member

ibdknox commented May 2, 2013

This one is on us, I'm trying to figure out the best way to go about fixing it. The issue has to do with the way we evaluate things and how references to global things like "Object" are propagated.

@cajahyba
Copy link

Any news about this issue? I getting the same error. My project uses Amazon AWS plugin (I don't know if this can help).

PS: Quebecisnice, I did what you suggest.

@Quebecisnice
Copy link

Can you post a link to the AWS package you are using ?

@cajahyba
Copy link

It's the aws-sdk package (http://aws.amazon.com/sdkfornodejs/) and I am getting the following error:

C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:96
vm.runInContext(fs.readFileSync(path), sb, path);
^
TypeError: Cannot call method 'update' of undefined
at D:\Projetos\Net\Source\MyProject\node_modules\aws-sdk\lib\core.js:23:10
at sbRequire (C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:96:10)
at req (C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:78:12)
at D:\Projetos\Net\Source\MyProject\node_modules\aws-sdk\lib\aws.js:16:11
at sbRequire (C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:96:10)
at req (C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:78:12)
at D:\Projetos\Net\Source\MyProject\repository\scatterRepository.js:1:7
at sbRequire (C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:96:10)
at req (C:\Users\Tiago.lighttable\plugins\nodejs\ltnodeclient.js:78:12)
at D:\Projetos\Net\Source\MyProject\service\scatterService.js:1:25

Error: read ECONNRESET
at errnoException (net.js:884:11)
at TCP.onread (net.js:539:19)

@crawfordcomeaux
Copy link

Could this be related to #656?

I ask because I noticed that the aws-sdk package has two files that use #/usr/bin/env node, though I didn't dig in to find out how they're used.

@cajahyba
Copy link

cajahyba commented Jul 3, 2013

What I did:

  1. Open the 2 files and remove the first line "#!/usr/bin/env node";
  2. Manually start Node.js using "cmd" (windows)

Result: Everything working.

But, even then I got the same error in console.

@warnero
Copy link
Author

warnero commented Aug 22, 2013

Is this fixed in the latest 0.5.0?

@cajahyba
Copy link

Yes, unfortunately.

@mynomoto
Copy link

I think this should be closed.

@warnero
Copy link
Author

warnero commented Nov 10, 2013

Why? Has it been fixed? Not going to be fixed? I honestly haven't tried LightTable since because this functionality is something I'd rely on daily.

@mynomoto
Copy link

I thought that was fixed. Can you test in LT 0.5.17?

@warnero
Copy link
Author

warnero commented Nov 11, 2013

Tried a couple of different projects from simple to complex and none start. Here's the output from one that is simple.

Invalid behavior: :lt.objs.clients.tcp-client/start-debugger!
bootstrap.js [20101] lt.object.raise_STAR_
bootstrap.js [20124] a
bootstrap.js [20128] b
bootstrap.js [25640] handle_connection_BANG_
bootstrap.js [25643] handle_connection_BANG_
bootstrap.js [29608] lt.objs.clients.tcp.store_client_BANG_
bootstrap.js [29650] anonymous
bootstrap.js [29636] lt.objs.clients.tcp.each_message
bootstrap.js [29649] lt.objs.clients.tcp.on_result
bootstrap.js [29657] anonymous
events.js [95] EventEmitter.emit
stream_readable.js [746] anonymous
events.js [92] EventEmitter.emit
stream_readable.js [408] emitReadable
stream_readable.js [404] emitReadable
stream_readable.js [165] readableAddChunk
stream_readable.js [127] Readable.push
net.js [526] onread
TypeError: Cannot read property 'handle' of null
bootstrap.js [20101] lt.object.raise_STAR

bootstrap.js [20124] a
bootstrap.js [20128] b
bootstrap.js [25640] handle_connection_BANG

bootstrap.js [25643] handle_connection_BANG

bootstrap.js [29608] lt.objs.clients.tcp.store_client_BANG

bootstrap.js [29650] anonymous
bootstrap.js [29636] lt.objs.clients.tcp.each_message
bootstrap.js [29649] lt.objs.clients.tcp.on_result
bootstrap.js [29657] anonymous
events.js [95] EventEmitter.emit
_stream_readable.js [746] anonymous
events.js [92] EventEmitter.emit
stream_readable.js [408] emitReadable
_stream_readable.js [404] emitReadable
_stream_readable.js [165] readableAddChunk
_stream_readable.js [127] Readable.push
net.js [526] onread

@ibdknox
Copy link
Member

ibdknox commented Nov 11, 2013

Can I see that project? Or can you show me one that does fail? I just fixed the original aws-sdk issue.

@warnero
Copy link
Author

warnero commented Nov 12, 2013

I just updated to .19 and it fails a bit differently now:
/Applications/LightTable/plugins/nodejs/ltnodeclient.js:99
vm.runInContext(cleanCode(fs.readFileSync(path)), sb, path);
^
app.js[stderr]:
ReferenceError: express is not defined
at /Users/warner/code/projects/test/app.js:26:31
at sbRequire (/Applications/LightTable/plugins/nodejs/ltnodeclient.js:99:10)
at init (/Applications/LightTable/plugins/nodejs/ltnodeclient.js:120:3)
at Socket. (/Applications/LightTable/plugins/nodejs/ltnodeclient.js:20:5)
at Socket.EventEmitter.emit (events.js:117:20)
at Object.afterConnect as oncomplete

Here's a project that fails with this error.
https://www.dropbox.com/s/fvhjtimj2rkbalq/test.zip

@robjens
Copy link

robjens commented Apr 16, 2015

I can confirm that LT is still affected (esp. on the mongoose part). First project breaks, I had it fail on bcrypt bindings (node-gyp) pilwon/ultimate-seed#54 this exception message. However it also contains mongoose.

Next I tried clean slate (mkdir foo; cd $-; npm init; npm i coffee-script; echo "var coffee = require('coffee-script');" > index.js; node index.js;) then tried LT everything works connecting properly to index.js

Now if I added mongoose however, as soon as simple require that project, LT breaks:

module.js:355
  Module._extensions[extension](this, filename);
                               ^

edit: the project does get added to the connections btw with that last test (including both coffee-script and mongoose as dependencies required).

@robjens
Copy link

robjens commented Apr 16, 2015

P.s. I can share some of the code of the original project failing, it highlights where it goes wrong anyway, if it is of any use (I hope):

Error: Could not locate the bindings file. Tried:
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/build/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/build/Debug/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/build/Release/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/out/Debug/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/Debug/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/out/Release/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/Release/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/build/default/bcrypt_lib.node
 → /home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/compiled/0.12.2/linux/x64/bcrypt_lib.node
    at bindings (/home/foo/bar/api/node_modules/bcrypt/node_modules/bindings/bindings.js:88:9)
    at /home/foo/bar/api/node_modules/bcrypt/bcrypt.js:3:35
    at Object.exports.runInContext (vm.js:64:17)
    at sbRequire (/opt/LightTable/plugins/javascript/node/ltnodeclient.js:99:10)
    at req (/opt/LightTable/plugins/javascript/node/ltnodeclient.js:79:12)
    at /home/foo/bar/api/player/model.js:4:16
    at /home/foo/bar/api/player/model.js:859:3
    at Object.exports.runInContext (vm.js:64:17)
    at sbRequire (/opt/LightTable/plugins/javascript/node/ltnodeclient.js:99:10)
    at req (/opt/LightTable/plugins/javascript/node/ltnodeclient.js:79:12)

The bindings directory (node_modules/bindings inside bcrypt) does not have a build/ directory. The file it looks for is actually inside the build/ directory from bcrypt, not bindings. However, from the cli, the project just runs fine as it is.

Next is the code it kicks off, nothing special I guess:

// line 4
  var bcrypt = require("bcrypt"),
// line 859
})();

module.exports = player;

Last line 859 referenced in stack trace shows closing. Anyway as Chris mentioned the problem is known, not sure how much this contributes but just to inform, the problem isn't limited to mongoose and affects bcrypt as well (although I'm fairly sure they have a problem too since the build paths don't seem correct, or at least where it seems to think the compiled files are).

@kenny-evitt
Copy link
Contributor

@robjens I'm willing to look into this further if you can share a minimal project with which you can reproduce it.

Also, if you would, please build and run the atom-shell branch version and test connecting to your projects with it.

@kenny-evitt
Copy link
Contributor

@robjens The master branch is now running on Atom; please build that if you can.

@niedzielski
Copy link

I believe I'm seeing the same issue on Linux using the prebuilt 0.7.2 binary and master, 686c9b1. I get the following error when trying to connect to server.js[0]:

server.js[stderr]:
/home/stephen/opt/LightTable/builds/lighttable-0.8.0-linux/resources/app/plugins/Javascript/node/ltnodeclient.js:99
      vm.runInContext(cleanCode(fs.readFileSync(path)), sb, path);
         ^
SyntaxError: Illegal return statement
    at /home/stephen/dev/wmf/restbase/mobileapps/server.js:12:1
    at sbRequire (/home/stephen/opt/LightTable/builds/lighttable-0.8.0-linux/resources/app/plugins/Javascript/node/ltnodeclient.js:99:10)
    at init (/home/stephen/opt/LightTable/builds/lighttable-0.8.0-linux/resources/app/plugins/Javascript/node/ltnodeclient.js:121:3)
    at Socket.<anonymous> (/home/stephen/opt/LightTable/builds/lighttable-0.8.0-linux/resources/app/plugins/Javascript/node/ltnodeclient.js:20:5)
    at Socket.EventEmitter.emit (events.js:117:20)
    at Object.afterConnect [as oncomplete] (net.js:883:10)

[0] The project is fully open source. http://git.wikimedia.org/blob/mediawiki%2Fservices%2Fmobileapps/HEAD/server.js

@kenny-evitt
Copy link
Contributor

@niedzielski Thanks; an example should hopefully make fixing this easier. We're currently working on the next release but, even after it's done, I'm not sure when someone can look at this.

@niedzielski
Copy link

@kenny-evitt, thanks! I don't have bandwidth to help develop a fix but I would be happy to help test one when it does come along.

@macramole
Copy link

yep, getting the same problem using the locomotive library for nodejs

/mnt/stuff/Code/nodejs/muntref/taggeador/node_modules/locomotive/node_modules/actionrouter/node_modules/methods/index.js:9
  return;
  ^^^^^^

SyntaxError: Illegal return statement
    at Object.exports.runInContext (vm.js:43:16)
    at sbRequire (/home/candida/.config/LightTable/plugins/Javascript/node/ltnodeclient.js:99:10)
    at req (/home/candida/.config/LightTable/plugins/Javascript/node/ltnodeclient.js:79:12)
    at /mnt/stuff/Code/nodejs/muntref/taggeador/node_modules/locomotive/node_modules/actionrouter/lib/router.js:4:15
    at Object.exports.runInContext (vm.js:44:17)
    at sbRequire (/home/candida/.config/LightTable/plugins/Javascript/node/ltnodeclient.js:99:10)
    at req (/home/candida/.config/LightTable/plugins/Javascript/node/ltnodeclient.js:79:12)
    at /mnt/stuff/Code/nodejs/muntref/taggeador/node_modules/locomotive/node_modules/actionrouter/lib/index.js:4:18
    at Object.exports.runInContext (vm.js:44:17)
    at sbRequire (/home/candida/.config/LightTable/plugins/Javascript/node/ltnodeclient.js:99:10)

@cldwalker
Copy link
Member

@niedzielski issue seems separate and I've made LightTable/Javascript#18 for it
Closing issue as we don't have reproducible steps. If still interested, please reopen it here with reproducible steps as demonstrated in LightTable/Javascript#18

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