-
Notifications
You must be signed in to change notification settings - Fork 48
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 in Prisma Client request #1195
Comments
Although I haven't used with mongodb, I recommend to type below
|
@daeb2a Thanks for the suggestion, I gave that a try but it didn't seem to change the behavior at all. |
I'm seeing this as well (with a
|
@silverbucket does Prisma Client work with the same connection string? @kimberli the error in the original report comes from the MongoDB driver, I don't think you could be getting it with |
Ah sorry, here's the error message I'm getting in the browser (when I try to commit changes in Prisma Studio)
|
@kimberli it looks like the error message is stripped, it only contains the minified source code where the error happened which ends at some point with an ellipsis, and the actual, well, message is missing 😞 Did you get it in a popup in UI or in the browser's console? If it's the former, is there a full messsage in the console by any chance? |
Opened prisma/prisma#22492 |
@aqrln I'm not sure what you mean by "the same connection string" ? |
@kimberli we should definitely fix how the errors are being displayed in Studio, I agree that right now it is very hard to figure out what happened when something goes wrong. I opened an issue, hopefully we can prioritise it. @silverbucket same database URL |
Same database URL as what? |
ping @aqrln could you clarify specifically what you're asking me to try? |
@silverbucket I wanted to clarify whether the Prisma Client in your application works (assuming you use it at all) with the same database and only Studio is affected, or both are affected. |
Hello, did you |
@Jsox What do you mean with "same error"? Can you share the error? What database are you using? |
Thanks for the clarification @aqrln, regarding the Prisma Client, when I try to save a record to the DB it fails with:
However, based on the documentation, and the schema validation, everything seems to be written out correctly (It's the exact schema as written in this ticket). $ cat prisma/schema.prisma
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
relationMode = "prisma"
}
enum Language {
CZECH
ENGLISH
}
model Word {
id String @id @default(auto()) @map("_id") @db.ObjectId
lang Language
name String
image String
translatesTo Word[] @relation("WordTranslations", fields: [translatesToId], references: [id])
translatesToId String[] @db.ObjectId
translatesFrom Word[] @relation("WordTranslations", fields: [translatesFromId], references: [id])
translatesFromId String[] @db.ObjectId
definition String
sentence String
}
$ pnpx prisma validate prisma/schema.prisma
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
The schema at prisma/schema.prisma is valid 🚀 |
i had the same error. using npx prisma db push again solved it. in my case i updated my .env and i assume db push reads ur recent .env |
Facing the same issue here, nothing's really solving it. |
For me, it was that I was trying to access using the username |
I was having the same problem with a specific model, have no idea about the root cause but when i deleted every |
If it helps... providing env file solved my issue |
I was able to solve by running |
Solution: downgrade to see the real error message. With Prisma 5.8.1
With Prisma 5.4
The issue is about the error message not being displayed properly. Once you see the actual error message, it's easy to fix (environment variable issue in my case). |
Hello guys. I have the same problem with Prisma and mongodb and nothing helps; this is my code:
and this is my schema:
and the .env file:
and this is the error message when I press the save button in Prisma Studio:
connection to my db is done because my models are created in the database. |
This is the relevant bit of the error message @ayub48:
If you can not figure this out, please open a discussion over at https://github.com/prisma/prisma/discussions/ |
This is the solution some of us forgot to re-initialize the database with out changes in the schema, thanks! |
I just got the same error. Using Prisma 5.9.1 and PostgreSQL 16. I found the reason for this, at least in my project. Prisma Studio error occurred when there's data in the database. Editing data in pgAdmin didn't work. Wouldn't allow me to save update on UserType in User table. Two quirky solutions:
HERE'S THE CAUSE OF MY PRISMA STUDIO ERROR: I changed my enum, from: To: then do 'npx prisma generate' (Prisma Studio error in brower) DB PUSH ERROR************ PRISMA STUDIO ERROR************ Invalid 1552 For more information, check out the Getting started guide here: ${ye("https://pris.ly/d/accelerate-getting-started")}`)}else return ai( Query: |
Didn't work for me. See error in my reply. |
Solution (that worked for me):Summary: Ensure password on pgAdmin4 is same password for your database environment Environment & setup
Prisma Version
Error I received
How I came to the conclusion had an authentication error?After using some help from ChatGPT I found out that the error was in regards to authentication issues, more specifically:
This got me confused as my To double check that it was truly an authentication error I ran And got this error
SolutionAfter some playing around I realised my password on pgAdmin was not the same as that in my project, so to fix this I did:
|
I managed to resolve the issue I was facing. It turned out I was using a schema that differed from the one in my latest database push, which is likely why Prisma Studio wasn't recognizing it. |
In my case I was using the
|
I'm relatively sure that this error is caused by the
|
In my case, it was the uniqueness of the id field (constraint applied) that I manually seed it to the db. So if you seed your data or manually input the Any attempt of creation will fail as it tries to start the
Or delete all data in the that collection you having trouble with, so it can restart the unique |
I had the same problem and it was due to the fact that I used .env.local instead of .env, as soon as I returned the name everything worked, I will be glad if I helped you) |
Thanks @AlexRixten! |
In my case this was the problem, thank u |
I had this same issue and fixed it by using dotenv CLI via package.json
|
Please, everyone commenting here or trying to, please oepn a new issue and include the full information you get behind "Show Details" of the error modal. Thank you. |
Bug description
Simply start up prisma studio, after a few seconds the browser gives the error:
How to reproduce
pnpx prisma studio
Expected behavior
Should load the database table.
Prisma information
// Add your code using Prisma Client
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: