question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keystone has stopped binding to 0.0.0.0 by default

See original GitHub issue

HI, I am always very keen to deploy and test new releases as soon as possible, in the case of the recent release its seems there is a breaking change that causes the healthcheck config and endpoints declared in extendExpressApp config to be blocked when not using localhost.

I have a micro services setup using AWS ECS Fargate fronted by a Elastic Load Balancer. When i attempted to deploy the recent update to our staging server the keystone service kept failing on rolling update because the container was failing ELB health checks. I was bemused as the Fargate health checks were satisfied but the ELB not.

To prove the recent release was the cause I rolled back and the health checks were successful and the service was deployed.

In respects of the rollback test I decided to do some digging. With a version of the keystone service that was deploying successfully I logged the headers on the request to the health check end point. These logs would appear each for the Fargate container health check and the ELB health check. The first distinct difference noticed was the host header.

Host header for the Fargate health check which was visible before and after update: “localhost:3000” Host header for the ELB which was visible only before the update: “10.0.1.224:3000”

So Fargate is using localhost and ELB using private IP address, which would be expected.

Therefore to replicate / prove this on a local machine:

Start Keystone before the 20221117 upgrades. Execute a curl command to invoke health check endpoint using localhost. curl http://localhost:3000/healthcheck : SUCCESS Execute a curl command to invoke health check endpoint using IP. curl http://192.168.0.10:3000/healthcheck : SUCCESS Start Keystone after the 20221117 upgrades. Execute a curl command to invoke health check endpoint using localhost. curl http://localhost:3000/healthcheck : SUCCESS Execute a curl command to invoke health check endpoint using IP. curl http://192.168.0.10:3000/healthcheck : Failed to connect, Connection Refused.

I have not yet dug into the change set for the upgrade and so have not yet discovered which of the upgraded packages is the culprit. I will try and look into this more later if the Keystone team have not yet responded.

Look forward to the conversation about this issue.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dnmahendracommented, Nov 21, 2022

All container builds stopped working after upgrading to "@keystone-6/core": "3.1.1". Getting the same error as above connection refused. This is happening because the host is binding to localhost inside the container. Setting this option server.options.host to 0.0.0.0 resolved the problem. This option is not documented well.

1reaction
dcousenscommented, Nov 21, 2022

Thanks @dnmahendra for the easy explanation 💛 The behaviour has accidentally been introduced by https://github.com/keystonejs/keystone/pull/8078, I’ll follow this up

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error R10 (Boot timeout) -> Web process failed to bind to ...
My problem is that Keystone is not binding to the port Heroku is setting. ... When Heroku uses the default node version, it...
Read more >
OpenStack Keystone port 5000 used by Python - Server Fault
The error you see is because Keystone is running using the deprecated Eventlet, thus it is listening on the port 5000 .
Read more >
Questions : OpenStack Identity (keystone) - Launchpad Answers
# TODO Properties defined within app not available via pipeline. service_host = 0.0.0.0. # Port the bind the API server to service_port =...
Read more >
Node (keystonejs) address already in use error, but is not ...
First, by default Keystone.JS is using 3001 for https, so you should check if there is something on this port. But the problem...
Read more >
Solved: How to bind http_host to 0.0.0.0 in hue.ini
In cloudera manager HUE configuration web page. I can't find the "http_host" property, the default value is the server hostname but it bind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found