deploy from github action workflow using docker-hub

Hello All,

on CICD Github Action Workflow using docker-hub,
after pulling the image from docker-hub,
although it seems like its pass the auth check, its also saying: “Error: Not authorized to deploy this app.”

i have already deployed the website using cli (so i got the global fly token and toml file)

this is my code so far… i am stuck.

name: CD-2 Production Deploy

on:
  push:
    branches: [main, CICD]

jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      DOCKER_HUB_USER: "xoxo10"
      FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
      DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
      DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
      FLY_ORG: "personal"  # Use ORG SLUG from 'flyctl orgs list'

    steps:
      - uses: actions/checkout@v4

      - name: Install flyctl
        run: |
          curl -L https://fly.io/install.sh | sh
          export FLYCTL_INSTALL="$HOME/.fly"
          export PATH="$FLYCTL_INSTALL/bin:$PATH"
          echo "$FLYCTL_INSTALL/bin" >> $GITHUB_PATH
          flyctl version

      - name: Configure Fly.io access
        run: |
          mkdir -p "$HOME/.fly"
          echo "access_token: $FLY_API_TOKEN" > "$HOME/.fly/config.yml"
          echo "organization: $FLY_ORG" >> "$HOME/.fly/config.yml"
          
          # Verify exact org permissions
          flyctl orgs list
          flyctl orgs show $FLY_ORG

      - name: Ensure Fly Apps Exist
        run: |
          for app in x-realestate-server x-realestate-client x-realestate; do
            if ! flyctl apps list | grep -qw "$app"; then
              flyctl apps create "$app" --org $FLY_ORG --json --verbose
              echo "Created $app"
              sleep 10  # Increased propagation time
            else
              echo "Verifying access to $app"
              flyctl apps info --app "$app" --json
            fi
          done      

      
      - name: Login to Docker Hub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      
      - name: Login to Fly Registry
        run: |
          echo "$FLY_API_TOKEN" | docker login -u x --password-stdin registry.fly.io

      
      - name: Pull and Prepare Images
        run: |
          docker pull $DOCKER_HUB_USER/container-server:latest
          docker pull $DOCKER_HUB_USER/container-client:latest
          docker pull $DOCKER_HUB_USER/container-nginx:1.0.0

          docker tag $DOCKER_HUB_USER/container-server:latest registry.fly.io/x-realestate-server:latest
          docker tag $DOCKER_HUB_USER/container-client:latest registry.fly.io/x-realestate-client:latest
          docker tag $DOCKER_HUB_USER/container-nginx:1.0.0 registry.fly.io/x-realestate:latest

          docker images | grep 'fly.io'

      - name: Push to Fly Registry
        run: |
          docker push registry.fly.io/x-realestate-server:latest
          docker push registry.fly.io/x-realestate-client:latest
          docker push registry.fly.io/x-realestate:latest

      - name: Deploy All Services
        run: |
          flyctl deploy --app x-realestate-server --image registry.fly.io/x-realestate-server:latest
          flyctl deploy --app x-realestate-client --image registry.fly.io/x-realestate-client:latest
          flyctl deploy --app x-realestate --image registry.fly.io/x-realestate:latest

      - name: Verify Deployments
        run: |
          flyctl status --app x-realestate-server
          flyctl status --app x-realestate-client
          flyctl status --app x-realestate
          flyctl logs --app x-realestate --tail 10

thank you all.

Hi @yaniv :waving_hand:

Usually, this means the token you’re using is not scoped correctly. For example, does the token and the app being deployed belong to the same organization? When you create the token, make sure to first switch to the intended organization on the sidebar (from web UI), or specify the correct --org argument if created through cli. Alternatively, you may create a deploy token that’s only valid for the app you intend to deploy. Our documentation contains more details on access token scoping and their management.

Hi PeterCxy, and thank you for quick response.

with the below info can we say,

  • the token is belong to the app org.
  • this is a global token (for all apps).
  • the use has be log in.

running this code:

      - name: Login to Fly Registry
        run: |
          echo "$FLY_API_TOKEN" | docker login -u x --password-stdin registry.fly.io

printed:

Run docker/login-action@v2
Logging into Docker Hub...
Login Succeeded!

running this code:

      - name: Configure Fly.io access
        run: |
          mkdir -p "$HOME/.fly"
          echo "access_token: $FLY_API_TOKEN" > "$HOME/.fly/config.yml"
          echo "organization: $FLY_ORG" >> "$HOME/.fly/config.yml"
          
          # Verify exact org permissions
          flyctl orgs list
          flyctl orgs show $FLY_ORG
          fly orgs show personal          
          echo "checking flyctl auth token"          
          # fly auth token
          # flyctl auth token --org $FLY_ORG --json
          # flyctl auth token --org personal --json
          echo "checking flyctl auth whoami"
          flyctl auth whoami --json
          echo "checking if the Token in on the same org"
          fly apps list --json
          flyctl auth whoami -t ${{ secrets.FLY_API_TOKEN }} --json

print:

Run mkdir -p "$HOME/.fly"
Name                 Slug                 Type      
----                 ----                 ----      
Y L                  personal             PERSONAL  
Organization
Name      : Y L                 
Slug      : personal            
Type      : PERSONAL            

Summary
You have token permissions on this organizaton
There are 1 members associated with this organization

Organization Members
+------+---------------------------+-------+
| NAME |           EMAIL           | ROLE  |
+------+---------------------------+-------+
| Y L  | mayMail@gmail.com | ADMIN |
+------+---------------------------+-------+
Organization
Name      : Y L                 
Slug      : personal            
Type      : PERSONAL            

Summary
You have token permissions on this organizaton
There are 1 members associated with this organization

Organization Members
+------+---------------------------+-------+
| NAME |           EMAIL           | ROLE  |
+------+---------------------------+-------+
| Y L  | mayMail@gmail.com | ADMIN |
+------+---------------------------+-------+
checking flyctl auth token
checking flyctl auth whoami
{
    "email": "1acafad7-b346-55c0-9944-56b212cbad05@tokens.fly.io"
}
checking if the Token in on the same org
[
    {
        "ID": "fly-builder-long-dust-1817",
        "InternalNumericID": 0,
        "Name": "fly-builder-long-dust-1817",
        "State": "",
        "Status": "suspended",
        "Deployed": true,
        "Hostname": "fly-builder-long-dust-1817.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": null,
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    }
]
Error: failed retrieving current user: You must be authenticated to view this.
Error: Process completed with exit code 1.

i can also confirm the Token is on Sign in to Your Account · Fly
so can we say its a global scope?

i can confirm the associated org to the used token is correct.

Although it’s confirmed I already logged in I got this prompt:

Error: failed retrieving current user: You must be authenticated to view this.

The token will show up in the fly.io/tokens page even if it is an app-scoped deploy token. In fact, given that the command

fly apps list --json

only seems to list 1 app, it looks like your token is indeed an app-scoped one instead of an org-scoped one, unless that builder app is the only app you have under your account.

so i have set org token

fly tokens create org --name FLY_ORG_TOKEN

set to gh and validate the token is there with

gh secret list

validated with fly and compared the value to the source

fly auth token

yet when i run the cd and got:

Warning: Metrics token unavailable: context canceled
Error: failed retrieving current user: You must be authenticated to view this.
Error: Process completed with exit code 1.

Run mkdir -p "$HOME/.fly"
Name                 Slug                 Type      
----                 ----                 ----      
Y L                  personal             PERSONAL  
Warning: Metrics token unavailable: context canceled
Warning: Metrics token unavailable: context canceled
Organization
Name      : Y L                 
Slug      : personal            
Type      : PERSONAL            

Summary
You have token permissions on this organizaton
There are 1 members associated with this organization

Organization Members
+------+---------------------------+-------+
| NAME |           EMAIL           | ROLE  |
+------+---------------------------+-------+
| Y L  | main@gmail.com | ADMIN |
+------+---------------------------+-------+
Organization
Name      : Y L                 
Warning: Metrics token unavailable: context canceled
Slug      : personal            
Type      : PERSONAL            

Summary
You have token permissions on this organizaton
There are 1 members associated with this organization

Organization Members
+------+---------------------------+-------+
| NAME |           EMAIL           | ROLE  |
+------+---------------------------+-------+
| Y L  | my-mail@gmail.com | ADMIN |
+------+---------------------------+-------+
checking flyctl auth token
The 'fly auth token' command is deprecated. Use 'fly tokens create' instead.
fm2_lJPECAAAAAAAB8VQxBAcNEpYKso3nrEDWz88hOCYwrVodHRwczovL2FwaS5mbHkuaW8vdjGUAJLOAAyTDh8Lk7lodHRwczovL2FwaS5mbHkuaW8vYWFhL3YxxDwesw1ejp3hvC3T30kMW8L/KQggniU8ig/rskcuSwn/bwnKl6J+VtkFqyNqRTv5jidMW0=,fm2_lJPETjjapqfb6BLjcAhNn3MSpi/IDIExl1c5rTruUzbZq4l529aQQluE9j/q/K8X3SVtIpcag7JmBTIlMtp6WZLVCBgILd7thqkxjWhAUrDFa8QQyXodvHsZ6D9kw1iUmqnk2sO5aHR0cHM6Ly9hcGkuZmx5LmlvL2FhYS92MZgEks5oE7SHzo2ruqUXzgAMMtUKkc4ADDLVDMQQFjIZLU/+k/Zm/m1e8/9ULcQgp8F75kPjjBPdlXhIiqCfiZ0V3aJ+YrwotgPZZJnQzqo=
checking flyctl auth whoami
{
Warning: Metrics token unavailable: context canceled
    "email": "9c9567b9-91d5-53b5-9a9b-e0a60b0187d3@tokens.fly.io"
}
checking if the Token in on the same org
[
    {
        "ID": "fly-builder-long-dust-1817",
        "InternalNumericID": 0,
        "Name": "fly-builder-long-dust-1817",
        "State": "",
        "Status": "suspended",
        "Deployed": true,
        "Hostname": "fly-builder-long-dust-1817.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": null,
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    },
    {
        "ID": "x-realestate",
        "InternalNumericID": 0,
        "Name": "x-realestate",
        "State": "",
        "Status": "deployed",
        "Deployed": true,
        "Hostname": "x-realestate.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": {
            "ID": "",
            "Version": 0,
            "Stable": false,
            "InProgress": false,
            "Reason": "",
            "Description": "",
            "Status": "complete",
            "DeploymentStrategy": "",
            "Metadata": null,
            "User": {
                "ID": "",
                "Name": "",
                "Email": "",
                "EnablePaidHobby": false
            },
            "EvaluationID": "",
            "CreatedAt": "2025-04-13T15:29:22Z",
            "ImageRef": ""
        },
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    },
    {
        "ID": "x-realestate-client",
        "InternalNumericID": 0,
        "Name": "x-realestate-client",
        "State": "",
        "Status": "deployed",
        "Deployed": true,
        "Hostname": "x-realestate-client.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": {
            "ID": "",
            "Version": 0,
            "Stable": false,
            "InProgress": false,
            "Reason": "",
            "Description": "",
            "Status": "complete",
            "DeploymentStrategy": "",
            "Metadata": null,
            "User": {
                "ID": "",
                "Name": "",
                "Email": "",
                "EnablePaidHobby": false
            },
            "EvaluationID": "",
            "CreatedAt": "2025-04-27T18:35:32Z",
            "ImageRef": ""
        },
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    },
    {
        "ID": "x-realestate-server",
        "InternalNumericID": 0,
        "Name": "x-realestate-server",
        "State": "",
        "Status": "deployed",
        "Deployed": true,
        "Hostname": "x-realestate-server.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": {
            "ID": "",
            "Version": 0,
            "Stable": false,
            "InProgress": false,
            "Reason": "",
            "Description": "",
            "Status": "complete",
            "DeploymentStrategy": "",
            "Metadata": null,
            "User": {
                "ID": "",
                "Name": "",
                "Email": "",
                "EnablePaidHobby": false
            },
            "EvaluationID": "",
            "CreatedAt": "2025-04-18T18:01:04Z",
            "ImageRef": ""
        },
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    }
]
Warning: Metrics token unavailable: context canceled
Warning: Metrics token unavailable: context canceled
Error: failed retrieving current user: You must be authenticated to view this.
Error: Process completed with exit code 1.

Warning: Metrics token unavailable: context canceled
Error: failed retrieving current user: You must be authenticated to view this.
Error: Process completed with exit code 1.

I think this error came from the line

… and I’m not sure you can template secrets into commands like this on GitHub. Since you have already exported the token via env variables to config.yml, you shouldn’t need the -t parameter here?

i have comment

# flyctl auth whoami -t ${{ secrets.FLY_ORG_TOKEN }} --json

and run the code:

- name: Configure Fly.io access
        run: |
          mkdir -p "$HOME/.fly"
          echo "access_token: $FLY_ORG_TOKEN" > "$HOME/.fly/config.yml"
          echo "organization: $FLY_ORG" >> "$HOME/.fly/config.yml"
          
          # Verify exact org permissions
          flyctl orgs list
          flyctl orgs show $FLY_ORG
          fly orgs show personal          
          echo "checking flyctl auth token"          
          fly auth token
          # flyctl auth token --org $FLY_ORG --json
          # flyctl auth token --org personal --json
          echo "checking flyctl auth whoami"
          flyctl auth whoami --json
          echo "checking if the Token in on the same org"
          fly apps list --json
          # flyctl auth whoami -t ${{ secrets.FLY_ORG_TOKEN }} --json
         

and got: Warning: Metrics token unavailable: context canceled

Run mkdir -p "$HOME/.fly"
Name                 Slug                 Type      
Warning: Metrics token unavailable: context canceled
----                 ----                 ----      
Y L                  personal             PERSONAL  
Warning: Metrics token unavailable: context canceled
Organization
Name      : Y L                 
Slug      : personal            
Type      : PERSONAL            

Summary
You have token permissions on this organizaton
There are 1 members associated with this organization

Organization Members
+------+---------------------------+-------+
| NAME |           EMAIL           | ROLE  |
+------+---------------------------+-------+
| Y L  | email@gmail.com | ADMIN |
+------+---------------------------+-------+
Warning: Metrics token unavailable: context canceled
Organization
Name      : Y L                 
Slug      : personal            
Type      : PERSONAL            

Summary
You have token permissions on this organizaton
There are 1 members associated with this organization

Organization Members
+------+---------------------------+-------+
| NAME |           EMAIL           | ROLE  |
+------+---------------------------+-------+
| Y L  | email@gmail.com | ADMIN |
+------+---------------------------+-------+
checking flyctl auth token
The 'fly auth token' command is deprecated. Use 'fly tokens create' instead.
fm2_lJPECAAAAAAAB8VQxBAcNE+k/Zm/m1e8/9ULcQgp8F75kPjjBPdlXhIiqCfiZ0V3aJ+YrwotgPZZJnQzqo=
checking flyctl auth whoami
{
Warning: Metrics token unavailable: context canceled
    "email": "9c9567b9-91d5-53b5-9a9b-e0a60b0187d3@tokens.fly.io"
}
checking if the Token in on the same org
[
    {
        "ID": "fly-builder-long-dust-1817",
        "InternalNumericID": 0,
        "Name": "fly-builder-long-dust-1817",
        "State": "",
        "Status": "suspended",
        "Deployed": true,
        "Hostname": "fly-builder-long-dust-1817.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": null,
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    },
    {
        "ID": "x-realestate",
        "InternalNumericID": 0,
        "Name": "x-realestate",
        "State": "",
        "Status": "deployed",
        "Deployed": true,
        "Hostname": "x-realestate.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": {
            "ID": "",
            "Version": 0,
            "Stable": false,
            "InProgress": false,
            "Reason": "",
            "Description": "",
            "Status": "complete",
            "DeploymentStrategy": "",
            "Metadata": null,
            "User": {
                "ID": "",
                "Name": "",
                "Email": "",
                "EnablePaidHobby": false
            },
            "EvaluationID": "",
            "CreatedAt": "2025-04-13T15:29:22Z",
            "ImageRef": ""
        },
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    },
    {
        "ID": "x-realestate-client",
        "InternalNumericID": 0,
        "Name": "x-realestate-client",
        "State": "",
        "Status": "deployed",
        "Deployed": true,
        "Hostname": "x-realestate-client.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": {
            "ID": "",
            "Version": 0,
            "Stable": false,
            "InProgress": false,
            "Reason": "",
            "Description": "",
            "Status": "complete",
            "DeploymentStrategy": "",
            "Metadata": null,
            "User": {
                "ID": "",
                "Name": "",
                "Email": "",
                "EnablePaidHobby": false
            },
            "EvaluationID": "",
            "CreatedAt": "2025-04-27T18:35:32Z",
            "ImageRef": ""
        },
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
Warning: Metrics token unavailable: context canceled
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    },
    {
        "ID": "x-realestate-server",
        "InternalNumericID": 0,
        "Name": "x-realestate-server",
        "State": "",
        "Status": "deployed",
        "Deployed": true,
        "Hostname": "x-realestate-server.fly.dev",
        "AppURL": "",
        "Version": 0,
        "NetworkID": 0,
        "Network": "",
        "Release": null,
        "Organization": {
            "ID": "",
            "InternalNumericID": "",
            "Name": "Y L",
            "RemoteBuilderImage": "",
            "RemoteBuilderApp": null,
            "Slug": "personal",
            "RawSlug": "",
            "Type": "",
            "PaidPlan": false,
            "Billable": false,
            "Settings": null,
            "Domains": {
                "Nodes": null,
                "Edges": null
            },
            "WireGuardPeer": null,
            "WireGuardPeers": {
                "Nodes": null,
                "Edges": null
            },
            "DelegatedWireGuardTokens": {
                "Nodes": null,
                "Edges": null
            },
            "LoggedCertificates": null,
            "LimitedAccessTokens": null
        },
        "Secrets": null,
        "CurrentRelease": {
            "ID": "",
            "Version": 0,
            "Stable": false,
            "InProgress": false,
            "Reason": "",
            "Description": "",
            "Status": "complete",
            "DeploymentStrategy": "",
            "Metadata": null,
            "User": {
                "ID": "",
                "Name": "",
                "Email": "",
                "EnablePaidHobby": false
            },
            "EvaluationID": "",
            "CreatedAt": "2025-04-18T18:01:04Z",
            "ImageRef": ""
        },
        "Releases": {
            "Nodes": null
        },
        "IPAddresses": {
            "Nodes": null
        },
        "SharedIPAddress": "",
        "IPAddress": null,
        "Certificates": {
            "Nodes": null
        },
        "Certificate": {
            "ID": "",
            "AcmeDNSConfigured": false,
            "AcmeALPNConfigured": false,
            "Configured": false,
            "CertificateAuthority": "",
            "CreatedAt": "0001-01-01T00:00:00Z",
            "DNSProvider": "",
            "DNSValidationInstructions": "",
            "DNSValidationHostname": "",
            "DNSValidationTarget": "",
            "Hostname": "",
            "Source": "",
            "ClientStatus": "",
            "IsApex": false,
            "IsWildcard": false,
            "Issued": {
                "Nodes": null
            }
        },
        "PostgresAppRole": null,
        "Image": null,
        "ImageUpgradeAvailable": false,
        "ImageVersionTrackingEnabled": false,
        "ImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "LatestImageDetails": {
            "Registry": "",
            "Repository": "",
            "Tag": "",
            "Version": "",
            "Digest": ""
        },
        "PlatformVersion": "machines",
        "LimitedAccessTokens": null,
        "Machines": {
            "Nodes": null
        },
        "CurrentLock": null
    }
]

That should not prevent you from running the deploy. Can you try whether deploy works using the new token?

ooow… there is a progress… now its stuck for 4 minutes already on

No machines in group server, launching a new machine

full:

Run flyctl deploy --app x-realestate-server --image registry.fly.io/x-realestate-server:latest
  flyctl deploy --app x-realestate-server --image registry.fly.io/x-realestate-server:latest
  flyctl deploy --app x-realestate-client --image registry.fly.io/x-realestate-client:latest
  flyctl deploy --app x-realestate --image registry.fly.io/x-realestate:latest
  shell: /usr/bin/bash -e {0}
  env:
    DOCKER_HUB_USER: xoxo10
    FLY_ORG_TOKEN: ***
    DOCKER_USERNAME: ***
    DOCKER_PASSWORD: ***
    FLY_ORG: personal
==> Verifying app config
Validating /home/runner/work/202403-real-estate-app/202403-real-estate-app/fly.toml
--> Verified app config
✓ Configuration is valid
==> Building image
Searching for image 'registry.fly.io/x-realestate-server:latest' remotely...
image found: img_3mno4wkyr0024k18
Watch your deployment at https://fly.io/apps/x-realestate-server/monitoring
Process groups have changed. This will:
 * destroy 1 "app" machine
 * create 2 "server" machines
 * create 2 "web" machines
machine e825162b143258 was found and is currently in started state, attempting to destroy...
> [1/2] Launching new machine
No machines in group server, launching a new machine