Next.js - app stuck at "listening xxx" / healthz not called

Hey!

This seem similar to the nature of Render Status - New deploys for dynamic apps failing in Frankfurt.

I have two identical apps running on render - one for my main and one for my my develop branch - been deploying fine for months. Yesterday [and today] I’ve been trying to do a new release on prod (main) and the app gets stuck at ready - started server on 0.0.0.0:3000, url: http://localhost:3000.

This looks the same on both my develop and main branch - the only difference is that the main branch gets stuck there where develop goes on and calls the /api/healthz which main does not.

It was deploying fine a week ago and I have not updated any environment variables or anything since then.

Server ids:

  • main (borked): srv-c1gs1udua9vtg41lana0
  • develop (working): srv-c1es4ebjbvm0e3g1bo80

I just did an experiment - I made a fork off my latest commit that is deployed and added one useless commit and made a PR deployment against main - it’s not working. With this I can pretty confidently conclude this has to be on render’s end.

It gets stuck here:

More context: this is a Frankfurt deployment.

I’m going on holiday after today for two weeks which is why I wanted to push this yesterday – I would much appreciate a quick resolution to this. Even if it is risky, I can push this tonight if you can resolve the underlying issue.

I’m also on your Slack if you want to contact me directly there.

Thanks.

More context - here’s the PR that I used to verify “it’s not me, it’s you”

  • srv-c3a5eoc7o9q6dup7n580
  • It’s a fork off 17a7ec76cf6c6c21e871306f5dc4c7cc5fef0859 which is what is running in prod right now
  • The only change commit I did was to add more logging to the health endpoint - see screenshot of diff here:

Hey Katt,

During automatic port detection, for some reason we are identifying port 3000 as a non-HTTP port and falling back to the default of 10000. In order to resolve this, you can either set the PORT environment variable yourself to tell Render which port to serve traffic on or you can update your code to read the PORT environment variable and listen on that value, which Render will set if you haven’t overridden it.

You can see the port that Render is using by looking at the “Internal Address” at the top of the service page on the dashboard, but that is understandably easy to miss if you don’t know to look for it. We can do more to make this more clear. I’ll open an internal issue to see how we can improve this experience.

2 Likes

This is really weird - both that it’s on only one of the identical apps and that it’s a new issue.

I solved it by doing "start": "next start --port 10000", in my package.json