error connecting to docker: server returned a non-200 status code: 504

Hi, I’m trying to deploy my app to fly, but I’m getting the following error when I execute the command:

Command: fly deploy -c fly.dev.toml

Error:

yarn run v1.22.19
$ fly deploy -c fly.dev.toml
==> Verifying app config
Validating fly.dev.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
WARN Failed to start remote builder heartbeat: server returned a non-200 status code: 504

Error: failed to fetch an image or build from source: error connecting to docker: server returned a non-200 status code: 504
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

So, I added the variable LOG_LEVEL=debug to see more about the error, using the command:

LOG_LEVEL=debug fly deploy -c fly.dev.toml

And I got this output:

DEBUG client initialized.
DEBUG app config loaded from fly.dev.toml
DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "query ($appName: String!) { appbasic:app(name: $appName) { id name platformVersion organization { id slug paidPlan } } }",
  "variables": {
    "appName": "sharely-develop"
  }
}


DEBUG {}
DEBUG <-- 200 https://api.fly.io/graphql (293.67ms)

DEBUG {
  "data": {
    "appbasic": {
      "id": "sharely-develop",
      "name": "sharely-develop",
      "platformVersion": "machines",
      "organization": {
        "id": "AP276N9M5j2qJTaN4YyxZLDRGxCbGeAZR",
        "slug": "juan-perez-512",
        "paidPlan": false
      }
    }
  }
}

==> Verifying app config
DEBUG Config has metrics token

DEBUG Starting task manager
Validating fly.dev.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "query ($appName: String!) { appcompact:app(name: $appName) { id name hostname deployed status appUrl platformVersion organization { id slug paidPlan } postgresAppRole: role { name } imageDetails { repository version } } }",
  "variables": {
    "appName": "sharely-develop"
  }
}


DEBUG {}
DEBUG <-- 200 https://api.fly.io/graphql (159.37ms)

DEBUG {
  "data": {
    "appcompact": {
      "id": "sharely-develop",
      "name": "sharely-develop",
      "hostname": "sharely-develop.fly.dev",
      "deployed": true,
      "status": "deployed",
      "appUrl": "https://2a09:8280:1::1c:5fd8",
      "platformVersion": "machines",
      "organization": {
        "id": "AP276N9M5j2qJTaN4YyxZLDRGxCbGeAZR",
        "slug": "juan-perez-512",
        "paidPlan": false
      },
      "postgresAppRole": null,
      "imageDetails": {
        "repository": "unknown",
        "version": "unknown"
      }
    }
  }
}

==> Building image
DEBUG trying remote docker daemon
DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "mutation($input: EnsureMachineRemoteBuilderInput!) { ensureMachineRemoteBuilder(input: $input) { machine { id state ips { nodes { family kind ip } } }, app { name organization { id slug } } } }",
  "variables": {
    "input": {
      "appName": "sharely-develop",
      "organizationId": null
    }
  }
}


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

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

WARN Failed to start remote builder heartbeat: server returned a non-200 status code: 504

DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "\n# @genqlient\nmutation ResolverCreateBuild ($input: CreateBuildInput!) {\n\tcreateBuild(input: $input) {\n\t\tid\n\t\tstatus\n\t}\n}\n",
  "variables": {
    "input": {
      "appName": "sharely-develop",
      "builderType": "remote",
      "clientMutationId": "",
      "imageOpts": {
        "buildArgs": {},
        "buildPacks": null,
        "builder": "",
        "builtIn": "",
        "builtInSettings": null,
        "dockerfilePath": "",
        "extraBuildArgs": null,
        "imageLabel": "",
        "imageRef": "",
        "noCache": false,
        "publish": true,
        "tag": "registry.fly.io/sharely-develop:deployment-01HB69NWGEEW88MTVJS19WGN0P",
        "target": ""
      },
      "machineId": "",
      "strategiesAvailable": [
        "Buildpacks",
        "Dockerfile",
        "Builtin"
      ]
    }
  },
  "operationName": "ResolverCreateBuild"
}

DEBUG {0x14000c0eb70}
DEBUG <-- 200 https://api.fly.io/graphql (146.94ms)

DEBUG {
  "data": {
    "createBuild": {
      "id": "3621911",
      "status": "started"
    }
  }
}

DEBUG Trying 'Buildpacks' strategy

DEBUG no buildpack builder configured, skipping
DEBUG result image:<nil> error:<nil>

DEBUG Trying 'Dockerfile' strategy

DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "mutation($input: EnsureMachineRemoteBuilderInput!) { ensureMachineRemoteBuilder(input: $input) { machine { id state ips { nodes { family kind ip } } }, app { name organization { id slug } } } }",
  "variables": {
    "input": {
      "appName": "sharely-develop",
      "organizationId": null
    }
  }
}


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

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

DEBUG result image:<nil> error:error connecting to docker: server returned a non-200 status code: 504

DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "\n# @genqlient\nmutation ResolverFinishBuild ($input: FinishBuildInput!) {\n\tfinishBuild(input: $input) {\n\t\tid\n\t\tstatus\n\t\twallclockTimeMs\n\t}\n}\n",
  "variables": {
    "input": {
      "appName": "sharely-develop",
      "buildId": "3621911",
      "builderMeta": {
        "builderType": "",
        "buildkitEnabled": false,
        "dockerVersion": "",
        "platform": "",
        "remoteAppName": "",
        "remoteMachineId": ""
      },
      "clientMutationId": "",
      "finalImage": {
        "id": "",
        "sizeBytes": 0,
        "tag": ""
      },
      "logs": "error connecting to docker: server returned a non-200 status code: 504",
      "machineId": "",
      "status": "failed",
      "strategiesAttempted": [
        {
          "error": "",
          "note": "no buildpack builder configured, skipping",
          "result": "failed",
          "strategy": "Buildpacks"
        },
        {
          "error": "error connecting to docker: server returned a non-200 status code: 504",
          "note": "",
          "result": "failed",
          "strategy": "Dockerfile"
        }
      ],
      "timings": {
        "buildAndPushMs": 60194,
        "buildMs": 60194,
        "builderInitMs": 60194,
        "contextBuildMs": -1,
        "imageBuildMs": -1,
        "pushMs": -1
      }
    }
  },
  "operationName": "ResolverFinishBuild"
}

DEBUG {0x140006c1860}
DEBUG <-- 200 https://api.fly.io/graphql (257.4ms)

DEBUG {
  "data": {
    "finishBuild": {
      "id": "3621911",
      "status": "failed",
      "wallclockTimeMs": 60459
    }
  }
}

DEBUG Task manager done
Error: failed to fetch an image or build from source: error connecting to docker: server returned a non-200 status code: 504

I don’t know what to do… I don’t know if Docker or Fly is down, or something. Thanks

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.