node-libcurl icon indicating copy to clipboard operation
node-libcurl copied to clipboard

curly: fails to add a request in the same event loop

Open kapouer opened this issue 3 years ago • 5 comments

Nothing special (curly + streaming response):

  • request A -> request B fails with "Could not add easy handle to the multi handle"
  • request A -> setImmediate(request B) succeeds

kapouer avatar Feb 01 '22 01:02 kapouer

hi @kapouer, thanks for reporting this.

What is the Node.js version? If you could provide a Dockerfile / .js file that reproduces the issue that would be great.

JCMais avatar Feb 02 '22 11:02 JCMais

Node 12.22.9 on debian/bookworm, with node-libcurl compiled against libcurl4-gnutls-dev 7.81.0. I'll try to isolate the problem.

kapouer avatar Feb 02 '22 11:02 kapouer

Hi, using [email protected] in the same context, I get the same error.

Now my code looks like

await new Promise(resolve => setImmediate(resolve)); // without which it fails
const {
	headers: hlist,
	data,
	statusCode
} = await curly[method](urlObj.href, opts);

However that error had disappeared for some time, and now it's back :( Something has changed - maybe I switched from prebuilt version to --build-from-source.

kapouer avatar Nov 20 '22 23:11 kapouer

Of couse, reinstalling to 2.x still gives the same error - so it's not a regression.

kapouer avatar Nov 20 '22 23:11 kapouer

This is some sort of duplicate of https://github.com/JCMais/node-libcurl/issues/81 I had SSL_VERIFYPEER set to false, and reenabling it fixes the issue.

kapouer avatar Nov 24 '22 22:11 kapouer

To keep the maintainability of this project, I am closing old tickets. If the issue continues with the latest version of node-libcurl, please feel free to create a new ticket.

JCMais avatar Feb 13 '24 21:02 JCMais