database push failing due to wrong key expiration date

Open
#5,091 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, typescript
Domain
cli, database

Research direction

Start by reproducing the failure with npx supabase db push and review the CLI path that initializes the login role, using the reported SQL and valid until timestamp as the starting point. Trace how the expiration date is generated and verify that the command completes successfully without the permission error in both local use and GitHub Actions.

Written by the indexing model from the issue text.

Description

🐛 Bug supabase/cli

Describe the bug
Error when pushing to the DB, both locally and in Github Actions. It seems that a key is being generated with the wrong validity (5m - 60m).

npx supabase db push
Initialising login role...
unexpected login role status 400: {"message":"Failed to create login role: ERROR:  42501: permission denied to alter role\nDETAIL:  Only roles with the CREATEROLE attribute and the ADMIN option on role \"cli_login_postgres\" may alter this role.\nCONTEXT:  SQL statement \"alter role cli_login_postgres with password 'aaaaaaaaaaaaaaaaaaaa' valid until '2026-04-15 22:25:23.223853+00'\"\nPL/pgSQL function inline_code_block line 13 at EXECUTE\n"}

2026-04-15 22:25:23.223853+00 was 55 minutes before I ran the command.

To Reproduce
Steps to reproduce the behavior:

  1. npx supabase db push

Expected behavior
A clean db push.

System information
Rerun the failing command with --create-ticket flag.

  • Version of OS: macos 26.4.1
  • Version of CLI: 2.91.1
  • Version of Docker: 29.3.0, build 5927d80c76
  • node: v24.14.0
  • Versions of services:
   SERVICE IMAGE          | LOCAL                  | LINKED     
  ------------------------|------------------------|------------
   supabase/postgres      | 17.6.1.063             | 17.6.1.063 
   supabase/gotrue        | v2.188.1               | v2.188.1   
   postgrest/postgrest    | v14.1                  | v14.1      
   supabase/realtime      | v2.82.0                | -          
   supabase/storage-api   | v1.53.0                | v1.53.0    
   supabase/edge-runtime  | v1.73.3                | -          
   supabase/studio        | 2026.04.08-sha-205cbe7 | -          
   supabase/postgres-meta | v0.96.4                | -          
   supabase/logflare      | 1.37.1                 | -          
   supabase/supavisor     | 2.7.4                  | -          

Additional context
Timezone Europe/Lisbon

Dominant language
TypeScript
Stars
2.4k
Forks
523
Avg merge
21h 33m
Merged PRs (30d)
258

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/cli

All issues in supabase/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.