Skip to content
Postgres major upgrade 16 → 17/18 fails at "Running pg_upgrade" (pgaudit preloaded?)
riki95
OP

44 minutes ago

Hi Railway team,

The in-place PostgreSQL major upgrade (Database → Config → Version) fails every time at the same step on my Postgres service (linked to this thread).

Source: postgres-ssl:16 (PostgreSQL 16.15). Attempts on 2026-11-23, UTC:

  • 13:50 to PostgreSQL 18: failed
  • 13:52 to PostgreSQL 18 (retry): failed
  • 13:57 to PostgreSQL 17: failed

Each time the preflight said "No blockers found" (data size 30 MB, extensions: plpgsql and uuid-ossp). The error is always:

"Failed at: Running pg_upgrade. The upgrade job failed before it finished. The upgrade stopped before touching the data directory, so the database is exactly as it was."

The database is fine and back on 16. The job output isn't visible anywhere I can look (service logs, deployments, volume), so I can't tell what fails.

Possibly relevant:

  • Until today the service ran postgres-ssl:latest (deployed Dec 2025). I pinned it to :16 right before upgrading. That new :16 build added pgaudit to shared_preload_libraries (postgresql.conf now has 'pg_stat_statements,pgaudit'). pgaudit is preloaded but not installed as an extension.
  • This looks close to the pgaudit / pg_upgrade --check issue fixed in railwayapp-templates/postgres-ssl PR #161. That fix was tested on 17 → 18; maybe the 16 → 17/18 upgrade jobs are still affected?
  • postgresql.auto.conf has max_connections = 500.
  • Volume: 500 MB, about 132 MB used.

Could you check the upgrade job logs and tell me what's failing and how to fix it?

Thanks!

Awaiting User Response

1 Reply

Status changed to Awaiting Railway Response Railway • 42 minutes ago


Railway
BOT

20 minutes ago

The upgrade attempts are stopping on disk space, not on pgaudit. The job needs at least 512 MiB of free space on the volume for the new cluster's catalogs and pg_upgrade's working files, and your volume only had about 345 MiB free, so it stopped before touching your data.

Your volume is 500 MB and Hobby volumes can go up to 5 GB, so you can grow it with Live Resize from the volume's settings (open the volume, click Live Resize and follow the prompts), then run the version upgrade again. See Live resizing a volume.


Status changed to Awaiting User Response Railway • 20 minutes ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...