During Release "Error server returned a non-200 status code: 504"

Hello, I have a Fly app that has been seeing consistent issues during deployment. The first couple days there were no issues deploying the app, but the app over the past few days will not complete the deployment process:

...
image size: 1.8 GB
==> Creating release
Error server returned a non-200 status code: 504

When I previously had this happen, I had to delete the app entirely from Fly and re-create it. However, this 504 issue has come back with the new app.

That means our API is timing out. Possibly because 1.8GB is pretty large for a Docker image.

If you run fly status, you may see the new release proceeding in the background.

Also, if you run LOG_LEVEL=debug fly deploy, you’ll be able to see the exact API call that’s timing out.

Thanks-- the size is really a lot of node_modules junk, so I am working on removing it. But, this is happening even with a nearly empty node:18-alpine image:

Dockerfile

FROM node:18-alpine

ENV NEXT_TELEMETRY_DISABLED=1

ENV NODE_ENV=production

Output with debug enabled

DEBUG <-- 200 https://api.fly.io/graphql (172.71ms)

{
  "data": {
    "finishBuild": {
      "id": "760642",
      "status": "completed",
      "wallclockTimeMs": 10434
    }
  }
}
image: registry.fly.io/my-app:deployment-XXX
image size: 173 MB
==> Creating release
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "mutation($input: DeployImageInput!) { deployImage(input: $input) { release { id version reason description deploymentStrategy user { id email name } evaluationId createdAt } releaseCommand { id command evaluationId } } }",
  "variables": {
    "input": {
      "appId": "aviation-app",
      "image": "registry.fly.io/my-app:deployment-XXX",
      "services": null,
      "definition": {
        "deploy": {
          "strategy": "bluegreen"
        },
        "processes": {
          "myprocess": "yarn start"
        }
      },
      "strategy": null
    }
  }
}

DEBUG {}
DEBUG <-- 504 https://api.fly.io/graphql (1m0.17s)

DEBUG <html><body><h1>504 Gateway Time-out</h1>
The server didn't respond in time.
</body></html>

Error server returned a non-200 status code: 504

fly status

fly status
App
  Name     = [redacted]-app
  Owner    = [redacted]
  Version  = 17
  Status   = running
  Hostname = [redacted]-app.fly.dev
  Platform = nomad

Instances
ID      	PROCESS         	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS	RESTARTS	CREATED
xxx	myprocess	17     	iad   	run    	running	             	0       	2023-01-19T04:07:08Z	

The only status here is from the existing, running application and does not show any activity from deploys attempted in the last 2 days.

For what it’s worth, I was able to reduce the image size to < 500mb with my app and it is still resulting in 504s. But, if I flyctl launch into a new application, it is able to deploy immediately with no problems.

I still have the same issue, please handle this error. It’s pretty useless when I can’t even deploy.

Just want to share, I solved it by deleting the runner app. It provisioned new VM runner when I start to deploy again, then suddenly the issue is resolved.

I am also having this same issue on fly launch, so there isn’t really even anything to delete…

It’s my first time with fly.io and I’m stuck with fly launch, it always “Error: server returned a non-200 status code: 504”
Is there any command to show the log of what happen? (it doesn’t go to the step image size: xxGb like OP)

having the same issue, I think its on their end.

1 Like

Same issue. No update to my organizations status page (the “Service interruptions, incidents or issues affecting the apps in your organization” page) or the public status page at https://status.flyio.net/.

Statusing helps real users, otherwise we’re all replying in this thread :slight_smile: (Reliability: It's Not Great)

1 Like

Yeah I still see the nothing on the status page…

I’m running into a similar issue trying to set a secret. I’ve sent in a support email.

1 Like

Ran into the same issue as well

  • tried deploying new apps
  • machines deployed but stuck in replacing state
  • destroyed machines, and redeployed, machines stuck in created state
  • destroyed builder because this was always my fallback because reasons (???)
  • redeployed apps, now builder wont create, unable to deploy

…sheeeesh, come on Fly. Been a customer for 2 years and something like this happens every few months.

1 Like

They finally updated status page - https://status.flyio.net/

4 Likes

Hope they fix ASAP.

Not sure if this is a separate issue or not, but I’ve been unable to ssh either.

$ fly ssh console
Error: create ssh certificate: server returned a non-200 status code: 504 (if you haven't created a key for your org yet, try `flyctl ssh issue`)

$ fly ssh issue
Error: server returned a non-200 status code: 504

I believe the issues are connected.

It’s working for me now

2 Likes

working on my end as well