[Fixed] Unable to allocate IP address

I’ve got a new application up, with no deployments. I am trying to get a Mastodon instance running. At the moment it is ‘deployed’ but non-functional as there is no IP addr to connect and debug. I was in the final stages of getting it running w/ a certificate, but cannot assign the IP.

Region: IAD, app name: fedisurf

For reference, I have been using this as a guide/inspiration for my setup: GitHub - tmm1/flyapp-mastodon: mastodon on fly.io

Here are the current apps involved, but fedisurf is the one I am trying to allocate an IP.

NAME                        	OWNER   	STATUS   	PLATFORM	LATEST DEPLOY
fedisurf                    	personal	running  	nomad   	2h3m ago
fedisurf-db                 	personal	deployed 	machines
fedisurf-redis              	personal	pending

After running the flyctl ips allocate-v4 command w/ debug logging, this is the output:

LOG_LEVEL=debug flyctl ips allocate-v4 | pbcopy
DEBUG determined hostname: "airlock.ws.internal"
DEBUG determined working directory: "/Users/michael/Code/whalesalad/fedisurf"
DEBUG determined user home directory: "/Users/michael"
DEBUG determined config directory: "/Users/michael/.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": "fedisurf"
  }
}

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

{
  "data": {
    "appbasic": {
      "id": "fedisurf",
      "name": "fedisurf",
      "platformVersion": "nomad",
      "organization": {
        "id": "ZRJPoxp8kwJ0ZuK1KxyBZAnyBoC700",
        "slug": "personal"
      }
    }
  }
}
DEBUG app config loaded from /Users/michael/Code/whalesalad/fedisurf/fly.toml
Oops, something went wrong! Could you try that again?

Emphasis on the last line:

Oops, something went wrong! Could you try that again?

I’ve tried this a dozen times, with different flags to try and specify the region, app, etc. Nothing seems to work at all. Everything gives the same response, and there is no actual debug information regarding what specifically went wrong.

Here is my fly.toml if it helps:

# fly.toml file generated for fedisurf on 2022-12-13T12:34:57-05:00

app = "fedisurf"
kill_signal = "SIGINT"
kill_timeout = 5

[env]
  PRIMARY_REGION = "iad"
  LOCAL_DOMAIN = "fedi.surf"
  WEB_DOMAIN = "fedi.surf"

  RAILS_ENV = "production"
  RAILS_LOG_TO_STDOUT = "enabled"
  WEB_CONCURRENCY = "1"

  REDIS_HOST = "fedisurf-redis.internal"
  REDIS_PORT = "6379"

[processes]
  rails = "bundle exec rails s -p 8080"
  sidekiq = "bundle exec sidekiq"

[[mounts]]
  source = "mastodon_uploads"
  destination = "/opt/mastodon/public/system"

[[statics]]
  guest_path = "/opt/mastodon/public"
  url_prefix = "/"

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

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

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

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

  [[services.http_checks]]
    path = "/health"
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

Some additional info … I don’t actually want or need an ipv6 address but when trying to do that I get a slightly different error which might help debug this:

LOG_LEVEL=debug flyctl ips allocate-v6
DEBUG Loaded flyctl config from/Users/michael/.fly/config.yml
DEBUG determined hostname: "airlock.ws.internal"
DEBUG determined working directory: "/Users/michael/Code/whalesalad/fedisurf"
DEBUG determined user home directory: "/Users/michael"
DEBUG determined config directory: "/Users/michael/.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": "fedisurf"
  }
}

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

{
  "data": {
    "appbasic": {
      "id": "fedisurf",
      "name": "fedisurf",
      "platformVersion": "nomad",
      "organization": {
        "id": "ZRJPoxp8kwJ0ZuK1KxyBZAnyBoC700",
        "slug": "personal"
      }
    }
  }
}
DEBUG app config loaded from /Users/michael/Code/whalesalad/fedisurf/fly.toml
DEBUG --> POST https://api.fly.io/graphql

{
  "query": "mutation($input: AllocateIPAddressInput!) { allocateIpAddress(input: $input) { ipAddress { id address type region createdAt } } }",
  "variables": {
    "input": {
      "appId": "fedisurf",
      "type": "v6",
      "region": "",
      "organizationId": ""
    }
  }
}

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

{
  "data": {
    "allocateIpAddress": null
  },
  "errors": [
    {
      "message": "Could not find Node with id ''",
      "locations": [
        {
          "line": 1,
          "column": 45
        }
      ],
      "path": [
        "allocateIpAddress"
      ],
      "extensions": {
        "code": "NOT_FOUND"
      }
    }
  ]
}
Error Could not find Node with id ''

Ok, that’s a bug introduced in the latest flyctl release. Can you try with --org your-app-org while we fix it?

I’m not sure it’s the same bug for ipv4 and ipv6 though.

Edit: IPv4 won’t work at all actually, until we publish a fix. Hold tight!

2 Likes

ran into this today, too - thank you for fixing it!

This should be fixed as of version 0.0.439

1 Like

:partying_face::raised_hands::tada:

VERSION	IP             	TYPE  	REGION	CREATED AT
v4     	xxx.xxx.xxx.xxx	public	global	6s ago
1 Like