Skip to content
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

throw new Error(res.stderr.toString()) #81

Closed
Messiahhh opened this issue Jul 25, 2017 · 11 comments
Closed

throw new Error(res.stderr.toString()) #81

Messiahhh opened this issue Jul 25, 2017 · 11 comments

Comments

@Messiahhh
Copy link

I use sync-request to send lots of sync request. But after i send part of them,my app crash.
image just like this

@Messiahhh
Copy link
Author

I've seen the source where 'res.stderr.toString' is.It seems that the res.status !== 0,what's that means?

@ForbesLindesay
Copy link
Owner

It means that the background worker that is sending the requests has crashed. I don't know what could be causing this.

@Fly-Style
Copy link

Fly-Style commented Nov 18, 2017

Same story, Node 8.9.
But it doesn`t work at 1 request which I tried to do.

@ForbesLindesay
Copy link
Owner

Could you try using the new version. I've not done anything that I specifically expect to have fixed your issue, but a lot has been re-written, so it's possible things will have resolved themselves.

@biolauri
Copy link

biolauri commented Mar 1, 2018

I stumbled upon the same problem with the latest version (5.0.0) but with a slightly different error message:

node_modules/sync-rpc/lib/index.js:124
         res.stdout.toString() +
                   ^

TypeError: Cannot read property 'toString' of null
   at sendMessage (node_modules/sync-rpc/lib/index.js:124:21)
   at node_modules/sync-rpc/lib/index.js:154:25
   at request (node_modules/sync-request/lib/index.js:28:15)
[…]

I assume that they are related (even mine is thrown in your ForbesLindesay/sync-rpc repo). That's why I comment here instead of opening up a new issue there.

@ForbesLindesay, do you have any guess on this?


Edit: Clearify why I comment here.

@ForbesLindesay
Copy link
Owner

@biolauri thanks for this report, that was really helpful. could you try it out with version 1.3.3 (just released) of sync-rpc and let me know if you get a more helpful error.

@biolauri
Copy link

biolauri commented May 11, 2018

I just updated both dependencies (to [email protected] and [email protected]) and the error above is replaces by the following error instead (which might be a bit more helpful):

node_modules/sync-rpc/lib/index.js:122
     throw res.error;
     ^

Error: spawnSync
/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Default/bin/node E2BIG
   at exports._errnoException (util.js:1050:11)
   at spawnSync (child_process.js:459:20)
   at Object.nodeNC [as fastestFunction] (node_modules/sync-rpc/lib/index.js:94:10)
   at sendMessage (node_modules/sync-rpc/lib/index.js:113:29)
   at node_modules/sync-rpc/lib/index.js:154:25
   at request (node_modules/sync-request/lib/index.js:28:15)
[...]

I'm just guessing, as it seems to be similar to shelljs/shelljs#819: Maybe the input input is too large for (our specific) OS and we're exceeding the maximum OS size limit on command line parameters , so it might be better to pass it as a file. But, again, I'm just guessing blindly.


Edit: Be more precise in the first sentence.

@ForbesLindesay
Copy link
Owner

Thanks @biolauri. That definitely was an issue, and I never would have spotted it without your help. It should be fixed by sync-rpc 1.3.4. Let me know if there are still issues. I really think this one might have fixed it.

@biolauri
Copy link

Not at all! Thank you for your fast reply and fix! 🙇

Unfortunately, I stumbled upon another issue:

node_modules/sync-rpc/lib/index.js:151
    throw error;
    ^

Error: unable to get local issuer certificate
    at extractValue (node_modules/sync-rpc/lib/index.js:149:19)
    at node_modules/sync-rpc/lib/index.js:159:12
    at request (node_modules/sync-request/lib/index.js:28:15)

@ForbesLindesay
Copy link
Owner

@biolauri That doesn't look like an issue that's specific to sync-request. That looks like it's just a problem with certificates on the server you are communicating with. nodejs/help#979 offers some general advice for self-signed certificates. I'm going to close this as it looks like the original issue has been resolved.

@henryfw
Copy link

henryfw commented Jul 9, 2019

Add

process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

Repository owner locked as resolved and limited conversation to collaborators Jul 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants