Debugging connectivity issues | reqError === undefined
See original GitHub issueI’m trying to set up autocannon and think I’m having some connectivity issues. Running against a local instance works fine. However if I target the remote machine I want to test, all requests seem to error. I suspect issues with proxy or broken SSL chains.
I couldn’t figure out how to debug the request errors though. Is there a way to print each requests response/error message? It would help a lot to narrow down the problem.
const inst = autocannon({
url: 'http://localhost:5010/api/v1/endpoint',
connections: 10,
pipelining: 20,
duration: 10,
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: payload
}, (err, res) => {
console.error(err);
console.log(res);
});
let cnt = 0;
inst.on('reqError', e => console.log(`Request error (${cnt++}): ${e}`));
What happens is that I see a lot of those Request error
logs but apparently there is no argument passed to it, so e===undefined
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
node.js - Node debug - undefined error - Stack Overflow
Well it seems to be a problem with the node V0.13.0-pre , I am using on Linux. I tried same code on Windows...
Read more >Resolve Error "$ is undefined" - Cornell University
Use the troubleshooting steps below to resolve the browser Script Error that ... Disable script debugging (Internet Explorer) is checked.
Read more >Fix JavaScript errors that are reported in the Console
In this article. Fix JavaScript errors; Find and debug network issues; Create errors and traces in the Console; See also.
Read more >"Internet Explorer Script Error ... error has occurred on ... - IBM
Resolving The Problem · 1. Launch Microsoft Internet Explorer · 2. Click "Tools - Internet Options" · 3. Click "Advanced" · 4. Scroll...
Read more >express return error
Trouble installing or updating your Adobe app? ... Debugging the network I can clearly see Express returned status 200 with the correct json...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also, for other purposes:
You can access the events the internal http client emits, using the setupClient property of the options. Check here: https://github.com/mcollina/autocannon#client-events (The internal error events aren’t documented, that might be worth a PR)
You can use this to see if the errors are timeouts or connection errors, and if they’re connection errors, get access to the error object passed to the socket that created it. Here’s the snippet you need:
I understand that benchmarking through a proxy does not make sense. However I also don’t want to deploy to the designated test runtime to set the thing up. I was planning on running it with non-benchmark parameters. But I’ll just have to stub the
autocannon
behavior for development then.Feel free to close the issue, I’ll try to PR updated docs with the hints that @thekemkid gave me earlier for future reference. Or if you have any ideas how the error should be propagated I could try to do a code-PR