-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
I receive the following log with no context in production no details about closed transaction
#21357
Comments
What other information would you expect? |
I don't know what other information is available about the database transaction, anything could be helpful. What operation was trying to run when we found the transaction was closed. The actual SQL source code of the transaction, Whether its a Whether its a method like Anything that helps me figure out which part of my business logic caused a failed transaction. |
Wouldn't that be more a thing you figure out via a |
As @janpio said above, the kind of information you are interested in is something that the engine doesn't really know a lot about on this level, this would be something that's best solved on the Prisma Client side. Much of the information you are asking about should already be in the error message — is that not the case for you? As for the engine-side state that is relevant here, the log line you get means that we can't provide information about whether the operation failed because the transaction had already been committed or rolled back, or if it had expired (and what amount of time elapsed since the start of the transaction compared to the declared transaction timeout in the latter case) because it has already been evicted from the LRU cache. You can increase the size of that cache by setting the |
I am using the prisma error logging events ( https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#log ) With code like
In this context I have not instrumented every single one of the 2000 reads & writes a novel try / catch and a novel logger error. Also the error bubbling of promises & try catch means that in my HTTP handler I also have zero context. Since the API is promise based and error bubbling based I expect all the useful meta data to exist as fields on the error class. |
Please put that in the error object, that's really really useful and valuable information. |
Can I set that progmatically without having to set an environment variable ? as a parameter into the prisma client class ? |
Bug description
The log statement gives me no context other then a postgres transaciton was closed.
See prisma/prisma-engines#3391
Adding more context in the transaction prisma engine would really help.
How to reproduce
Expected behavior
No response
Prisma information
// Add your schema.prisma
// Add your code using Prisma Client
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: