Postgres commands failing

Hi,

I am not sure if I am doing something wrong, but all the postgres commands are failing when I run them against my postgres app.

Commands I tried:

flyctl postgres config view -a <postgres-app-name>
flyctl postgres connect -a <postgres-app-name>
flyctl postgres users list -a <postgres-app-name>
flyctl postgres db list -a <postgres-app-name>

They all return Error command is not compatible with this image. The only pg command that works is flyctl postgres list. Other app commands such as logs, ssh, etc work fine with this app.

flyctl version
fly v0.0.431 darwin/arm64 Commit: eeef66af BuildDate: 2022-11-13T17:11:38Z

Any ideas?

Hey, run flyctl image show --app <postgres-app-name> to see which image version you are running and update to the latest with flyctl image update --app <postgres-app-name>.

1 Like

Thanks for the reply!
The image version is as follows:

  Registry   = registry.fly.io
  Repository = <postgres-app-name>
  Tag        = deployment-01GG03KAG46WTE0GVEH3BHYRJ4
  Version    = N/A
  Digest     = sha256:970b38a31b5ed41303ab321f6d97b9dc811c717d74374be9cc4212c2ae6235d0

Unfortunately I get this error when I run image update: Error image is not eligible for automated image updates

I SSHed into the image and ran psql --version. This is what I got psql (PostgreSQL) 14.4 (Debian 14.4-1.pgdg110+1)

The Version is undefined. Did you run fly deploy or deploy your own image against this app at some point?

I only see v0 and v1 deploys and the second might have been a fly deploy from a month ago, but I can’t recall as I was following the docs but might have made a mistake.

Is the only way to revert this is to create a new app and move the data over?

Oh, it’s easier than that:

  1. First save your fly.toml file with flyctl config save --app <postgres-app-name>
  2. Then run flyctl deploy --image flyio/postgres:<tag>. The image tag here must match the major version you are already running. That should be 14.4 in your case.
  3. You should have the latest image with all the flyctl goodies after that.

Note: next time you want to update your postgres image, use flyctl image instead of flyctl deploy.

2 Likes

That worked like a charm. Thank you a bunch!

1 Like