Image Version is not compatible, but image is already running the latest image

I am having trouble connecting to my postgres app via flyctl postgres connect -a <app-name>

Upon running this, the CLI responds with “Error Image version is not compatible. (Current: 0.0.7, Required: >= 0.0.9)”

Okay, so I need to update the image, but updating the image with flyctl image update -a <app-name> yields: “Error image is already running the latest image”.

Is there an obvious step I’m missing to update the image or remedy this? Thanks!

Image Details:
  Registry   = registry-1.docker.io                                                     
  Repository = flyio/postgres-standalone                                                
  Tag        = 14.1                                                                     
  Version    = v0.0.7                                                                   

Hi @wernst,

This looks like a possible bug in flyctl, stopping postgres-standalone apps from using fly postgres connect!

Since Postgres on Fly is just a Fly app, I’d suggest trying to work around this using the slightly-more-tedious fly proxy, then psql route.

We do recommend always running our high-availability Postgres app (postgres-ha) instead of postgres-standalone. You can run this in a single (non-HA) instance (which we don’t recommend, but at least you can scale it to a HA cluster if you decide to).

If you want to copy your old database over to a new postgres-ha app, here are the steps:

Fetch the most recent snapshot from the standalone Postgres:
fly volumes snapshots list vol_xxx

Provision a new HA Postgres while specifying the --snapshot-id:
fly pg create --snapshot-id <standalone-pg-snapshot-id>

Update: We also have a fix for flyctl coming up.

Thank you for the response! We misplaced our DB credentials :sweat_smile: so I actually would like to copy over the DB to a new postgres app anyway.

While I have you here, upon setting up a new postgres app from the old snapshot I’m getting a critical error - seemingly auth related. See logs

Recent Events
TIMESTAMP            TYPE       MESSAGE                 
2022-07-22T23:06:12Z Received   Task received by client 
2022-07-22T23:06:38Z Task Setup Building Task Directory 
2022-07-22T23:07:05Z Started    Task started by client  

Recent Logs
2022-07-22T23:11:31.000 [info] flypg    | 2022-07-22 23:11:31.146 UTC [1139] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:31.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:31.000 [info] exporter | INFO[0265] Established new database connection to "fdaa:0:3eb9:a7b:9d34:1:50e5:2:5432".  source="postgres_exporter.go:970"
2022-07-22T23:11:31.000 [info] flypg    | 2022-07-22 23:11:31.545 UTC [1140] FATAL:  password authentication failed for user "flypgadmin"
2022-07-22T23:11:31.000 [info] flypg    | 2022-07-22 23:11:31.545 UTC [1140] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:32.000 [info] flypg    | 2022-07-22 23:11:32.147 UTC [1142] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:32.000 [info] flypg    | 2022-07-22 23:11:32.147 UTC [1142] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:32.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:32.000 [info] exporter | ERRO[0266] Error opening connection to database (postgresql://flypgadmin:PASSWORD_REMOVED@[fdaa:0:3eb9:a7b:9d34:1:50e5:2]:5432/postgres?sslmode=disable): pq: password authentication failed for user "flypgadmin"  source="postgres_exporter.go:1658"
2022-07-22T23:11:33.000 [info] flypg    | 2022-07-22 23:11:33.148 UTC [1144] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:33.000 [info] flypg    | 2022-07-22 23:11:33.148 UTC [1144] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:33.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:34.000 [info] flypg    | 2022-07-22 23:11:34.144 UTC [1146] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:34.000 [info] flypg    | 2022-07-22 23:11:34.144 UTC [1146] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:34.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:35.000 [info] flypg    | 2022-07-22 23:11:35.146 UTC [1148] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:35.000 [info] flypg    | 2022-07-22 23:11:35.146 UTC [1148] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:35.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:36.000 [info] flypg    | 2022-07-22 23:11:36.145 UTC [1150] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:36.000 [info] flypg    | 2022-07-22 23:11:36.145 UTC [1150] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:36.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:37.000 [info] flypg    | 2022-07-22 23:11:37.145 UTC [1152] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:37.000 [info] flypg    | 2022-07-22 23:11:37.145 UTC [1152] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:37.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:38.000 [info] flypg    | 2022-07-22 23:11:38.145 UTC [1154] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:38.000 [info] flypg    | 2022-07-22 23:11:38.145 UTC [1154] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:38.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
2022-07-22T23:11:39.000 [info] flypg    | 2022-07-22 23:11:39.144 UTC [1156] FATAL:  password authentication failed for user "postgres"
2022-07-22T23:11:39.000 [info] flypg    | 2022-07-22 23:11:39.144 UTC [1156] DETAIL:  Connection matched pg_hba.conf line 3: "host all all ::0/0 md5"
2022-07-22T23:11:39.000 [info] Failed to create required users: failed to connect to `host=fdaa:0:3eb9:a7b:9d34:1:50e5:2 user=postgres database=postgres`: failed SASL auth (FATAL: password authentication failed for user "postgres" (SQLSTATE 28P01))
***v0 failed - Failed due to unhealthy allocations and deploying as v1 

I’m not sure whether you’ve told your app everything about the new database URL, etc., but I wonder whether the following thread holds the key somewhere along the line: How to get DATABASE_URL if missing

Ah my apologies, yes that thread straightened me out. Thank you!

1 Like