AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

PG 15→17 Upgrade Fails At Completion Due To Missing Pg_cron Update Path, Leaving Project In Unrecoverable State

An in-place Postgres 15 to 17 upgrade on Supabase aborts during the completion step because the extension pg_cron has no update path from version 1.6 to 1.6.4. This leaves the database running on PostgreSQL 17.6.1.127 but with rest/auth services down, no valid restart target, and no self-service recovery path.

criticalConfidence 90%PostgreSQLAffected Vpg_cron 1.6Affected VPostgreSQL 15 To 17 Upgrade

Origin Analysis

The upgrade completion process executes ALTER EXTENSION pg_cron UPDATE (or similar) which requires an update path from the installed version (1.6) to the target version (1.6.4). PostgreSQL's extension mechanism relies on version-specific update scripts (e.g., pg_cron--1.6--1.6.1.sql, etc.), and if no chain of scripts exists from the current version to the target, the command fails with 'extension "pg_cron" has no update path from version "1.6" to "1.6.4"'. The Supabase upgrade preflight did not verify the availability of update paths before starting the data migration, causing the completion phase to abort, skip finalization steps (such as collation refresh and reindexing), and leave the control plane without a valid restart target.
1. Have a Supabase project on PostgreSQL 15 with pg_cron extension version 1.6 installed (with scheduled jobs). 2. Trigger an in-place PostgreSQL 17 upgrade from the dashboard. 3. Data upgrade completes, but finalization fails with 'extension "pg_cron" has no update path from version "1.6" to "1.6.4"'. 4. Upgrade status becomes 5_data_upgrade_completion_failed; rest/auth become unhealthy, API requests return 503. 5. Dashboard 'Restart project' fails with 'Unable to locate a single valid target for the restart; found 0'.

Fixing Code Block

Edge Case Audit

This script is destructive: DROP EXTENSION ... CASCADE removes the cron schema and all dependent objects. The backup and restore of cron.job relies on identical table structures between the old and new versions; any schema changes may cause the INSERT to fail or lose data. Run this only during a maintenance window after taking a full physical backup. Ensure no active connections are using pg_cron during the operation. After executing, the platform control plane must still be repaired (e.g., reattach compute target, restart services) — this script does not fix the missing restart target. Rollback: if the script fails, restore from the most recent backup or use the backup table to reinstall the previous pg_cron version (if available). Test thoroughly in a staging environment first.

Ecosystem Topology