Hitting "Not authorized to access this firecrackerapp" upon --remote-only deploy

Deploying my node app from my local machine is working fine, but I’ve got Github Actions configured to deploy and that’s currently failing with a Firecracker authorization error:

##[debug]Evaluating: secrets.FLY_STAGE_API_TOKEN
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'FLY_STAGE_API_TOKEN'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Run flyctl deploy --remote-only --config ./fly.stage.toml'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run flyctl deploy --remote-only --config ./fly.stage.toml
##[debug]Loading inputs
##[debug]Loading env
Run flyctl deploy --remote-only --config ./fly.stage.toml
##[debug]/usr/bin/bash -e /home/runner/work/_temp/91606c24-8aee-4e91-b472-42d64f2a3ce9.sh
==> Verifying app config
Error Not authorized to access this firecrackerapp
Validating ./fly.stage.toml


Error: Process completed with exit code 1.
##[debug]Finishing: Run flyctl deploy --remote-only --config ./fly.stage.toml

Here’s the Github Action config:

name: fly-deployment
run-name: ${{ github.actor }} is deploying to prod and stage

on:
  push:
    branches:
      - main
jobs:
  deploy-prod:
    name: Deploy to production
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: flyctl deploy --remote-only --config ./fly.prod.toml
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_PROD_API_TOKEN }}
  deploy-stage:
    name: Deploy to staging
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: superfly/flyctl-actions/setup-flyctl@master
      - run: flyctl deploy --remote-only --config ./fly.stage.toml
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_STAGE_API_TOKEN }}

Has anyone hit this before? I’ve been searching for the past hour and haven’t been able to find anything on this forum or elsewhere. The change that I made to my toml files was to remove the build section so I could transition from using a buildpack to a Dockerfile - curious if that may have something to do with this?

Hmm that doesn’t sound related!

How did you generate the token you’re using on GitHub Actions?

I used flyctl tokens create deploy --config ./fly.stage.toml and flyctl tokens create deploy --config ./fly.prod.toml (followed instructions from here: Continuous Deployment with Fly.io and GitHub Actions · Fly Docs)

Hmm if you ran that it’s probably using our default 1h expiry at the moment. Could you regenerate those and use a long expiration; something like -x 999999h so that token lasts longer.

Let us know if regenerating those and rerunning gets you fixed up.

We’ll update the docs and re-evaluate the default experience there.

It worked! Thanks!

2 Likes

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