WEBDAV : 503 System in maintenance mode

Hello,

Since I’ve upgraded to Release 11 I suddenly face a non working webdav.
Working with some tools on windows / MacOS but not native on Windows 7 / Windows 10.
Access from a public ip is also impossible: Error 503 System in maintenance mode
: “app”:“webdav”,“message”:"Exception: {“Message”:“HTTP\/1.1 503 System in maintenance mode.”,“Exception”:“Sabre\\DAV\\Exception\\ServiceUnavailable”

Who know how to debug this please ?
Many thanks.

Nextcloud version : 11.0.2
Operating system : Centos 7 Linux version 3.10.0-514.el7.x86_64
nginx version : nginx/1.10.2
PHP version : PHP Version 7.0.15
Is this the first time you’ve seen this error and can you replicate it?: Yes first time
This error appears after upgrade from version 10

The issue you are facing:
Unable to access webdav from Windows 10, perfectly working with MacOS Sierra/Mountain Duck and Windows 7 / winSCP but not in native mode (BasicAuthLevel=2).
Access from a public IP not working.

The output of your Nextcloud log in Admin > Logging:
Fatal webdav Sabre\DAV\Exception\ServiceUnavailable: HTTP/1.1 503 System in maintenance mode.

[internal function] OCA\DAV\Connector\Sabre\MaintenancePlugin->checkMaintenanceMode(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/usr/share/nginx/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/usr/share/nginx/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 466: Sabre\Event\EventEmitter->emit('beforeMethod', Array)
/usr/share/nginx/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/usr/share/nginx/html/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/usr/share/nginx/html/nextcloud/remote.php - line 165: require_once('/usr/share/ngin...')
{main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php $CONFIG = array ( 'instanceid' => 'instanceidislong', 'passwordsalt' => 'passwordsensitive', 'secret' => 'mysecretreplaced', 'trusted_domains' => array ( 0 => 'webserver.ddns.net', 1 => '192.168.1.252', ), 'datadirectory' => '/nextcloud/data', 'overwrite.cli.url' => 'https://webserver.ddns.net', 'dbtype' => 'mysql', 'version' => '11.0.1.2', 'dbname' => 'nextcloud_db', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => 'dbnxtuser', 'dbpassword' => 'thisisnotmypasswd', 'logtimezone' => 'UTC', 'installed' => true, 'mail_smtpmode' => 'php', 'mail_from_address' => 'email4domain', 'mail_domain' => 'DOMAIN.FR', 'mail_smtphost' => 'smtp.DOMAIN.FR', 'mail_smtpport' => '587', 'mail_smtpauthtype' => 'LOGIN', 'mail_smtpauth' => 1, 'maintenance' => false, 'loglevel' => 0, 'mail_smtpsecure' => 'ssl', 'updater.release.channel' => 'stable', ); The output of your Apache/nginx/system log in `/var/log/____`: access.log 192.168.1.13 - caroline [16/Feb/2017:17:08:38 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 420 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.10 - ben [16/Feb/2017:17:09:00 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 420 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.27 - - [16/Feb/2017:17:09:03 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0" "-" 192.168.1.13 - caroline [16/Feb/2017:17:11:09 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 420 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.10 - ben [16/Feb/2017:17:11:30 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 420 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.27 - - [16/Feb/2017:17:11:31 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 509 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0" "-" 192.168.1.13 - caroline [16/Feb/2017:17:11:39 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 420 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.10 - ben [16/Feb/2017:17:11:59 +0100] "GET /ocs/v2.php/apps/notifications/api/v1/notifications?format=json HTTP/1.1" 200 447 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.10 - ben [16/Feb/2017:17:12:00 +0100] "PROPFIND /remote.php/webdav/ HTTP/1.1" 207 420 "-" "Mozilla/5.0 (Windows) mirall/2.2.4 (build 2) (Nextcloud)" "-" 192.168.1.27 - - [16/Feb/2017:17:12:01 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 509 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0" "-"

Tried repair but get error :
sudo -u nginx php occ maintenance:mode --on
sudo -u nginx php occ maintenance:repair
Nextcloud is in maintenance mode - no apps have been loaded
Failed to load repair step for dav: Repair step ‘OCA\DAV\Migration\FixBirthdayCalendarComponent’ is unknown
Failed to load repair step for dav: Repair step ‘OCA\DAV\Migration\ValueFixInsert’ is unknown

  • Repair MySQL collation
  • Repair mime types
  • Repair legacy storages
  • Remove asset cache
    • Asset cache cleared.
  • Generate ETags for file where no ETag is present.
    • ETags have been fixed for 0 files/folders.
  • Clean tags and favorites
    • 0 tags of deleted users have been removed.
    • 0 tags for delete files have been removed.
    • 0 tag entries for deleted tags have been removed.
    • 0 tags with no entries have been removed.
  • Drop old database tables
    31/31 [============================] 100%
  • Drop old background jobs
  • Remove getetag entries in properties table
    • Removed 0 unneeded “{DAV:}getetag” entries from properties table.
  • Repair outdated OCS IDs
  • Repair invalid shares
  • Remove old share propagation app entries
  • Remove old (< 9.0) calendar/contact shares
    4/4 [============================] 100%
  • Fix permissions so avatars can be stored again
    2/2 [============================] 100%
  • Remove shares of a users root folder
  • Repair unmerged shares
  • Move .step file of updater to backup location
  • Add move avatar background job
    • Repair step already executed
  • Add preview cleanup background jobs
  • Fix potential broken mount points
    • No mounts updated

sudo -u nginx php occ maintenance:mode --off

Did you try the occ-command to turn maintenance mode off? Or via config/config.php?

Hello,

Thanks for your message. Yes I’ve tried and there is no error. Steps for DAV repair are in error, non exists.
So maintenance mode is on only for addon named Sabre/Dav.
How can we debug?

Regards,

I’ve analysed more, seems that unix like connexion system work better than windows:
I’ve got this warning with CarotDAV. Is there any bug with nextcloud addon sabre/Client.php ?

Rei.Fs.SimpleWebException: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
at Rei.Fs.Webdav.WebdavFs.GetResponse(HttpWebRequest request, Boolean notreqstream)
at Rei.Fs.Webdav.WebdavFs.InnerOpenRead(Uri target, Int64& start, Int64& length)
at Rei.Fs.Webdav.WebdavFs.OpenRead(ResourceId id, Int64& start, Int64& length)
at CarotDAV.OleStream.IStreamRead(Byte[] pv, Int32 cb, IntPtr pcbRead)

It is probably better you report your problem to the bugtracker, the developers there have a much deeper insight into all the code and can better help you in debugging this problem. You can also try to reach somebody via IRC and point them to this topic.