Skip to content

[Bug]: ERROR: permission denied for schema public - due to Shelf requesting SSL from a local http database #1953

@Erudition

Description

@Erudition

Contact Details

adroit1+shelf@proton.me

What happened?

In Shelf logs:

Prisma schema loaded from app/database/schema.prisma

Datasource "db": PostgreSQL database "supabase", schema "public" at "192.168.0.25:5432"

171 migrations found in prisma/migrations

Error: ERROR: permission denied for schema public

   0: sql_schema_connector::sql_migration_persistence::initialize

           with namespaces=None

             at schema-engine/connectors/sql-schema-connectorsql_migration_persistence.rs:17

   1: schema_core::state::ApplyMigrations

             at schema-engine/corestate.rs:236

Steps to reproduce:

  1. Run Supabase locally via docker compose
  2. Run Shelf locally in Docker
  3. Connect shelf to the Supabase db with a connection string like "postgresql://postgres.tenant:password@192.168.0.25:5432/supabase"
  4. See error in Shelf, permission denied
  5. See more specific error in Supabase's pooler/db container

I'm running entirely in-LAN and don't have SSL set up, but that's working just fine for Supabase. However, Shelf seems to request SSL from postgres even when it has no SSL in the connection string, so Supabase can't fulfill the request.

What is the expected behaviour?

Shelf can connect to Supabase locally.

Version

Self-hosted

What browsers are you seeing the problem on?

Firefox

Relevant log output

, :session, "supabase", nil}

12:32:05.232 project=selfhost user=postgres region=local mode=session type=single app_name=Supavisor peer_ip=192.168.16.1 [info] Detecting IP version for db

12:32:05.235 region=local [info] Starting ranch instance %{port: 43963, host: "127.0.0.1", listener: #PID<0.3566.0>} for {{:single, "selfhost"}, "postgres", :session, "supabase", nil}

12:32:05.254 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:05.427 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

12:32:05.468 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:07.493 request_id=GFYbq09r5PyASjgAAAdC region=local [info] HEAD /api/health

12:32:07.493 request_id=GFYbq09r5PyASjgAAAdC region=local [info] Sent 204 in 629µs

12:32:08.401 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

12:32:08.438 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:08.696 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

12:32:08.742 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:11.429 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

12:32:11.465 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:11.691 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

12:32:11.740 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:14.700 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

12:32:14.748 project=selfhost user=postgres region=local mode=session [error] DbHandler: Terminating with reason {:shutdown, :client_termination} when state was :idle

12:32:14.975 region=local peer_ip=192.168.16.1 [error] ClientHandler: User requested SSL connection but no downstream cert/key found

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions