Skip to content

ERROR: cannot drop function storage.get_level(text) because other objects depend on it (SQLSTATE 2BP01) #3425

Description

@GrimLothar

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Trying to use supabase cli for the first time in an already existing project. After pulling the DB for the initial migration and starting supabase, I get the error in the title

WARNING: You are running different service versions locally than your linked project:
supabase/storage-api:v1.19.3 => v1.22.2
Run supabase link to update them.
Seeding globals from roles.sql...
Applying migration 20250410152304_remote_schema.sql...
Applying migration 20250410153024_remote_schema.sql...
Stopping containers...
ERROR: cannot drop function storage.get_level(text) because other objects depend on it (SQLSTATE 2BP01)
At statement 32:                                                                                       
drop function if exists "storage"."get_level"(name text)  
Try rerunning the command with --debug to troubleshoot the error.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Link existing project to cli npx supabase link --project-ref [redacter]
  2. Pull db to get first migration file npx supabase db pull
  3. See this message as outcome The auth and storage schemas are excluded. Run supabase db pull --schema auth,storage again to diff them.
  4. Run what was suggested npx supabase db pull --schema auth,storage
  5. Try to start supabase npx supabase start

Get error

Expected behavior

No errors should happen

System information

  • OS: macOS
  • Browser N/A
  • Version of supabase-js: 2.49.1
  • Version of Node.js: v20.11.1

Additional context

I found this person having the same problem: https://stackoverflow.com/questions/79512775/supabase-error-cannot-drop-function-storage-get-leveltext-because-other-objec

And with supposedly a workaround by initially running:

supabase db pull --schema public,auth,storage

But like the comment on that answer states, after doing that, the auth and storage are still not pulled on the first pull, and you still get the initial warning The auth and storage schemas are excluded

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions