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

Using render.com database for migrate dev leads to error message ERROR: cannot drop view pg_buffercache because extension pg_buffercache requires it HINT: You can drop extension pg_buffercache instead. #8217

Closed
janpio opened this issue Jul 11, 2021 · 6 comments · Fixed by prisma/prisma-engines#2106
Labels
Milestone

Comments

@janpio
Copy link
Member

janpio commented Jul 11, 2021

2 cloud databases from render.com, then run migrate dev with some schema. Leads to this error message:

C:\Users\Jan\Documents\throwaway\repro8212>npx prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "reproduction8212", schema "public" at "frankfurt-postgres.render.com:5432"

Error: P3016

The fallback method for database resets failed, meaning Migrate could not clean up the database entirely. Original error: 
Database error
Error querying the database: db error: ERROR: cannot drop view pg_buffercache because extension pg_buffercache requires it
HINT: You can drop extension pg_buffercache instead.
   0: sql_migration_connector::best_effort_reset
           with connection=Connection(Postgres((PostgreSql { client: PostgresClient, pg_bouncer: false, socket_timeout: None, statement_cache: Mutex { is_locked: false, has_waiters: false }, is_healthy: true }, PostgresUrl { url: Url { scheme: "postgres", username: "shadow", password: Some("..."), host: Some(Domain("frankfurt-postgres.render.com")), port: None, path: "/reproduction8212shadow", query: None, fragment: None }, query_params: PostgresUrlQueryParams { ssl_params: SslParams { certificate_file: None, identity_file: None, identity_password: <HIDDEN>, ssl_accept_mode: AcceptInvalidCerts }, connection_limit: None, schema: None, ssl_mode: Prefer, pg_bouncer: false, host: None, socket_timeout: None, connect_timeout: Some(5s), pool_timeout: Some(10s), statement_cache_size: 500, max_connection_lifetime: None, max_idle_connection_lifetime: Some(300s) } })))
             at migration-engine\connectors\sql-migration-connector\src\lib.rs:115
   1: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
             at migration-engine\connectors\sql-migration-connector\src\flavour\postgres.rs:367
   2: migration_core::api::DevDiagnostic
             at migration-engine\core\src\api.rs:89

Also: Password logged in plain text in the error message of best_effort_reset

Problem does also not go away if shadow database is not hosted at render.com

@janpio janpio added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema. topic: prisma migrate dev CLI: prisma migrate dev topic: security topic: database-provider/render.com labels Jul 11, 2021
@janpio janpio changed the title Using 2 render.com databases for migrate dev leads to error message ERROR: cannot drop view pg_buffercache because extension pg_buffercache requires it HINT: You can drop extension pg_buffercache instead. Using render.com database for migrate dev leads to error message ERROR: cannot drop view pg_buffercache because extension pg_buffercache requires it HINT: You can drop extension pg_buffercache instead. Jul 11, 2021
@janpio
Copy link
Member Author

janpio commented Jul 11, 2021

More information about this table (and extension): https://www.postgresql.org/docs/9.4/pgbuffercache.html

@pantharshit00
Copy link
Contributor

I can reproduce this, migrate will require to ignore this extension like it ignores postgis.

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Jul 11, 2021
@tomhoule
Copy link
Contributor

Yep, we should special-case it, like postgis. Candidating.

@janpio
Copy link
Member Author

janpio commented Jul 12, 2021

Related: #8219

@worktechnotoil
Copy link

any solution for this ?

@janpio
Copy link
Member Author

janpio commented Dec 14, 2021

This should not happen any more after prisma/prisma-engines#2106. If it does, please open a new bug issue with all the informaiton the template asks for. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants