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
Running npx prisma introspect
throws access denied error
#6778
Comments
This really look like the user What is the schema of that database called? If it is not Can you try setting a password for the user and adding that to your connection string as well - maybe we have a bug around password less users. |
You can try setting basic postgres docker container with one table and try to introspect. |
@enoent4400 I think if you try to connect via peer authentication, then you will need to provide a unix domain socket in the connection string. Can you try setting a password instead and try this? I use the following postgres docker config: version: '3'
services:
postgres:
image: postgres
ports:
- 5432:5432
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres:/var/lib/postgresql/data
volumes:
postgres: ~ |
Internal reproduction note: Just try to introspect a database with the original Docker file. |
For me it was my other local running instance of postgres. Previously I had installed postgres.app and pgadmin for another project and had it running in the background. So if you're running postgres inside docker, be sure to quit any other local postgres instances. Soon as I did that the issue went away. |
Bug description and reproduction
This is pretty basic example I used to experiment with Prisma introspect feature and to test it with existing DB. I'm running Postgres database inside Docker container with already defined schema. Existing model just creates one table like:
My docker compose looks like:
After you run
docker compose up
you will have running DB in a container locally ready to accept connections.Run
npx prisma introspect
You will get following output:
I tried also granting permissions to user postgres, no luck.
schema.prisma file
Running npx prisma validate is returning ok result.
Expected behavior
It should run introspection and populate schema.prisma file. This is pretty basic example and should be pretty much covered inside the official docs.
Environment & setup
The text was updated successfully, but these errors were encountered: