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
Axios makes the whole node.js application stop #3475
Comments
Any news? Issue keeps happening quite frequently, I've talked with other devs and it's the same for them too so definitively not caused from my code |
Same happens for me, but only when "user-agent"/"User-Agent" header is set, the request never goes through nor shows any error whatsoever. |
Can we get an update on this please? |
Hello? Anyone? 😞 |
@whosaidhypno Have you tried using a different library? If the issue is not reproducible with them, then we can say it's related to axios. |
After how many iterations of the while loop does this problem occur? I tried your code and it is not erroring out or crashing.... is it something with your environment? Maybe it can be solved by upgrading node to v |
I am now getting errors too, after ~2000-3000 requests. It is a Walmart Recaptcha error, probably something to do with the rate limit (I get a 412). If I connect from a VPN, the error then disappears for ~2000-3000 requests. If this is the error that you are referring to, it is not an |
The 412 error also occurs in const axios = require('axios');
const fetch = require('node-fetch');
function getRandom() {
return parseInt(Math.random() * 10 ** 10);
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const options = {
url: `https://www.walmart.com/cp/api/get-deals-list?prg=desktop&dealsId=christmas-deals&ps=60&page=1&shelf_id=7662948&shelfType=manual&${getRandom()}=${getRandom()}`, // this is an example endpoint with the same behaviour as the one I'm using, sorry but I can't share the exact one
headers: {
accept: 'application/json',
'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7,fi;q=0.6',
'content-type': 'application/json',
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'
},
responseType: 'json'
};
(async () => {
while (true) {
let res;
try {
res = await fetch(options.url, { ...options, url: undefined });
} catch (err) {
if (err.response) {
console.log(err.response);
} else {
console.log(err.toString());
}
continue;
}
console.log(res.status);
await sleep(2500);
}
})(); |
Please check if this has been fixed with #3694 |
Describe the bug
I am using axios on various node.js page monitors (over 40 sites) and I noticed that on a couple of them, the application suddenly crashes after calling await axios(options) or axios(options).then(). No error is thrown, nothing gets received into the .catch() code block. This issue only happens after the application runs for some time in a while(true) loop, but isn't related to memory usage. I guess there's some unhandled stuff that makes the request stop without rejecting or resolving the Promise.
To Reproduce
Expected behavior
Application keeps running and throws an error if any is caught, but instead it just stops after some hours of running
Environment
Additional context/Screenshots
Only happens on two websites, issue doesn't occur for the others
The text was updated successfully, but these errors were encountered: