RequestError: connect ECONNREFUSED 127.0.0.1:443
See original GitHub issueDescribe the bug
- Node.js version: 14
- OS & version: docker/alpine
Using this library through https://github.com/panva/node-openid-client , when making the initial request of the open id connect discovery document it throws this weird error
Actual behavior
2020-12-28T21:49:39.282Z tenx:lib-auth:http >>> Request GET https://private-oidc-provider.com//.well-known/oauth-authorization-server
2020-12-28T21:49:39.282Z tenx:lib-auth:http Headers: {
'user-agent': 'openid-client', // the one that we use works
accept: 'application/json',
'accept-encoding': 'gzip, deflate, br'
}
2020-12-28T21:49:39.282Z tenx:lib-auth:http Body undefined
2020-12-28T21:49:39.283Z tenx:lib-auth:http >>> Request GET https://private-oidc-provider.com/.well-known/openid-configuration
2020-12-28T21:49:39.283Z tenx:lib-auth:http Headers: {
'user-agent': 'openid-client',// the one that we use works
accept: 'application/json',
'accept-encoding': 'gzip, deflate, br'
}
2020-12-28T21:49:39.283Z tenx:lib-auth:http Body undefined
2020-12-28T21:49:39.297Z tenx:lib-auth:init Error creating costar client AggregateError:
RequestError: connect ECONNREFUSED 127.0.0.1:443
at ClientRequest.<anonymous> (/usr/src/app/node_modules/got/dist/source/core/index.js:957:25)
at /usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:68:19
at Scope._activate (/usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:44:14)
at Scope.activate (/usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:13:17)
at ClientRequest.<anonymous> (/usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:67:20)
at ClientRequest.req.emit (/usr/src/app/node_modules/dd-trace/packages/datadog-plugin-http/src/client.js:93:21)
at ClientRequest.origin.emit (/usr/src/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
RequestError: connect ECONNREFUSED 127.0.0.1:443
at ClientRequest.<anonymous> (/usr/src/app/node_modules/got/dist/source/core/index.js:957:25)
at /usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:68:19
at Scope._activate (/usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:44:14)
at Scope.activate (/usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:13:17)
at ClientRequest.<anonymous> (/usr/src/app/node_modules/dd-trace/packages/dd-trace/src/scope/base.js:67:20)
at ClientRequest.req.emit (/usr/src/app/node_modules/dd-trace/packages/datadog-plugin-http/src/client.js:93:21)
at ClientRequest.origin.emit (/usr/src/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
at maybeSettle (/usr/src/app/node_modules/p-some/index.js:31:11)
at /usr/src/app/node_modules/p-some/index.js:69:23
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Expected behavior
This request to work.
This request works
- running the code locally on a lot of developer machines
- works via curl/wget from inside the Kube cluster node and pods
But it doesn’t work via node-oidc-client and got when running side the pod / container.
Code to reproduce
working on it, but it is hard because it only fails inside the container inside the pod inside the kube cluster
Checklist
- [ x ] I have read the documentation.
- [ x ] I have tried my code with the latest version of Node.js and Got.
Also reported in got’s repo https://github.com/sindresorhus/got/issues/1515
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:20 (6 by maintainers)
Top Results From Across the Web
connect ECONNREFUSED" from got when also requiring ...
got("https://google.com") throws RequestError: connect ECONNREFUSED . ... RequestError: connect ECONNREFUSED 127.0.0.1:443 at ClientRequest.
Read more >Https Request Error: connect ECONNREFUSED 127.0.0.1 ...
So I want to load an image from an external URL. var https = require('node:https'); export const loadImageFromUrl ...
Read more >"Error: connect ECONNREFUSED 127.0.0.1:443" - Forums
How to fix HTTP Request error: "Error: connect ECONNREFUSED 127.0.0.1:443". I'm trying to make a HTTP Get Request but am getting this error....
Read more >RequestError: Error: connect ECONNREFUSED 127.0.0.1:3423
Hello Community! I noticed a few threads regarding this error message as referenced in the title, "RequestError: Error: connect ECONNREFUSED 127.0.0.1:3423" ...
Read more >error: connect econnrefused 127.0.0.1:80 at tcpconnectwrap ...
So better check your URL if are also using axios . Open side panel. AXIOS request: "Error: connect ECONNREFUSED 127.0.
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 when you do any other thing with the library such as fetching user info, refreshing the token et al should get into this error so there’s no easy way around it.
Perhaps this lib could be request-library-agnostic and so if people really want to can replace got for superagent (to say an example).
You can always fork it and do that yourself.
On Wed, Jan 20, 2021 at 1:52 PM agix notifications@github.com wrote:
There is no bug here, you’re simply asking for help diagnosing your environment / build issues. Please open a Q&A discussion instead.
https://github.com/sindresorhus/got/issues/1515 or something similar monkey patching internals is likely the cause. Or just your kubernetes networking setup.