Fly CLI breaks deploying local image to registry

I have an app that auto deploys via github actions. It first pulls the previously-built image locally and then uses that image to deploy to fly. This was working as of yesterday (0.3.4) but is failing today (0.3.5).

  deploy:
    name: deploy
    runs-on: ubuntu-latest
    needs:
      - build
      - wait_for_tests
    permissions:
      contents: read
      packages: read
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Log in to GitHub Packages
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Pull image
        run: docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}

      - name: Setup flyctl
        uses: superfly/flyctl-actions/setup-flyctl@master

      - name: Deploy to Fly
        run: flyctl deploy --image=ghcr.io/${{ github.repository }}:${{ github.ref_name }}
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Yesterday I was able to deploy properly (with flyctl 0.3.4):

Run superfly/flyctl-actions/setup-flyctl@master
Acquired 0.3.4 from https://github.com/superfly/flyctl/releases/download/v0.3.4/flyctl_0.3.4_Linux_x86_64.tar.gz
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/6032ebe7-793b-4d37-bb5b-63b94eff0253 -f /home/runner/work/_temp/59363c13-23a3-4774-a2e1-e0c897c8f4ed
Successfully cached flyctl to /opt/hostedtoolcache/flyctl/0.3.4/x86_64
Added flyctl to the path
Run flyctl deploy --image=ghcr.io/owner/repo:v0.22.96
==> Verifying app config
--> Verified app config
Validating /home/runner/work/api/api/fly.toml
✓ Configuration is valid
==> Building image
Searching for image 'ghcr.io/owner/repo:v0.22.96' locally...
image found: sha256:digest
==> Pushing image to fly
The push refers to repository [registry.fly.io/app]
81fa8d080a73: Preparing
0523efc50136: Preparing
69fcb48b66de: Preparing
62a49c2ce6ce: Preparing
78561cef0761: Preparing
78561cef0761: Layer already exists
69fcb48b66de: Pushed
81fa8d080a73: Pushed
62a49c2ce6ce: Pushed
0523efc50136: Pushed
deployment-01J7YV8GERFPH6A3GW6E079D55: digest: sha256:digest size: 1364
--> Pushing image done

Watch your deployment at https://fly.io/apps/app/monitoring

Running app release_command: /app/bin/migrate
Updating existing machines in 'app' with canary strategy
Checking DNS configuration for app.fly.dev

Visit your newly deployed app at https://app.fly.dev/

Today, it fails to deploy:

Run superfly/flyctl-actions/setup-flyctl@master
Acquired 0.3.5 from https://github.com/superfly/flyctl/releases/download/v0.3.5/flyctl_0.3.5_Linux_x86_64.tar.gz
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/70a01b8d-21e6-4f14-b8bd-149d3f27588e -f /home/runner/work/_temp/ce3848ee-3bc0-46a6-892f-52ae53f29ff2
Successfully cached flyctl to /opt/hostedtoolcache/flyctl/0.3.5/x86_64
Added flyctl to the path
Run flyctl deploy --image=ghcr.io/owner/repo:v0.23.0
==> Verifying app config
--> Verified app config
Validating /home/runner/work/api/api/fly.toml
✓ Configuration is valid
==> Building image
Searching for image 'ghcr.io/owner/repo:v0.23.0' remotely...
==> Building image
Searching for image 'ghcr.io/owner/repo:v0.23.0' remotely...
Error: failed to fetch an image or build from source: Authentication required to access image "ghcr.io/owner/repo:v0.23.0"
Error: Process completed with exit code 1.

Can you provide some help? Thanks

Does switching back to v0.3.4 work? That would help diagnose the issue.

Switching back to 0.3.4 fails as well. Seems to be a different issue.

There wasn’t any changes from my side on the repo or fly apps.

One thing you can try for now is adding --local-only which should always search for your image locally first.

1 Like

Works. thanks!

We encountered this same issue last night.

Did not realize the --local-only would help, we actually implemented direct push to registry.fly.io (and then deploy with -i and it finds the correct image from fly.io own registry).

Probably actually better solution in a long run.

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