Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.

Connection Failure on Digital Ocean Managed Database #573

@IanMitchell

Description

@IanMitchell

Bug description

I'm running into problems connecting to a new Digital Ocean PostgreSQL managed database. I'm seeing the following errors:

❯ DEBUG=* DATABASE_URL="<str>" npx prisma migrate up --experimental
Environment variables loaded from prisma/.env
Error: Error: undefined: Unknown error occured: Failure during a migration command: Connector error. (error: Error querying the database: Error querying the database: db error: ERROR: permission denied for database <dbname>

I deleted the database to try and go through the prompt to create it, and that gave some additional output:

A database with that name doesn't exist at <str>
 › Yes
Error: Error: Command failed with exit code 255: /node_modules/@prisma/cli/migration-engine-darwin cli --datasource <str>
Aug 30 10:52:07.140  INFO migration_engine: Starting migration engine CLI 
Aug 30 10:52:07.447 ERROR migration_engine::commands: Error querying the database: Error querying the database: db error: FATAL: pg_hba.conf rejects connection for host "<my ip>", user "<user>", database "template1", SSL on

{"is_panic":false,"message":"Error querying the database: Error querying the database: db error: FATAL: pg_hba.conf rejects connection for host \"<ip>\", user \"<user>\", database \"template1\", SSL on\n","backtrace":null}
    at o (node_modules/@prisma/cli/build/index.js:2:1286428)

My database is configured to allow all sources; however, template1 seems to be a system table that I don't have the ability to modify or access. I'm able to connect to the database I created using psql but I get the same connection error when I try to access the template1 table. I get an Unspecified GSS failure (not quite sure what this means, sorry!)

How to reproduce

  1. Create a managed PostgreSQL instance on Digital Ocean
  2. Edit trusted sources to allow all connections
  3. Run DATABASE_URL="<str>" npx prisma migrate up --experimental using their provided connection string
  4. Error will print

Prisma information

I'm on version 2.5.1. Happy to provide other information if it helps

Environment & setup

macOS, Node.js 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions