Closed kessler closed 12 years ago
/cc @piscisaureus
I've encountered the same issue. The problem is not with the machine, since I can log in to the instance using remote desktop and run the process successful in a command line window.
I have a workaround, though it wont help with this specific test case. Since the error is with file descriptors, disabling stdin/stdout/stderr actually helps. I managed to work around this issue by passing the silent option to the fork:
fork(__dirname + "/test.js", [], { silent: true });
I have also captured a diff of process.env with and without the problem that can be provided on request.
Awesome, this is a good workaround for now...
Node fails because it tries to make the forked worker inherit it's stdio handles, but node's stdio handles are not valid. Apparently node is being started by some process that doesn't set it up properly.
@tjanczuk @glennblock Any ideas why this is the case? Any chance you could fix azure :-)
No idea, but there is a worker process which starts the entry point process in worker role which is where this is happening. We'll have to investigate.
On Mon, Jul 30, 2012 at 10:55 PM, Bert Belder < reply@reply.github.com
wrote:
Node fails because it tries to make the forked worker inherit it's stdio handles, but node's stdio handles are not valid. Apparently node is being started by some process that doesn't set it up properly.
@tjanczuk @glennblock Any ideas why this is the case? Any chance you could fix azure :-)
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7370643
@martinthomson @gblock can you run an experiment and invoke node.exe in Azure by explicitly redirecting inputs and outputs, e.g.
node.exe server.exe 2>&1 > nul < nul
also try that with some file?
@tjanczuk ^-- possible workaround
@tjanczuk is "server.exe" there a typo? because if it does, then I tried with "node.exe server.js 2>&1 > nul < nul" on the emulator and it didn't work (embedded it in the <ProgramEntryPoint commandLine="")
Yes it was a typo, I meant server.js. Did you properly escape the command line (& etc)?
Here is a direct copy paste from my ServiceDefinition.csdef:
<ProgramEntryPoint commandLine="node.exe .\server.js 2>&1 > 1.txt < 2.txt" setReadyOnProcessStart="true" />
p.s if you want, you can try it yourself on an emulator with almost zero work, just clone the git repo mentioned above, it has the barebone code needed to reproduce the problem and is "ready to deploy".
Did it work when you tested @tjanczuk's reco?
On Wed, Aug 1, 2012 at 5:47 AM, yanush < reply@reply.github.com
wrote:
Here is a direct copy paste from my ServiceDefinition.csdef:
<ProgramEntryPoint commandLine="node.exe .\server.js 2>&1 > 1.txt < 2.txt" setReadyOnProcessStart="true" />
p.s if you want, you can try it yourself on an emulator with almost zero work, just clone the git repo mentioned above, it has the barebone code needed to reproduce the problem and is "ready to deploy".
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7412022
It did not... as was mentioned earlier :)
I wasn't sure if its the correct "syntax" though, since I speculated the cli might interpret it as node arguments rather than std redirects.
not sure how its suppose to discern node.exe bla.js a b c from node.exe bla.js 2>&1 > nul < nul
@yanush Can you try if the node.exe from http://2bs.nl/node.zip works for you?
There's a way to run elevated. I need to check what it is.
cab your try this
cmd.exe /k node.exe server.js
On 8/1/12, yanush reply@reply.github.com wrote:
It did not... was mentioned earlier :)
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7415185
just an FYI:
I tried <Runtime executionContext="elevated" ...> (its already included in the problem reproducing code) in ServiceDefinition.csdef, didn't help.
Will try that node.exe now.
@piscisaureus tried that exe now, got the same error (with and without the redirection suggested by @tjanczuk)
Did you try running "cmd.exe /k node.exe server.js" that will spawn a new shell.
On Wed, Aug 1, 2012 at 9:41 AM, yanush < reply@reply.github.com
wrote:
just an FYI:
I tried <lRuntime executionContext="elevated" ...> (its already included in the problem reproducing code) in ServiceDefinition.csdef, didn't help.
Will try that node.exe now.
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416099
Just tried that as well, it crashes the VM spawned by the emulator, I think because it doesn't have cmd.exe on path, i'm just checking that out now
You probably have specify the fully qualified path or use environment variables to get to it.
On Wed, Aug 1, 2012 at 9:52 AM, yanush < reply@reply.github.com
wrote:
Just tried that as well, it crashes the VM the emulator spawns, I think because it doesn't have cmd.exe on path, i'm just checking that out now
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416243
You should be able to test in the emulator first.....
On Wed, Aug 1, 2012 at 9:55 AM, Glenn Block glenn.block@gmail.com wrote:
You probably have specify the fully qualified path or use environment variables to get to it.
On Wed, Aug 1, 2012 at 9:52 AM, yanush < reply@reply.github.com
wrote:
Just tried that as well, it crashes the VM the emulator spawns, I think because it doesn't have cmd.exe on path, i'm just checking that out now
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416243
Does it repro in the emulator btw?
On Wed, Aug 1, 2012 at 9:52 AM, yanush < reply@reply.github.com
wrote:
Just tried that as well, it crashes the VM the emulator spawns, I think because it doesn't have cmd.exe on path, i'm just checking that out now
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416243
This occurs on both 32bit and 64bit flavors of node.
Here is a link to a git repo:
https://github.com/yanush/spawn-child-process-problem
containing a ready to deploy azure package with the code above, reproducing the problem.
run in your emulator or deploy to a real vm.
Yep :)
and also, managed to get the cmd.exe to work after welding the hard paths of cmd.exe, node.exe and server.js into the ServiceDefinition.csdef. It didn't solve the problem; I'm still getting EBADF.
OK, so
right?
On Wed, Aug 1, 2012 at 9:57 AM, yanush < reply@reply.github.com
wrote:
This occurs on both 32bit and 64bit flavors of node.
Here is a link to a git repo:
https://github.com/yanush/spawn-child-process-problem
containing a ready to deploy azure package with the code above, reproducing the problem.
run in your emulator or deploy to a real vm.
Yep :)
and also, managed to get the cmd.exe to work after welding the hard path into the ServiceDefinition.csdef. It didn't solve the problem; I'm still get EBADF.
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416323
I'm on #node.js atm if you want to make this dialog more direct.
BTW, thanks for trying this stuff out :-)
On Wed, Aug 1, 2012 at 9:57 AM, yanush < reply@reply.github.com
wrote:
This occurs on both 32bit and 64bit flavors of node.
Here is a link to a git repo:
https://github.com/yanush/spawn-child-process-problem
containing a ready to deploy azure package with the code above, reproducing the problem.
run in your emulator or deploy to a real vm.
Yep :)
and also, managed to get the cmd.exe to work after welding the hard path into the ServiceDefinition.csdef. It didn't solve the problem; I'm still get EBADF.
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416323
So far the only thing that worked is the silent: true workaround. So unless I did something wrong with my other experiments (which is always possible) all the other workarounds in your list, don't work.
Ohh and cheers, no thanks are needed :)
Which "silent: true" workaround was that? I must have missed it.....
On Wed, Aug 1, 2012 at 10:03 AM, yanush < reply@reply.github.com
wrote:
So far the only thing that worked is the silent: true workaround. So unless I did something wrong with my other experiments (which is always possible) all the other workarounds in your list, don't work.
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416406
first comment by @martinthomson on this thread (3rd box from the top)
Another important FYI
I tested this problem on all versions of node between 0.7.5 - 0.8.4, 0.7.9 version is the last one that has forking work on azure, 0.8.0 forking stops working. The error on 0.8.0 is a little bit different; its a number - 6 instead of EBADF.
This is really important info. Thanks for all the investigation so far!
On Wed, Aug 1, 2012 at 10:19 AM, yanush < reply@reply.github.com
wrote:
Another important FYI
I tested this problem on all versions of node between 0.7.5 - 0.8.4, 0.7.9 version is the last one that has forking work on azure, 0.8.0 forking stops working. The error on 0.8.0 is a little bit different; its a number - 6 instead of EBADF.
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7416621
@piscisaureus is it possible this is a regression introduced after node 0.7.9? Apparently it worked before then.
@yanush the difference between "UNKNOWN system errno 6" and EBADF is not really relevant - this is exactly the same error.
@piscisaureus yup I know, merely stated it as evidence to the "detailed" analysis I've made :)
Unfortunately I can't really debug this, because the azure sdk won't install on my machine (the installer just hangs).
I can setup a remote VM for you to do as you like... how about that?
Thanks Yanush
I had skyped with Bert and I am setting up Bert a box with the SDK that he can remote into. I had a VM already setup with VS (he needs the debugger) so it's quick for me.
Thanks Glenn
Good news, I would greatly appreciate it if you keep me in the loop :)
Yanush, you said the error occurs in the emulator as well? Bert tried and doesn't see that....
On Thu, Aug 2, 2012 at 12:07 AM, yanush < reply@reply.github.com
wrote:
Good news, I would greatly appreciate it if you keep me in the loop :)
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7431598
https://github.com/yanush/spawn-child-process-problem/blob/master/emulator.png
Did u use the same deployment I used ? (taken from the git repo)
Also @martinthomson encountered the same issue, though not sure if he ran into it in the emulator as well
@bertbelder did you try this code?
On Thu, Aug 2, 2012 at 5:43 AM, Yaniv Kessler < reply@reply.github.com
wrote:
Also @martinthomson encountered the same issue, though not sure if he ran into it in the emulator as well
Reply to this email directly or view it on GitHub: https://github.com/joyent/node/issues/3779#issuecomment-7440972
However it just occurred to me that if @piscisaureus didn't ran into this then maybe its a problem with the deployment setup and he did something different. Mine own is based on HelloWorker from azure sdk...
@piscisaureus can u share your deployment settings (ServiceDefinition.csdef and the others) ?
@yanush Yes I checked out your repo and ran in in the azure emulator. No problem
@piscisaureus that is bad news (for me)... now what do I do?
@yanush http://yfrog.com/oejqgcp
@piscisaureus What version of azure sdk u have there?
@yanush I am not saying there is no issue - I just couldn't reproduce it, which makes it hard to fix.
I am going to try with a real azure box first, I don't have a plan B yet.
@yanush How do I find out? It was installed by @glennblock
Are you on irc by any chance?
server.js:
test.js
When run on the same machine with normal node.exe process, this code executes fine, however when deployed to an azure emulator or a real azure vm with the same node.exe being used, code fails with the following: (node v0.8.0)
or on latest node (v0.8.4):
This occurs on both 32bit and 64bit flavors of node.
Here is a link to a git repo:
https://github.com/yanush/spawn-child-process-problem
containing a ready to deploy azure package with the code above, reproducing the problem.
run in your emulator or deploy to a real vm.