Closed ipetrovic11 closed 2 years ago
What is the expected behavior of a connection reset? This library doesn't come with retries built-in, it seems like the request in the OAuth2 library could just be retried.
Hi @blakeembrey
I don't think that we are looking for retries here.
We just don't want the application to crash(unhandledException) if ECONNRESET happens. It is not well handled.
Just as showcase we tried using the different request libraries, and for example node-fetch worked just fine.
Can you share the version and stack trace?
It might also help to provide whether it’s HTTP1 or 2, or the domain if you’re unsure and I can check.
By node 12+ does that mean you tested on a version later than 12, or just that you tested on 12 and assume it’s broken on later versions. I believe I have a node 12 related hunch that could cause this related to pipelining when this package was migrated to the native node.js utility instead of an NPM module.
@blakeembrey you get read more info here: https://github.com/mulesoft-labs/js-client-oauth2/issues/182#issue-1042063238
We tried with Node 12, 14 ,16
OK, I think I can reproduce it. If you share the installed versions this can be confirmed, but this was fixed in April here: https://github.com/serviejs/popsicle-transport-http/releases/tag/v1.1.4. If you re-install it should have installed the latest version of that package without any issues, unless something has pinned the release specifically to 1.1.3
.
Have you tried doing npm rm client-oauth2 && npm install client-oauth2
to get the latest version?
FWIW, here's the original report with the information that resolved it that matches the same bug you've pointed out: https://github.com/serviejs/popsicle-transport-http/issues/8.
@blakeembrey this could be it, I can see that in our yarn.lock file there is version 1.1.3
I will keep you posted as soon as it is tested, probably early next week.
We are using module https://github.com/mulesoft-labs/js-client-oauth2 which is using popsicle for requests.
ECONNRESET is not well handled with popsicle.
We tested this by using fetch instead of popsicle.
Issue is tested on Node 12+