-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
sometimes an ssl error takes down whole process #301
Comments
Hi @SaulMoonves, can you provide an example that is able to reproduce the issue? |
I will try, this error is killing me. Please give me time. |
Had to switch to disabling SSL verification for reasons, and that change made this problem go away. Closing since it seemed I was the only one who had the problem and now I don't. |
@SaulMoonves Could you reopen? I am experiencing the same issue |
@puckey could you share a small code sample that reproduces the problem? Even better if using Docker. I'm not able to reproduce this issue. |
tracked down the issue to the |
I am able to trace this to a combination of Using Node v14.17.4 on Ubuntu 20.04.1 LTS (but can not reproduce locally on my mac) I am requesting a url through https which does not support it: curly.get('https://radio.infoo.ro:8600/;', {
verbose: true,
timeoutMs: 5000,
sslVerifyPeer: true,
followLocation: true
}); gives the following result:
So far so good. When I perform the query and at the same time perform an ssl postgres sql query using (async () => {
curly.get('https://radio.infoo.ro:8600/;').catch(error => {
console.error(`Swallow ssl error`, { error });
});
await db.sql`select now()`.run(pool);
})(); will intermittently result in:
If I leave out the curl call, I never receive this ssl error. |
It seems that the pg native library shutdowns the SSL backend while it is still in use by the addon. Could you try using node.js own |
When I use the https module, the query is not interrupted (also tested this in a loop to make sure): import https from 'https';
(async () => {
const req = https.request('https://radio.infoo.ro:8600/;');
req.on('error', e => {
console.error(e);
});
req.end();
console.log('db result', await db.sql`select now()`.run(pool));
})(); output:
|
Thanks @puckey! Could you try the following one, without calling import https from 'https';
(async () => {
https.get('https://radio.infoo.ro:8600/;', (res) => {
res.on('data', (d) => {});
}).on('error', (e) => {
console.error(e);
});
console.log('db result', await db.sql`select now()`.run(pool));
})(); |
Then I get:
|
Does the same error happens if you await the curly call? |
Then the error is still logged to the console, but it does not throw: (async () => {
while (true) {
await curly.get('https://radio.infoo.ro:8600/;').catch(error => {
console.error(`Swallow ssl error`, { error });
});
console.log(await db.sql`select now()`.run(pool));
}
})();
|
This does throw: (async () => {
while (true) {
await curly.get('https://radio.infoo.ro:8600/;').catch(error => {
console.error(`Swallow ssl error`, { error });
});
}
})();
(async () => {
while (true) {
console.log(await db.sql`select now()`.run(pool));
}
})(); output:
|
Thanks for all the code samples, I will try to reproduce it when I get some time this week. 👍 |
It has been a while since I commented on this issue. I had no success trying to reproduce it when I tried. When I was debugging this, I found that Any help or hints on what might be wrong are appreciated. |
This still happens to me, but only very infrequently now. In my current application I spawn a hundred or more promises doing (among other things) node-libcurl calls and put them all in a Promise.allSettled(promises), and the vast majority of the time it works as intended. The promises also are doing pg queries too, the original case of the problem seemed to coincide with pg, but is fixed or greatly minimized now if that is the cause. Just adding info in case it might be helpful. From my application's perspective it works good enough, in the rare case this happens I just retry and it usually works. |
I am having the same issue. I am using this sample
Please how do I disable ssl check? |
@adimscredit, you can use |
To keep the maintainability of this project, I am closing old tickets (sorry if your ticket was kept open for so long without feedback). If the issue continues with the latest version of node-libcurl, please feel free to create a new ticket or re-open. |
I'm using curly inside a node fork process. when this error happens it does something that terminates the IPC between child and parent. Doesn't seem catchable, all I can do is detect the process had an error in the parent process, then force exit it and spawn a replacement. that works about 99% of the time, sometimes it just hangs and I find the process stalled when I look at it later, but that might be a node thing.
Inside the child process I'm calling 4 promises with curly in them and using Promise.all on them.
I can provide any other info needed.
host system ubuntu 20.04 amd64
libcurl: 7.68.0-1ubuntu2.5
curl output:
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
The text was updated successfully, but these errors were encountered: