-
Notifications
You must be signed in to change notification settings - Fork 101
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
undo a database transaction results in "internal server error" generated by waitress #964
Comments
I think this should be handled by Zope. I'd have expected that the error handling pages would have catched this error for a nicer display. |
Hiding the original exception is done by waitress, not Zope, since allowing tracebacks to show leads to an information disclosure vulnerability. You can use the
These configuration options provide a simple traceback display, it's nothing pretty, but at least it doesn't "hide" the real traceback. But again, this is an information disclosure and should only be used for debugging, not in production. A real debugging tool is part of the |
How did Zope 2 behave in this case? I think it rendered an error message on the Undo page instead of a HTTP-500 error, didn't it? (I currently do not have a Zope 2 at hand to check.) I seem to remember that we fixed this behavior in other places. Maybe we can do it here, too. |
What you see in the browser when a I don't recall any "fix" in Zope 4 or 5. I think it's been that way forever after adopting Zope 2 used a default |
The error message would only be shown to the logged in user in the ZMI, so I do not think there is an information disclosure. When we switched to waitress, we encountered many uncaught exceptions. While I do not find a fixed one immediately, there are similar issues e.g. in the ZCatalog:
I am pretty sure we fixed quite a couple of these issues... I am a bit in a hurry, but maybe this one is a similar thing? |
The error message and traceback would be shown to any anonymous visitor. There is no distinction between logged in or not, or "in the ZMI" or not. So there definitely is an information disclosure. Remember that this behavior affects any site error that's not covered by explicitly defined error views, not just your Undo error. |
I still don't get it. Only users with the Lines 100 to 101 in f3bfc64
Without triggering the function, there can't be a traceback. Or in other words. When an upriviledged user tries to access the mentioned function, the user gets an unauthorized error. |
Jürgen Gmach wrote at 2021-5-6 13:01 -0700:
I still don't get it.
Only users with the `undo_changes` permission can trigger the function.
https://github.com/zopefoundation/Zope/blob/f3bfc6423563795ab4ff0e644a11e75ff4435b8a/src/App/Undo.py#L100-L101
Without triggering the function, there can't be a traceback.
Jens explained that the detail suppression happens in `waitress`
which knows nothing about the concrete cause of the exception.
It knows only about exceptions not handled by the WSGI application
(and for which it must do something).
In your special case, the operation would usually only be performed
by an authenticated `Manager`, but other operations could be
performed by anonymous users and also cause exceptions, maybe
leading to a traceback with potential sensitive information.
Jens described what you can do to deactivate this
`waitress` feature in general and what you can do to handle this
special case (install a `standard_error_message`; register
a corresponding exception view).
In my experience, we do not need traceback information in
error pages: it can be found via the `error_log` object (if installed).
|
I'll summarize:
I had created that |
After a bit of searching I found an issue where we switched from a HTTP-500 to render an error message on the page in the ZMI: #357 (quite the same fix as mentioned by @jugmac00: zopefoundation/Products.PythonScripts#23) |
I fired up a Zope 2.13 and got this when trying to undo an older transaction: This is not what was in my head. |
Michael Howitz wrote at 2021-5-6 23:26 -0700:
...
Additionally there is difference to #357 where the exception is risen in the application code. Here it occurs during `commit`. This makes it a bit harder to catch the exception.
While `commit` is usually called inside the framework,
the application can call it itself (e.g. to handle
commit exceptions itself).
In this case, it is important to either reraise an exception
or to abort the transaction if `commit` causes an exception.
Otherwise the `commit` in the framework will fail with a
"doomed transaction error".
|
I am on the Zope 5.1.2.
In ZMI, when I go to the Database tab, and hit undo on a transaction, which cannot be undone because of some data was modifed later on, I get an "Internal Server Error" (generated by waitress).
I certainly can go to the log and have a look there, but I would expect to get a proper message in the ZMI.
P.S.: I am not entirely sure, whether the "Zope" project is the correct one, or rather in the ZODB or ZEO project? Please move if appropriate.
Traceback
The text was updated successfully, but these errors were encountered: