Docs for exposing PostgreSQL externally are broken, 5 bug reports

Hello! I’m a new Fly customer setting up a new Postgres database. The instructions to expose it externally seem broken.

Steps to repro:

  • fly pg create: Go through the steps, sample app ID my-app.
  • Machine creates successfully.

Then, Following these instructions,

  • Assign IPs:
    • fly ips allocate-v4 --shared --app my-app
    • fly ips allocate-v6 --app my-app
  • Configure external service: fly config save --app my-app
    • Doc bug 1: the instructions say to replace [[services]] with internal_port = 5432. This is already done.
  • Find current image: fly image show --app my-app
    Doc bug 2: the instructions have an old Image Details section. The default image is flyio/postgres-flex at tag 15.2, but it took some experimentation to get the command right.
  • Redeploy image: fly deploy . --app my-app --image flyio/postgres-flex:15.2

System bug 3: When redeploying, there’s an error:

➜  db_config git:(main) ✗ fly deploy . --app my-app --image flyio/postgres-flex:15.2
==> Verifying app config
Validating /<path removed>/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'flyio/postgres-flex:15.2' remotely...
image found: img_abc123
Process groups have changed. This will:
 * destroy 1 "" machine
 * create 1 "app" machine

machine abc1234 was found and is currently in started state, attempting to destroy...
unregistering postgres member 'fdaa:1:e779:a7b:128:854f:6a6d:2' from the cluster... (failed)
failed to unregister postgres member: no active leader found
(success)
No machines in group 'app', launching one new machine
Oops, something went wrong! Could you try that again?

System bug 4: When running the exact same command again, there’s a different error. This error repeats after multiple runs:

➜  db_config git:(main) ✗ fly deploy . --app my-app --image flyio/postgres-flex:15.2
==> Verifying app config
Validating /<path removed>/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'flyio/postgres-flex:15.2' remotely...
image found: img_abc123
Error error new machine requires an unattached volume named '' on mount destination '/data'

I took a stab at fixing this by adding [source] under [mounts]:

[mounts]
  source = "pg_data"
  destination = "/data"

System bug 5:
This starts to deploy… and then hangs indefinitely.

➜  db_config git:(main) ✗ fly deploy . --app my-app --image flyio/postgres-flex:15.2
==> Verifying app config
Validating /<path removed>/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'flyio/postgres-flex:15.2' remotely...
image found: img_abc123
Process groups have changed. This will:
 * create 1 "app" machine

No machines in group 'app', launching one new machine
  Waiting for abc123 [app] to become healthy: 1/3

This is a pretty bad first Fly experience. :confused: Any tips?

After talking to the support, plus the fix on your post,

Removing the second [[services]] block with the internal_port = 5433 and adding the source = “pg_data” to [mounts], was able to deploy and connect from a external source.

Just weird that pulling directly from their server using the config save command has issues.

1 Like

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