-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process spawn missing stdout on Ubuntu 20.04 #32430
Comments
I'm not able to reproduce the issue (on Ubuntu 18.04 FWIW) with node v10.x, v12.x, or master. |
@doubleswirve - do you have |
Thanks for double-checking me @mscdex. I should've mentioned it, but I had installed node via a Snap package. To make sure I had originally installed it correctly, I removed the snap package and ran: sudo snap install node --classic --channel=12 When running After testing the snap package installation, I removed the snap package and followed the binary archive installation directions. Running Additionally, I tested this via Docker in the linked test repo and that does work as well. So maybe I was having an issue with my snap installation. Feel free to close. Let me know if it would be helpful to post this elsewhere re: snap. Thanks again! |
the reason why I ask (
as you can see, the script is attempted to be interpreted by bash, not by node - as it is not in the PATH. I am not saying this |
if you can check, we can close this gracefully, with clear inference. |
Howdy @gireeshpunathil, with the snap installation (when I'm not receiving the expected output), When the output does work as expected (via the binary archive installation), Hope that helps; let me know if I missed anything. |
@doubleswirve - thanks. that means your PATH looks all right. To be double sure, can you see if Either way, I would be very interested to see |
@gireeshpunathil, I reinstalled node via snap, so that Re: the |
@doubleswirve - as |
@gireeshpunathil, thanks for the info. When running the In both cases, I ran |
@doubleswirve - looks like you are running some other program? I am unable to match the context in the strace with the above sample code. For example, Can you also try adding an error callback for the child process? (I tried but did not catch anything in my side) proc.on('error', (e) => {
console.log(e)
}) |
@gireeshpunathil, strange, I thought I was running the right command. I've updated the test repo just in case it helps. I added a shell script for the Running I also added the |
@doubleswirve - with the supplied there are a lot of (48)
there is no evidence of the child process being invoked, while |
@gireeshpunathil, the docker version (which installs node via binary archive) is working for me as well. Installing node on my host via binary archive also works for me. I'm only seeing the unexpected output when running I couldn't find a good way to install node via snap within docker, but maybe I'll poke around later and see if I can recreate in that environment. |
As far as I can understand those very tough discussions about Snap, I looks like the file descriptor can not be passed from snap to snap. The only solution I did find is... not to use snap for nodejs. |
Temporary workaround #37982 (comment) |
I'm closing this as it's not a node bug, it's a snap issue. |
157774391120.04~05e6ba8-Ubuntu SMP Tue Dec 31 00:30:08 UTC x86_64 x86_64 x86_64 GNU/LinuxWhat steps will reproduce the bug?
Note: Test code here as well.
Create an executable
a.js
:When I run
./a.js
, I receive thehello, world
output I'm expecting.Then I create another JavaScript file
b.js
that calls./a.js
:On Linux (unlike macOS),
data
remains an empty string within theclose
event handler.How often does it reproduce? Is there a required condition?
I receive the same output for every run on Linux.
What is the expected behavior?
I expected to receive the same output as macOS (Catalina 10.15.3), i.e.,
What do you see instead?
On Linux, I receive:
Additional information
Thanks for all the help!
The text was updated successfully, but these errors were encountered: