Pushing to Fly.io container registry - keep getting 404 and not understanding why

Hello,

I am trying to push a container image to Fly.io’s container registry. Here is a snip my CI code:

Note: The ‘repo_path’ env variable is stated at the global level for this CI.

  docker-build-push:
    runs-on: ubuntu-latest
    concurrency:
      group: docker-build-push
    env:
      APP_NAME: "my-app"
      DOCKER_REGISTRY: "registry.fly.io"
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Set Up  CLI
        uses: superfly/flyctl-actions/setup-flyctl@master
      - name: Set Up Docker
        uses: docker/setup-buildx-action@v3
      - name: Log Into  Docker Registry
        run: |
          flyctl auth docker --access-token ${{ secrets.FLY_IO_API_TOKEN }}
          docker info
      - name: Build and Push Docker Image
        run: |
          docker buildx build \
            --push \
            --tag "${{ env.DOCKER_REGISTRY }}/${{ env.APP_NAME }}:${{ github.sha }}" \
            .
        working-directory: "${{ env.repo_path }}/app"

In the job output, the auth seems to succeed, as does the docker build, but I get this error:

#43 ERROR: failed to push registry.fly.io/my-app:4e263ec86a69f10851c9a5aa2700fb8f805ad0c7: unexpected status from POST request to https://registry.fly.io/v2/my-app/blobs/uploads/: 404 Not Found
------
 > exporting to image:
------
ERROR: failed to solve: failed to push registry.fly.io/my-app:4e263ec86a69f10851c9a5aa2700fb8f805ad0c7: unexpected status from POST request to https://registry.fly.io/v2/my-app/blobs/uploads/: 404 Not Found

I’ve been at this for a while and tried all sorts of different strings for the image tag. Can anybody help me figure this out?

Note: I am 1000% sure that the ‘my-app’ exists and that my API token works for all sorts of other API calls etc. I think I am simply formatting it incorrectly but every article I’ve read shows that what I am doing should be correct.

No replies at all?

Do you own the “my-app” app or is that just a placeholder for your actual app’s name? You can check with the flyctl apps ls command.

The only reason I’m double checking this is that app names are global across all users/accounts so it seems unlikely that you were able to claim this name at this point in Fly’s life.

Yes, my app name is unique. I have successfully deployed against it in the past.

Is the Fly.ioFly.io intentional or a typo? Have you tried to execute the steps locally to see if it pushes to the registry correctly.

It looks like the markdown editor pasted that in there on its own, that was not part of my original post. Maybe some sort of automatic embedding that the forum does? It is fixed in the OP, that is not in the CI file.

I still have not found any solution to this.

@naa2785 Can you confirm the token you’re using in the build pipeline secrets.FLY_IO_API_TOKEN has the proper permissions to build and push the image for the app in question?