Docker app fails to deploy from GHA ("could not find App")

fly deploy --remote-only works from my dev machine (Macbook), but has an error in GHA. Local flyctl version: fly v0.0.522 darwin/amd64 Commit: 336114ae BuildDate: 2023-04-15T06:13:21Z

Build log:

==> Verifying app config
Validating <redacted>/fly.toml
--> Verified app config
WARNING: Failed to fetch platform version: Could not find App "<redacted>"
✓ Configuration is valid
Error: Could not find App "<redacted>"

Run 'flyctl --help' for usage.

Error: Process completed with exit code 1.

Workflow file:

  1 name: Fly Deploy
  2
  3 on:
  4   push:
  5     branches:
  6       - main
  7
  8 env:
  9   MIX_ENV: main
 10
 11 jobs:
 12   deploy-backend:
 13     runs-on: ubuntu-latest
 14     defaults:
 15       run:
 16         working-directory: ./backend
 17     steps:
 18       - uses: actions/checkout@v3
 19       - uses: superfly/flyctl-actions/setup-flyctl@master
 20       - run: flyctl deploy --remote-only
 21         env:
 22           FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
 23
 24   deploy-mqtt-broker:
 25     runs-on: ubuntu-latest
 26     defaults:
 27       run:
 28         working-directory: ./mosquitto
 29     steps:
 30       - uses: actions/checkout@v3
 31       - uses: superfly/flyctl-actions/setup-flyctl@master
 32       - run: flyctl deploy --remote-only
 33         env:
 34           FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

  1 FROM eclipse-mosquitto
  2 COPY mosquitto.conf mosquitto/config/mosquitto.conf
  3 COPY password_file etc/mosquitto/password_file

fly.toml

app = "<redacted>"
kill_signal = "SIGINT"
kill_timeout = 5
mounts = []
primary_region = "<redacted>"
processes = []

[[services]]
  internal_port = 1883
  protocol = "tcp"

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    port = 1883

Could this be due to the internal port I’m using? I admit I don’t really understand the difference between port and internal port. 8080 is “recommended” but I’m not sure what impact using that port has on my application. Does it mean that my app (the container) needs to listen on that port instead of 1883, which is what the mqtt broker uses by default?

EDIT: I changed the port to 8080 and it had the same result.

@dpurrington I don’t think it’s related to the internal port. That error message means that flyctl is not able to find a record of your app. That is, flyctl is asking the API for details about <redacted> and the API is telling it that the app simply doesn’t exist.

Since it’s working on your dev machine, and since IIRC you were working with deploy tokens, I think it might actually be an authorization error in disguise. If FLY_API_TOKEN is a deploy token that isn’t authorized for the <redacted> app, then I believe that the API will claim that <redacted> doesn’t exist (even if it does).

1 Like

That tracks, since the token is actually valid, but doesn’t have visibility into the other app. This article says deploy tokens cannot be shared between apps, so I will create another one. If there is a way to share them (and you’re not recommending against it) please let me know. If I shouldn’t be using deploy tokens, please point me the right way too.

Thanks for the advice.

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