Docker config step missing? 400 reason: connect ECONNREFUSED
See original GitHub issueI was running the docker version of this twin explorer, and getting a 400 error from the Identity.
per the docs I did:
- Access tokens enabled
- URI callback
http://localhost:3000
added
Application runs fine, however the credential issue below.
AuthenticationError: ManagedIdentityCredential authentication failed.(status code 400).
More details:
request to http://169.254.169.254/metadata/identity/oauth2/token?resource=https%3A%2F%2Fdigitaltwins.azure.net&api-version=2018-02-01 failed, reason: connect ECONNREFUSED 169.254.169.254:80
at ManagedIdentityCredential.<anonymous> (/usr/src/app/client/node_modules/@azure/identity/dist/index.js:1077:23)
at Generator.throw (<anonymous>)
at rejected (/usr/src/app/client/node_modules/@azure/identity/node_modules/tslib/tslib.js:112:69)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
- is it required to add
169.254.169.254
to the callback URI in the app, in addition tolocalhost
? - is there another place in the system setup where you need to add the DT credentials?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Docker container having issue communicating to local server ...
Since everything is running on one machine, is there a reason you configured server.ui.graphql_url to be different than its default (localhost)?.
Read more >Node.js Error: connect ECONNREFUSED - Stack Overflow
ECONNREFUSED error means that connection could not be made with the target service (in your case localhost:8080 ).
Read more >Troubleshoot Docker Engine installation
Your Docker client is attempting to connect to a Docker daemon on a different host, and that host is unreachable. To see which...
Read more >Docker Tools Tips and Tricks - Visual Studio Code
Docker containers and images have disappeared from Docker view ... This is most likely caused by a conflict with another extension called Docker...
Read more >The connection to the server localhost:8080 was refused
when you run any kubectl or a similar command in Kubernetes you may get an error message like this The connection to the...
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 FreeTop 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
Top GitHub Comments
Well, the following Dockerfile does appear to be working fine again. I’ll try to brush it up a little bit (I’ll also try to convert it into a multi-stage build in order to reduce the image size) and create a PR.
I can replicate the issue and would say that the problem with the authentication is related to the changes mentioned here: https://github.com/Azure-Samples/digital-twins-explorer/commit/52f6de60a04d32776a626ff05b59ae99656a0154
I have manually tried to install the azure CLI and run
az login
within the docker image and that seems to work, will have to integrate that into the Dockerfile & update the instructions.