-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Do not log WebDAV maintenance mode exception #6132
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
Conversation
|
@mwries please test this as well 😉 |
| $level = \OCP\Util::FATAL; | ||
| if (isset($this->nonFatalExceptions[$exceptionClass])) { | ||
| if (isset($this->nonFatalExceptions[$exceptionClass]) || | ||
| ($exceptionClass === 'Sabre\DAV\Exception\ServiceUnavailable' && $ex->getMessage() === 'System in maintenance mode.')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a custom exception in \OCA\DAV\Connector\Sabre\MaintenancePlugin::checkMaintenanceMode and then match also on ::class.
Right now this, for example, doesn't catch the Upgrade needed. A custom exception would help here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is, that then the webdav response would change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the "upgrade needed" should also not be catched, because this is more fishy I think and worth to log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would change then the response too:
<?xml version="1.0" encoding="utf-8"?>
<d:error
xmlns:d="DAV:"
xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\ServiceUnavailable</s:exception>
<s:message>System in maintenance mode.</s:message>
</d:error>| return [ | ||
| [0, '', new NotFound()], | ||
| [0, 'System in maintenance mode.', new ServiceUnavailable('System in maintenance mode.')], | ||
| [4, 'Upgrade needed', new InvalidPath('Upgrade needed')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidPath?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ummm sorry -.-
f61805f to
dbb247a
Compare
Log the maintenance mode exception only in debug level. Fixes #6124 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
dbb247a to
fc12bd0
Compare
|
Reported again, time to backport? |
I'm open for this. Stable12 should be okay. |
|
Let me do it |
|
Backport to stable12 in #6908 |
Log the maintenance mode exception only in debug level. Fixes #6124
How to test: