BROKEN: Account permissions... or smth

I want to scale my Postgres across regions:

flyctl machine clone ID --region ABC --app MYAPP

However the process always fails, no matter which destination location is selected.

Provisioning a new machine with image flyio/postgres:14.4...
Error failed to launch VM: You are not allowed to create machines

Some permissions seem not be to be setup correctly for my account?!

Exec flyctl commands with LOG_LEVEL=debug to see what it prints?

Barring any problem with the Fly control plane, I’m guessing a flyctl auth (docs) should fix what you’re seeing…

Hy,
thanks for replaying.

flyctl machine clone shows:

DEBUG Loaded flyctl config from/home/bernd/.fly/config.yml
DEBUG determined hostname: "thinkpad"
DEBUG determined working directory: "/home/bernd/Development/flyio-powerdns-pg"
DEBUG determined user home directory: "/home/bernd"
DEBUG determined config directory: "/home/bernd/.fly"
DEBUG ensured config directory exists.
DEBUG ensured config directory perms.
DEBUG cache loaded.
DEBUG config initialized.
DEBUG initialized task manager.
DEBUG skipped querying for new release
DEBUG client initialized.
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "query ($appName: String!) { appbasic:app(name: $appName) { id name platformVersion organization { id slug } } }",
  "variables": {
    "appName": "APPNAME"
  }
}

DEBUG {}
DEBUG <-- 200 https://api.fly.io/graphql (375.25ms)

{
  "data": {
    "appbasic": {
      "id": "APPNAME",
      "name": "APPNAME",
      "platformVersion": "nomad",
      "organization": {
        "id": "UNIQID",
        "slug": "personal"
      }
    }
  }
}
DEBUG app config loaded from /home/bernd/Development/flyio-powerdns-pg/fly.toml
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "query ($appName: String!) { appcompact:app(name: $appName) { id name hostname deployed status appUrl platformVersion organization { id slug } postgresAppRole: role { name } imageDetails { repository version } } }",
  "variables": {
    "appName": "APPNAME-db"
  }
}

DEBUG {}
DEBUG <-- 200 https://api.fly.io/graphql (178.1ms)

{
  "data": {
    "appcompact": {
      "id": "APPNAME-db",
      "name": "APPNAME-db",
      "hostname": "APPNAME-db.fly.dev",
      "deployed": true,
      "status": "deployed",
      "appUrl": null,
      "platformVersion": "machines",
      "organization": {
        "id": "UNIQID",
        "slug": "personal"
      },
      "postgresAppRole": {
        "name": "postgres_cluster"
      },
      "imageDetails": {
        "repository": "unknown",
        "version": "unknown"
      }
    }
  }
}
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "mutation($input: ValidateWireGuardPeersInput!) { validateWireGuardPeers(input: $input) { invalidPeerIps } }",
  "variables": {
    "input": {
      "peerIps": [
        "IPV6"
      ]
    }
  }
}

DEBUG {}
DEBUG <-- 200 https://api.fly.io/graphql (367.77ms)

{
  "data": {
    "validateWireGuardPeers": {
      "invalidPeerIps": []
    }
  }
}
DEBUG --> GET http://[fdaa:1:160b::3]:4280/v1/apps/APPNAME-db/machines/ID

DEBUG <-- 200 http://[fdaa:1:160b::3]:4280/v1/apps/APPNAME-db/machines/ID (306.3ms)

{
  "id": "ID",
  "name": "wandering-tree-2481",
  "state": "started",
  "region": "fra",
  "instance_id": "INSTANCEID",
  "private_ip": "IPV6",
  "config": {
    "env": {
      "PRIMARY_REGION": "fra"
    },
    "init": {
      "exec": null,
      "entrypoint": null,
      "cmd": null,
      "tty": false
    },
    "image": "flyio/postgres:14.4",
    "metadata": {
      "fly-managed-postgres": "true",
      "managed-by-fly-deploy": "true"
    },
    "mounts": [
      {
        "encrypted": true,
        "path": "/data",
        "size_gb": 10,
        "volume": "VOLID"
      }
    ],
    "restart": {
      "policy": "always"
    },
    "guest": {
      "cpu_kind": "shared",
      "cpus": 1,
      "memory_mb": 256
    },
    "metrics": {
      "port": 9187,
      "path": "/metrics"
    },
    "checks": {
      "pg": {
        "type": "http",
        "port": 5500,
        "interval": "15s",
        "timeout": "10s",
        "method": "",
        "path": "/flycheck/pg"
      },
      "role": {
        "type": "http",
        "port": 5500,
        "interval": "15s",
        "timeout": "10s",
        "method": "",
        "path": "/flycheck/role"
      },
      "vm": {
        "type": "http",
        "port": 5500,
        "interval": "1m0s",
        "timeout": "10s",
        "method": "",
        "path": "/flycheck/vm"
      }
    }
  },
  "image_ref": {
    "registry": "registry-1.docker.io",
    "repository": "flyio/postgres",
    "tag": "14.4",
    "digest": "sha256:IMAGEID",
    "labels": {
      "fly.app_role": "postgres_cluster",
      "fly.pg-version": "14.4-1.pgdg110+1",
      "fly.version": "v0.0.33"
    }
  },
  "created_at": "2022-12-31T09:24:44Z",
  "updated_at": "2022-12-31T09:25:00Z",
  "events": [
    {
      "id": "01GNKQZD0WND3GPCFCZTFGR553",
      "type": "start",
      "status": "started",
      "source": "flyd",
      "timestamp": 1672478700572
    },
    {
      "id": "01GNKQYX571HFD99CACG28Z6F2",
      "type": "launch",
      "status": "created",
      "source": "user",
      "timestamp": 1672478684327
    }
  ],
  "checks": [
    {
      "name": "pg",
      "status": "passing",
      "output": "[✓] transactions: readonly (624.69µs)\n[✓] replication: syncing from fdaa:1:160b:a7b:caca:b21:fa71:2 (168.22µs)\n[✓] connections: 6 used, 3 reserved, 300 max (5.45ms)",
      "updated_at": "2023-01-01T06:20:23Z"
    },
    {
      "name": "vm",
      "status": "passing",
      "output": "[✓] checkDisk: 9.17 GB (93.8%) free space on /data/ (476.55µs)\n[✓] checkLoad: load averages: 0.01 0.02 0.08 (136.93µs)\n[✓] memory: system spent 18ms of the last 60s waiting on memory (37.62µs)\n[✓] cpu: system spent 450ms of the last 60s waiting on cpu (27.76µs)\n[✓] io: system spent 432ms of the last 60s waiting on io (15.63µs)",
      "updated_at": "2022-12-31T09:25:22Z"
    },
    {
      "name": "role",
      "status": "passing",
      "output": "replica",
      "updated_at": "2023-01-01T06:20:14Z"
    }
  ]
}
Cloning machine ID into region mia
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "mutation($input: CreateVolumeInput!) { createVolume(input: $input) { app { name } volume { id name app{ name } region sizeGb encrypted createdAt host { id } } } }",
  "variables": {
    "input": {
      "appId": "APPNAME-db",
      "name": "pg_data",
      "region": "mia",
      "sizeGb": 10,
      "encrypted": true,
      "requireUniqueZone": false
    }
  }
}

DEBUG {}
DEBUG <-- 200 https://api.fly.io/graphql (1.83s)

{
  "data": {
    "createVolume": {
      "volume": {
        "id": "vol_w1q85vg9om8rzdxe",
        "name": "pg_data",
        "region": "mia",
        "sizeGb": 10,
        "encrypted": true,
        "createdAt": "2023-01-01T13:45:58Z",
        "host": {
          "id": "63c9"
        },
        "app": {
          "name": "APPNAME-db"
        }
      },
      "app": {
        "name": "APPNAME-db"
      }
    }
  }
}
Provisioning a new machine with image flyio/postgres:14.4...
DEBUG --> POST http://[fdaa:1:160b::3]:4280/v1/apps/APPNAME-db/machines

{
  "appId": "APPNAME-db",
  "region": "mia",
  "config": {
    "env": {
      "PRIMARY_REGION": "fra"
    },
    "init": {
      "exec": null,
      "entrypoint": null,
      "cmd": null,
      "tty": false
    },
    "image": "flyio/postgres:14.4",
    "metadata": {
      "fly-managed-postgres": "true",
      "managed-by-fly-deploy": "true"
    },
    "mounts": [
      {
        "encrypted": true,
        "path": "/data",
        "size_gb": 10,
        "volume": "vol_w1q85vg9om8rzdxe"
      }
    ],
    "restart": {
      "policy": "always"
    },
    "guest": {
      "cpu_kind": "shared",
      "cpus": 1,
      "memory_mb": 256
    },
    "metrics": {
      "port": 9187,
      "path": "/metrics"
    },
    "network": {
      "id": 0
    },
    "checks": {
      "pg": {
        "type": "http",
        "port": 5500,
        "interval": "15s",
        "timeout": "10s",
        "method": "",
        "path": "/flycheck/pg"
      },
      "role": {
        "type": "http",
        "port": 5500,
        "interval": "15s",
        "timeout": "10s",
        "method": "",
        "path": "/flycheck/role"
      },
      "vm": {
        "type": "http",
        "port": 5500,
        "interval": "1m0s",
        "timeout": "10s",
        "method": "",
        "path": "/flycheck/vm"
      }
    }
  },
  "SkipHealthChecks": false
}
DEBUG {0xc000e48c30}
DEBUG <-- 422 http://[IPV6]:4280/v1/apps/APPNAME-db/machines (406ms)

{
  "error": "You are not allowed to create machines"
}

Error failed to launch VM: You are not allowed to create machines

flyctl auth show displays the correct account-email.

1 Like

Nothing looks suspicious to my untrained eye.


Not sure but could it be that your account is flagged by Fly?

Support fixed it - Unlocked Account

1 Like