Skip to content

Conversation

@MorrisJobke
Copy link
Member

Log the maintenance mode exception only in debug level. Fixes #6124

How to test:

  • enable maintenance mode
  • enable log level 0 (debug)
  • access webdav (PROPFIND against root for example)
  • before: maintenance mode is logged in error log level (4)
  • after: maintenance mode is logging in debug level (0)
  • additional: update needed should still be logged in error level

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews papercut Annoying recurring UX issue with possibly simple fix. labels Aug 15, 2017
@MorrisJobke MorrisJobke added this to the Nextcloud 13 milestone Aug 15, 2017
@MorrisJobke
Copy link
Member Author

@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.')) {
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Member Author

@MorrisJobke MorrisJobke Aug 15, 2017

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')],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InvalidPath?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ummm sorry -.-

@MorrisJobke MorrisJobke force-pushed the do-not-log-maintenance-mode branch 2 times, most recently from f61805f to dbb247a Compare August 15, 2017 13:02
Log the maintenance mode exception only in debug level. Fixes #6124

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@MorrisJobke MorrisJobke force-pushed the do-not-log-maintenance-mode branch from dbb247a to fc12bd0 Compare August 15, 2017 13:03
@LukasReschke LukasReschke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Aug 15, 2017
@MorrisJobke MorrisJobke merged commit 60a485b into master Aug 15, 2017
@MorrisJobke MorrisJobke deleted the do-not-log-maintenance-mode branch August 15, 2017 19:26
@nickvergessen
Copy link
Member

Reported again, time to backport?
#6824

@MorrisJobke
Copy link
Member Author

Reported again, time to backport?

I'm open for this. Stable12 should be okay.

@MorrisJobke MorrisJobke self-assigned this Oct 23, 2017
@MorrisJobke
Copy link
Member Author

Let me do it

@MorrisJobke
Copy link
Member Author

Backport to stable12 in #6908

@MorrisJobke MorrisJobke removed their assignment Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish papercut Annoying recurring UX issue with possibly simple fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants