Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma 2 is failing to migrate remote database (DO hosted instance) #562

Closed
pantharshit00 opened this issue Sep 18, 2019 · 5 comments
Closed
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Milestone

Comments

@pantharshit00
Copy link
Contributor

pantharshit00 commented Sep 18, 2019

I tried to perform migration in a Digitalocean hosted instance in order to triage this issue: #556

I used the default script starter

But the migration failed with the following rust panic:
image

Connection string:

postgresql://doadmin:XXXXXXXX@XXXXXXXXXXXX.db.ondigitalocean.com:25060/defaultdb?schema=issue_552&sslmode=prefer

Internal note: You can find the credentials in 1password.

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Sep 18, 2019
@janpio janpio changed the title Prisma 2 is failing to migrate remote database(DO hosted instance) Prisma 2 is failing to migrate remote database (DO hosted instance) Sep 18, 2019
@janpio janpio added this to the Preview 13 milestone Sep 20, 2019
@tomhoule
Copy link
Contributor

The error message should improve after prisma/prisma-engines#45.

I've done some digging and the issue seems to be caused by the absence of a default database named postgres in DigitalOcean managed postgres. The default database name appears to be completely configurable. But at the moment prisma 2 assumes there is a default database called postgres we can log into to issue commands like CREATE DATABASE. Relevant code.

There's an always-present template1 database in postgres but it doesn't guarantee it would work for what we want to do from it, so I'll wait until I can reproduce the issue with the database from the description.

@tomhoule
Copy link
Contributor

Implemented solution: try to connect to postgres, then template1 (should always be there), and failing that return with a descriptive error message. PR: prisma/prisma-engines#51

I haven't been able to reproduce the 'schema with underscore fails to migrate' issue locally, I'll try later on DO.

I'll start investigating the pgBouncer issue.

@tomhoule
Copy link
Contributor

From the digitalocean doc, it looks like database creation is pretty locked down and it's meant to be done through their UI. I will keep researching, but we may have to resort to just having a good error message there.

On an existing DO database with pgBouncer, I didn't encounter any issue migrating with a schema with underscores in its name.

@divyenduz
Copy link
Contributor

divyenduz commented Oct 9, 2019

I was able to create database and schema using tableplus with or without pgbouncer.

I used to doadmin user to perform these operations.

@divyenduz
Copy link
Contributor

@pantharshit00 I am no longer able to reproduce this error with the latest alpha, are you? If no, please close this issue.

@divyenduz divyenduz assigned pantharshit00 and unassigned divyenduz and tomhoule Oct 9, 2019
timsuchanek added a commit that referenced this issue Apr 14, 2020
Former-commit-id: 61dc229
timsuchanek added a commit that referenced this issue Apr 14, 2020
Former-commit-id: 61dc229
Former-commit-id: fa11327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

4 participants