Builder Error - Validation failed: Pubkey has already been taken, Name has already been taken

I am experiencing this issue for the first time on multiple builds triggered from a Github Action with no other changes.

==> Verifying app config
--> Verified app config
==> Building image
Waiting for remote builder fly-builder-quiet-cherry-3988...
Error failed to fetch an image or build from source: error connecting to docker: failed building options: Validation failed: Pubkey has already been taken, Name has already been taken

I’ve deleted and re-created a builder and the error remains.

Huh, that’s a new error. Is your action.yml file something you can share, along with your fly.toml?

Same thing I said! I’ve seen it block this action (below) for over ten minutes before killing it or that error.

kill_timeout = 30
processes = []

[experimental]
  auto_rollback = true

[metrics]
  port = 9091
  path = "/metrics"

[env]

[deploy]
  strategy = "bluegreen"

[[statics]]
  guest_path = "/usr/local/enterprise/assets"
  url_prefix = "/assets"

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

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20

  [[services.ports]]
    handlers = ["http"]
    port = "80"

  [[services.ports]]
    handlers = ["tls", "http"]
    port = "443"

  [[services.http_checks]]
    interval = 10000
    grace_period = "5s"
    method = "get"
    path = "/ready"
    protocol = "http"
    timeout = 1000
    tls_skip_verify = false
    [services.http_checks.headers]

Action

name: preview-deploy
on:
  workflow_run:
    workflows:
      - package-docker-image
    types:
      - completed
    branches:
      - main

concurrency:
  group: preview-deploy-${{ github.ref }}-1
  cancel-in-progress: true

env:
  FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
  preview_deploy:
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    name: Deploy Preview UI
    strategy:
      matrix:
        go-version: [1.17.x]
        node-version: [14.18.x]
        platform: [ubuntu-latest]
    runs-on: ${{ matrix.platform }}
    steps:
      - uses: superfly/flyctl-actions@1.1
        with:
          args: "deploy --app enterprise-ui-preview --config fly.preview.toml --dockerfile ./Dockerfile.release --remote-only --build-arg buildNumber=${{github.run_id}} --build-arg gitRevision=${{github.sha}}"

My Web UI session is also frequently being dropped resulting in me having to sign back in and I see the Failed to reach out to API toast.

Can confirm I just tried another build moments ago and it is the same error.

 Waiting for remote builder fly-builder-quiet-cherry-3988...
Error failed to fetch an image or build from source: error connecting to docker: failed building options: Validation failed: Pubkey has already been taken, Name has already been taken

This error means the wireguard pubkey and name aren’t getting sent properly. But I don’t understand what would cause that, unless the Github environment changed somehow! We’re going to have to dig through code.

I’ve not changed this code in several months and it was last deployed two days ago successfully. I hope this helps.

Hi all,

We’re having the same issue on builds triggered from a Github Action. When I re-run the job it works. I think this happens since a day or two. We also haven’t touched the fly.toml or deploy.yaml file.

Our deploy.yaml is very simple:

name: Fly Deploy
on:
  push:
    branches:
      - master
env:
  FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
  deploy:
      name: Deploy app
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
        - uses: superfly/flyctl-actions@1.3
          with:
            args: "deploy"

Same issue here. Deploys failing and sometimes this is the message:

Github issue: fly deploy failing with "pubkey has already been taken" or "unhealthy allocations" · Issue #881 · superfly/flyctl · GitHub

Also seems related to another thread about unhealthy allocations: v1 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v2 - #3

We’ve been working on this, along with some API slowness.

Are you all still seeing these problems? I can’t get a GitHub action to fail. It’s possible this was related to slow API requests but I’m not sure how that would have correlated.

That error seems to have gone but app is still pending multiple versions that never finish deploying and the github action doesn’t complete.

App
  Name     = mg1
  Owner    = personal
  Version  = 68
  Status   = running
  Hostname = mg1.fly.dev

Deployment Status
  ID          = 09e4e7ef-4cf4-0726-6e06-a9d616f15ef4
  Version     = v68
  Status      = running
  Description = Deployment is running pending automatic promotion
  Instances   = 1 desired, 1 placed, 0 healthy, 0 unhealthy

Instances
ID              PROCESS VERSION REGION  DESIRED STATUS  HEALTH CHECKS   RESTARTS        CREATED
c4a191da        app     68 ⇡    dfw     run     pending                 0               1m0s ago
cc4387c9        app     67      dfw     stop    pending                 0               5m39s ago
19ffbcfb        app     66      dfw     stop    pending                 0               2h38m ago
26106eb7        app     64      mia(B)  run     running                 0               5h23m ago

Oh good catch, that was unrelated. Our orchestration was trying to schedule VMs to hardware we deprovisioned. Should be fixed now, if you’re still seeing “pending” it’ll clear up over time.

We just deployed something and now it worked immediately (without needing to re-run the job). Thanks, @kurt!

1 Like

I’m also confirming normal deployments. Thanks as always team.

1 Like

@kurt I am seeing this error crop up again in the last 2 hours on one of my applications ‘enterprise-ui’. Just wanted to alert you in case anything needs to be reviewed.

The issues appear to be intermittent, I am able to deploy.