NC not reachable after failed DAV sync

Hello!

I am currently running an Ubuntu 18.04.3 server with NC 16.0.6 and dav 1.9.2. The nginx version is 1.17.5 and php 7.3.11.

I am no longer able to access NC via the web browser nor the desktop sync client. Perhaps the issue is connected to a failed attempt to setup contact sync from my phone using davX5 just before the problems occured.
Utilizing the occ command I have found the following:

occ app:check-code dav
Analysing /var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php
 1 errors
    line 1156: != - is discouraged
Analysing /var/www/nextcloud/apps/dav/lib/CardDAV/PhotoCache.php
 1 errors
    line  143: OC_Image - private class must not be instantiated
Analysing /var/www/nextcloud/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
 1 errors
    line   80: OC_Helper - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Files/BrowserErrorPagePlugin.php
 2 errors
    line   27: OC_Template - private class must not be imported with a use statement
    line   94: OC_Template - private class must not be instantiated
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/BearerAuth.php
 2 errors
    line   64: OC_Util - Static method of private class must not be called
    line   73: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php
 1 errors
    line  227: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php
 1 errors
    line  333: OC_Helper - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php
 8 errors
    line  208: OC_Helper - Static method of private class must not be called
    line  336: OC_Hook - Static method of private class must not be called
    line  341: OC_Hook - Static method of private class must not be called
    line  346: OC_Hook - Static method of private class must not be called
    line  362: OC_Hook - Static method of private class must not be called
    line  366: OC_Hook - Static method of private class must not be called
    line  370: OC_Hook - Static method of private class must not be called
    line  456: OCP\App - Static method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php
 5 errors
    line  124: OC_Util - Static method of private class must not be called
    line  128: OC_Util - Static method of private class must not be called
    line  131: OC_Util - Static method of private class must not be called
    line  236: OC_User - Static method of private class must not be called
    line  239: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/PublicAuth.php
 1 errors
    line   96: OC_User - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v2/remote.php
 1 errors
    line   31: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v2/direct.php
 1 errors
    line   32: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php
 1 errors
    line   37: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php
 4 errors
    line   34: OC_App - Static method of private class must not be called
    line   36: OC_Util - Static method of private class must not be called
    line   85: OC_Util - Static method of private class must not be called
    line   86: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/app.php
 1 errors
    line   30: OC_App - Static method of private class must not be called
App is not compliant

When I experienced problems with other apps in the past I was often able to resolve them by disabling the app, usually allowing me to log back into NC via the web browser. However disabling dav is not possible.

occ app:disable dav
dav can't be disabled.

The nginx error log shows this line:

2019/11/16 10:49:00 [crit] 954#954: *1 connect() to unix:/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: **ip_removed**, server: **server_removed**, request: "PROPFIND /remote.php/dav/files/Felix/Documents/KPS HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "**host_removed**"

Do you have any suggestions how to proceed from here? How can I interpret the errors? Is there a way to “reset” dav?

This is the current dav config:
    "apps": {
        "dav": {
            "buildCalendarSearchIndex": "yes",
            "chunks_migrated": "1",
            "enabled": "yes",
            "generateBirthdayCalendar": "no",
            "installed_version": "1.9.2",
            "regeneratedBirthdayCalendarsForYearFix": "yes",
            "types": "filesystem"
        }
    }

Thanks for your help!

Felix

It’s probably your php-fpm that crashed. You can restart, should be something like service php-fpm start or service php7.2-fpm start.

Don’t forget to check the logs why it crashed (should be in some apache-log or some dedicated php-fpm log, or syslog). In doubt, you can check to enable more specific logging in case it happens again.

Probably the wrong socket is used because nginx complains about php7.2-fpm.sock but php7.3-fpm.sock should be used?

I had restarted php previously without being able to reach NC afterwards. However I did give it another try now and NC is available again:

service php7.2-fpm restart

Thanks a lot for that easy fix :clap:

I’ve also updated to php 7.3.11

In addition my update channel suggested an update to 17.0.1 now, which I performed hoping to get rid of the DAV app check-code errors. However, they have hardly changed.

occ app:check-code dav
Analysing /var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php
 1 errors
    line 1162: != - is discouraged
Analysing /var/www/nextcloud/apps/dav/lib/CardDAV/PhotoCache.php
 1 errors
    line  143: OC_Image - private class must not be instantiated
Analysing /var/www/nextcloud/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
 1 errors
    line  245: == - is discouraged
Analysing /var/www/nextcloud/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
 1 errors
    line   80: OC_Helper - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Files/BrowserErrorPagePlugin.php
 2 errors
    line   27: OC_Template - private class must not be imported with a use statement
    line   94: OC_Template - private class must not be instantiated
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/BearerAuth.php
 2 errors
    line   64: OC_Util - Static method of private class must not be called
    line   73: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php
 1 errors
    line  227: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php
 1 errors
    line  333: OC_Helper - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php
 8 errors
    line  208: OC_Helper - Static method of private class must not be called
    line  336: OC_Hook - Static method of private class must not be called
    line  341: OC_Hook - Static method of private class must not be called
    line  346: OC_Hook - Static method of private class must not be called
    line  362: OC_Hook - Static method of private class must not be called
    line  366: OC_Hook - Static method of private class must not be called
    line  370: OC_Hook - Static method of private class must not be called
    line  456: OCP\App - Static method of deprecated class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php
 5 errors
    line  124: OC_Util - Static method of private class must not be called
    line  128: OC_Util - Static method of private class must not be called
    line  131: OC_Util - Static method of private class must not be called
    line  236: OC_User - Static method of private class must not be called
    line  239: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/lib/Connector/PublicAuth.php
 1 errors
    line   96: OC_User - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v2/remote.php
 1 errors
    line   31: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v2/direct.php
 1 errors
    line   32: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php
 1 errors
    line   37: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php
 4 errors
    line   34: OC_App - Static method of private class must not be called
    line   36: OC_Util - Static method of private class must not be called
    line   85: OC_Util - Static method of private class must not be called
    line   86: OC_Util - Static method of private class must not be called
Analysing /var/www/nextcloud/apps/dav/appinfo/app.php
 1 errors
    line   30: OC_App - Static method of private class must not be called
App is not compliant

I have also realized now, that I get the “app is not compliant” check-code result for several other apps like files. Is this something I should to dig into? The admin page does not show any security or setup warnings.

if you run the occ command, make sure you use the right php version (especially if you have different installed on your computer):

sudo -u www-data php7.3 occ ...

Good point, but it’s also the case with the correct php version.