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
Error: UserFacingError
or Error querying the database: db error: ERROR: must be owner of view pg_stat_statements
for specific database
#8212
Comments
Seems this database has the permissions set up in a way that we do no expect and like.
Can you tell us a bit more how exactly to create such a database so we can reproduce this please? Thanks. |
Error querying the database: db error: ERROR: must be owner of view pg_stat_statements
`
Error querying the database: db error: ERROR: must be owner of view pg_stat_statements
`Error querying the database: db error: ERROR: must be owner of view pg_stat_statements
Ok I'll show this step by step
In my opinion though, the more important thing is that |
Error querying the database: db error: ERROR: must be owner of view pg_stat_statements
Error: UserFacingError
or Error querying the database: db error: ERROR: must be owner of view pg_stat_statements
for specific database
Thanks for the repro steps, we will take a look and see what is going on there. I am pretty sure the Can you try this with a 2.26.0 project just to make sure this is not already fixed? |
@janpio checked on Prisma 2.26 on 2 different instances. Same stuff... so no it's not fixed :\ errors are different though 🤔
errors for
|
Interesting, so during our reproduction we definitely have to look at both versions to get the full picture. We'll do that as soon as possible, until then seems that our Migrate tooling unfortunately does not like this database setup :( |
Took a quick look already, using the When using
But that is expected with Cloud databases, and the solution is explained behind the link. Unfortunately even if the shadow database is set and not hosted at render.com, this problem persists:
I created a separate issue for this: #8217 Trying with a previously created migration SQL file now. |
Hm, with an existing migration file, I could cleanly apply it with
Can you please double check that you are using the External Connection String from the Render UI? You wrote "Internal" above, but added a screenshot with "External". |
@janpio ah sorry in my comment i mean external conn string and I tried erasing all the migrations (
same happens with
|
Can you set the |
same stuff: also tried on ElephantSQL regarding the shadow database, I think I set it up long ago when first using Prisma. I obviously have a local running instance of postgres |
@janpio my bad I forgot that in fish shell i must use so here we go with
and
I tried switching DB_URL back to Render, it worked one time and them spammed the console with could be an issue with pnpm then... gonna re-install my project with |
tried re-installing with same issue so it's not about pnpm |
The database server not being reachable sounds much more like a firewall or connection problem - if even Can you connect to these database servers with a database UI like DBeaver or similar from your machine? If you want you can share one of the connection strings with me on Slack (@janpio as well there) and I can confirm that it works from my machine. If you create a new project and put it on GitHub, I could even do that with the exact same code you are running. |
@janpio good, I contacted you on Slack most likely you're right, for some reason every database provider blocks me? or I am blocking them? Commands work when I run them with a socks proxy (e.g. solution for others who may come across with this: add |
That makes a lot of sense for the error message you are getting right now. The original one though, might still be a bug on our side:
If you ever get to reproduce this one, let us know in a new issue and I can take another look. I bet it is similar to #8217 - but as I can not reproduce it, having a reproduction would be nice. |
I have the same error. I'm also trying to use elephantSQL pull works, actually push also works. migrate and reset do not to repro this just try and setup any cloud provider. it's a bit of a major issue that prisma doesn't work with dedicated PG DB hosting companies?
|
Does the instructions given in the error message not work for you? It is unfortunate that some providers do not let Prisma create additional temporary databases on demand, as most other providers do - but that is why that workaround was implemented and usually is enough to prevent the problem. |
@janpio you mean this stuff? No, it doesn't work with the provider I listed. I tried using specific shadow database as a separate DB, no joy on that either. I also tried your own service, but then i need to sign up for another third party account to support it, its not self-contained. maybe you can list some pgsql saas that prisma does actually work with, that might be quicker? I'm wondering if this is a lockin strategy, making stuff incompatible with other saas pgsql providers, as your future roadmap is to monetize via hosting? like a mongoatlas /vercel kind of plan? alternately I can dev with a local DB. it says the shadow thing is just for development. |
i was seeing if i can just but reset also fails on elephantsql saas
|
That is super weird, becuase if you provide a
Amazon RDS works fine.
No it is not, it is just that we use an additional database to create better migrations.
Correct, only specific commands - which are recommended for development (so creation of migration) only need a shadow database in the first place.
Can you open a new issue about this with all the information you can provide? That is just broken and we need to find a way around that. |
I switched to supabase, which has a pretty good PG offering, that seems to work fine. |
For anyone in the future using elephantsql, this is simply the way they've gone about partitioning the hardware they have. You don't have full access to the database RDBMS, but rather, they use one system to create dozens of databases within the same Postgres management system. I'm not sure at the moment if this is something that's really possible or easy to work around. I'm sure there could be some adjustments within prisma's own code to assist in this type of situation (whether that type of change is justified or not is a whole different game), but more often than not, you may need access to the full db management system. |
Bug description
Whenever I try to deploy migrations to any remote database that isn't localhost, I get this error:
I also tried running this:
...so it connected somehow? but refuses to connect on
deploy
command... weirdHow to reproduce
prisma@2.23
and@prisma/client@2.23
prisma migrate deploy
Expected behavior
It should deploy migrations with no issues. It works fine on
localhost
though, which is weird...Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: