[BUG] PostgreSQL 18 backup fails due to missing privileges for Databasus auto read-only user after DB schema upgrade #239

Closed
opened 2026-04-05 16:16:02 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @StafLoker on 1/14/2026

Description

I have installed Databasus v2.22.1 and PostgreSQL 18. After upgrading an application that performs automatic database schema migrations (Remnawave used only as an example, this can affect any application), PostgreSQL backups started failing.

Image
  • The first backup was performed before the upgrade and completed successfully.

The issue appears to be that schema changes introduced during migrations do not grant privileges to the Databasus auto-created read-only user, causing pg_dump to fail.

No manual database changes were made. The migration was executed entirely by the application’s official migration scripts.

Error in detailed:

PostgreSQL connection or authentication error. stderr: pg_dump: executing SELECT pg_catalog.set_config('search_path', '', false); pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: error: query failed: ERROR: permission denied for table nodes_user_usage_history pg_dump: detail: Query was: LOCK TABLE public._prisma_migrations, public.users, public.api_tokens, public.keygen, public.nodes, public.nodes_traffic_usage_history, public.nodes_usage_history, public.hosts, public.admin, public.subscription_templates, public.subscription_settings, public.hwid_user_devices, public.internal_squads, public.internal_squad_members, public.internal_squad_inbounds, public.config_profiles, public.config_profile_inbounds, public.config_profile_inbounds_to_nodes, public.infra_providers, public.infra_billing_nodes, public.infra_billing_history, public.user_subscription_request_history, public.hosts_to_nodes, public.config_profile_snippets, public.external_squads, public.external_squads_templates, public.remnawave_settings, public.passkeys, public.nodes_user_usage_history, public.user_traffic, public.internal_squad_host_exclusions, public.subscription_page_config IN ACCESS SHARE MODE 

Expected behavior

Backups should continue to work after schema migrations without requiring manual permission fixes.

*Originally created by @StafLoker on 1/14/2026* # Description I have installed Databasus v2.22.1 and PostgreSQL 18. After upgrading an application that performs automatic database schema migrations (Remnawave used only as an example, this can affect any application), PostgreSQL backups started failing. <img width="2982" height="2228" alt="Image" src="https://github.com/user-attachments/assets/a3908906-fec4-45b3-aff3-a88fd81a3f94" /> * The first backup was performed before the upgrade and completed successfully. The issue appears to be that schema changes introduced during migrations do not grant privileges to the Databasus auto-created read-only user, causing pg_dump to fail. No manual database changes were made. The migration was executed entirely by the application’s official migration scripts. # Error in detailed: ``` PostgreSQL connection or authentication error. stderr: pg_dump: executing SELECT pg_catalog.set_config('search_path', '', false); pg_dump: last built-in OID is 16383 pg_dump: reading extensions pg_dump: identifying extension members pg_dump: reading schemas pg_dump: reading user-defined tables pg_dump: error: query failed: ERROR: permission denied for table nodes_user_usage_history pg_dump: detail: Query was: LOCK TABLE public._prisma_migrations, public.users, public.api_tokens, public.keygen, public.nodes, public.nodes_traffic_usage_history, public.nodes_usage_history, public.hosts, public.admin, public.subscription_templates, public.subscription_settings, public.hwid_user_devices, public.internal_squads, public.internal_squad_members, public.internal_squad_inbounds, public.config_profiles, public.config_profile_inbounds, public.config_profile_inbounds_to_nodes, public.infra_providers, public.infra_billing_nodes, public.infra_billing_history, public.user_subscription_request_history, public.hosts_to_nodes, public.config_profile_snippets, public.external_squads, public.external_squads_templates, public.remnawave_settings, public.passkeys, public.nodes_user_usage_history, public.user_traffic, public.internal_squad_host_exclusions, public.subscription_page_config IN ACCESS SHARE MODE ``` # Expected behavior Backups should continue to work after schema migrations without requiring manual permission fixes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#239