404 failure with deployment with remix blues stack

Hi everyone,

I’ve recently setup a new Remix project using the Blues-stack (GitHub - remix-run/blues-stack: The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.). However, consistently the project is failing on the docker build step with a 404 error. This is a copy of the docker output:

#19 3.306 Building Remix app in production mode...
#19 3.771 Built in 464ms
#19 4.060 
#19 4.060 > build:server
#19 4.060 > esbuild --platform=node --format=cjs ./server.ts --outdir=build
#19 4.060 
#19 4.070 
#19 4.070   build/server.js  3.2kb
#19 4.070 
#19 4.070 ⚡ Done in 2ms
#19 DONE 4.1s

#20 [stage-4 3/6] COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma
#20 DONE 0.2s

#21 [stage-4 4/6] COPY --from=build /myapp/build /myapp/build
#21 DONE 0.0s

#22 [stage-4 5/6] COPY --from=build /myapp/public /myapp/public
#22 DONE 0.0s

#23 [stage-4 6/6] ADD . .
#23 DONE 0.0s

#24 exporting to image
#24 exporting layers
#24 exporting layers 7.5s done
#24 ...

#25 [auth] sharing credentials for registry.fly.io
#25 DONE 0.0s

#24 exporting to image
#24 exporting manifest sha256:555d69678b1111c7d39670e6497734a0b7233b421ef5a9730d41395eb00572b2 done
#24 exporting config sha256:271e7ab0d8eb33f55a70d4e4584f41b69032788c90ae6[323](https://github.com/victorias/worth/runs/5683958837?check_suite_focus=true#step:8:323)0dae105f5a3c419a done
#24 pushing layers
#24 pushing layers 0.1s done
#24 ERROR: unexpected status: 404 Not Found
 > exporting to image:
error: failed to solve: unexpected status: 404 Not Found
Error: buildx failed with: error: failed to solve: unexpected status: 404 Not Found

The github action workflow step that is being run looks like this:

    name: 🐳 Build
    # only build/deploy main branch on pushes
    if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
    runs-on: ubuntu-latest
      - name: 🛑 Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.9.1

      - name: ⬇️ Checkout repo
        uses: actions/checkout@v3

      - name: 👀 Read app name
        uses: SebRollen/toml-action@v1.0.0
        id: app_name
          file: "fly.toml"
          field: "app"

      - name: 🐳 Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      # Setup cache
      - name: ⚡️ Cache Docker layers
        uses: actions/cache@v2
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-
      - name: 🔑 Fly Registry Auth
        uses: docker/login-action@v1
          registry: registry.fly.io
          username: x
          password: ${{ secrets.FLY_API_TOKEN }}

      - name: 🐳 Docker build
        uses: docker/build-push-action@v2
          context: .
          push: true
          tags: registry.fly.io/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }}
          build-args: |
            COMMIT_SHA=${{ github.sha }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

      # This ugly bit is necessary if you don't want your cache to grow forever
      # till it hits GitHub's limit of 5GB.
      # Temp fix
      # https://github.com/docker/build-push-action/issues/252
      # https://github.com/moby/buildkit/issues/1896
      - name: 🚚 Move cache
        run: |
          rm -rf /tmp/.buildx-cache
          mv /tmp/.buildx-cache-new /tmp/.buildx-cache

I’ve been advised that possibly my Github FLY_API_TOKEN secret is incorrect, but I’ve already tried updating that and it hasn’t resolved the issue. Any help is much appreciated!

Wow that’s a really strange error.

Are you comfortable inviting me to the GitHub project for this so I can poke at it? My GitHub username is mrkurt.

Thank you so much! I’ve sent you an invitation from

I think the app name in fly.toml wasn’t correct. Can you check and see if the <name>-4865 was intentional in there?

That 404 is coming from our registry because it’s trying to push to an app that doesn’t exist.

Oh it also looks like the FLY_API_TOKEN secret isn’t set properly for the GitHub repository. You can get that value by running flyctl auth token locally, or generate one here: Sign In · Fly