owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.38k stars 2.05k forks source link

Weird: ownCloud 8.2.2 with PHP 7.0.1 unstable / unusable - read on #21352

Closed timreeves closed 8 years ago

timreeves commented 8 years ago

I'm just migrating to a new server and wanted the fastest, most modern possible setup - and ended up losing nearly 2 long days work. Put shortly: ownCloud 8.2.2 plus self-compiled PHP 7.0.1 using opcache and redis via Nginx and FPM, but w/o encryption or file locking, does not work for me. A fallback to self-compiled PHP 5.6.16 - with NOTHING else changed - works fine. More specifically: The GUI of OC always worked with both PHP versions, the problems were always with the WebDAV side (everything WebDAV - OC client, Contacts, Calendars).

Steps to reproduce

  1. Compile your own versions of 5.6.16 and 7.0.1
  2. For 7.0.1 get redis here
  3. Upgrade your (well-filled) ownCloud to 8.2.2
  4. Try using PHP 7 and PHP 56 as FPM provider

    Expected behaviour

Fast and stable with PHP7 too

Actual behaviour

The GUI side of OC always worked with PHP7. But all attempts to connect on the WebDAV side to OC 8.2.1 never worked: _Exception: {"Message":"HTTP\/1.1 401 No basic authentication headers were found","Exception":"Sabre\DAV\Exception\NotAuthenticated","Code":0,"Trace":"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/lib\/private\/connector\/sabre\/auth.php(154): Sabre\DAV\Auth\Backend\AbstractBasic->authenticate(Object(OC\Connector\Sabre\Server), 'ownCloud')\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/lib\/private\/connector\/sabre\/auth.php(127): OC\Connector\Sabre\Auth->auth(Object(OC\Connector\Sabre\Server), 'ownCloud')\n#2 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php(118): OC\Connector\Sabre\Auth->authenticate(Object(OC\Connector\Sabre\Server), 'ownCloud')\n#3 [internal function]: Sabre\DAV\Auth\Plugin->beforeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#4 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#5 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(456): Sabre\Event\EventEmitter->emit('beforeMethod', Array)\n#6 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#7 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/files\/appinfo\/remote.php(55): Sabre\DAV\Server->exec()\n#8 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/remote.php(137): requireonce('\/var\/www\/vhosts...')\n#9 {main}","File":"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Backend\/AbstractBasic.php","Line":70} So first I suspected my Nginx-Config on the new server, but could find no problem. And then found it worked fine when falling back to PHP 5.6.16. Then the news came that 8.2.2 was out. I did the upgrade and tried with PHP7 again - and this is the crazy thing - initially it worked fine, and I was over the moon. My ownCloud client (2.1.0 Windows) synced all my (many) files with the server, Thunderbird found it's new calendars and contacts (new in the sense that in my migration I'm using a different domain, but the data in the DB remain the same). INSANELY FAST. So then I started reconnecting to the new URL on other accounts and devices, and in the space of about an hour there was an ever-increasing error rate (sync fails, then connection fails), until it got to the point that I could not connect via WebDAV in any way. Crazier, there are only a very few log entries about the errors (see below). And the GUI was still working fine... In desperation I fell back to PHP 5.6.16 - everything fine, rock steady.

Server configuration

Operating system: Ubuntu 14.04.3 LTS (all packages up to date)

Web server: Nginx 1.9.4 built with OpenSSL 1.0.1f 6 Jan 2014

Database: MySQL

PHP version: 7.0.1 (fails) / 5.6.16 (works)

ownCloud version: 8.2.2

Updated from an older ownCloud or fresh install: from 8.2.1

List of activated apps: Enabled:

The content of config/config.php: "system": { "instanceid": "oc9765749522", "passwordsalt": "_REMOVED SENSITIVE VALUE_", "trusteddomains": [ "owncloud.reeves.one" ], "datadirectory": "\/var\/www\/vhosts\/reeves.one\/oc-data", "dbtype": "mysql", "version": "8.2.2.2", "dbname": "ocreevesone", "dbhost": "localhost", "dbtableprefix": "oc", "dbuser": "_REMOVED SENSITIVE VALUE_", "dbpassword": "_REMOVED SENSITIVE VALUE_", "installed": true, "loglevel": "2", "forcessl": true, "theme": "", "maintenance": false, "mail_from_address": "tim", "mail_smtpmode": "sendmail", "mail_domain": "reeves.one", "default_language": "en", "secret": "_REMOVED SENSITIVE VALUE_", "preview_libreoffice_path": "\/usr\/bin\/libreoffice", "log_rotate_size": 10485760, "check_for_working_htaccess": false, "memcache.local": "\OC\Memcache\Redis", "filelocking.enabled": "true", "memcache.locking": "\OC\Memcache\Redis", "redis": { "host": "\/var\/run\/redis\/redis.sock", "port": 0, "timeout": 0, "dbindex": 1 }, "trashbin_retention_obligation": "auto" }

Are you using external storage, if yes which one: No.

Are you using encryption: No

Are you using an external user-backend, if yes which one: No.

Nginx configuration (embedded in Plesk)

set $sockname reeves.one;

Plesk Web Server settings:

NO PHP support

Smart static files processing = Nein

Serve static files directly by nginx = Nein

if ($server_port = 80) { rewrite ^ https://$server_name$request_uri? permanent; }

charset utf-8;

Add headers to serve security related headers

add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; add_header X-Content-Type-Options nosniff; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none;

error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php;

client_max_body_size 10G;

fastcgi_buffers 64 4K;

error_log /var/log/nginx/error.log debug;

location = /robots.txt { allow all; log_not_found off; access_log off; } location = /nginx-for-own-phpfpm-owncloud.conf { deny all; return 404; }

location ~ ^/(?:.|3rdparty|config|console|db_structure|indie|lib|occ|templates).* { deny all; return 404; }

ownCloud 8 nutzt PATH-INFO to .js and .php, e.g. /index.php/core/js/oc.js,

/index.php/core/ajax/share.php, /index.php/apps/files/ajax/list.php, /index.php/avatar/TimReeves/128

PHP-Handling: Best of Plesk and ownCloud and Web-Forum articles

A match here pre-empts Plesk's "location /", sends the script to PHP-FPM

"(?U)" sets internal "ungreedy" option, i.e. to FIRST ".php" - NEED THIS HERE for PATH-INFO requests

location ~ ^((?U).+?.php)(/.*)?$ { fastcgi_split_path_info ^((?U).+.php)(/?.+)$; set $path_info $fastcgi_path_info;

Requested PHP Scripts MUST exist exactly as named

try_files $fastcgi_script_name =404;

try_files has emptied $fastcgi_path_info

fastcgi_param PATH_INFO $path_info;

Tell Nginx to pass authorization headers

fastcgi_pass_header Authorization;

Avoid sending the security headers twice

fastcgi_param modHeadersAvailable true;

You can add any application-special headers to $_SERVER here

fastcgi_param PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; fastcgi_pass "unix:/usr/local/$sockname.sock";

TR: Sets SCRIPT_FILENAME as $document_root$fastcgi_script_name

TR: Meaning that $fastcgi_script_name MUST be correct now!

include /etc/nginx/fastcgi.conf;

access_log off;

}

The "generic" handling of static resources

Note that they are all formulated securely with "try_files".

Frequent possibly modified content valid 1 day in Cache

location ~* .(js|css|htm|html|xhtml|xml|json)$ { try_files $uri =404; expires 1d; add_header Pragma public; add_header Cache-Control public; access_log off;

add_header Debug Frequent;

}

Pics and Fonts valid 30 Days in Cache

location ~* .(png|jpg|jpeg|gif|ico|bmp|img|ttf|otf|eot|svg|svgz|woff)$ { try_files $uri =404; expires 30d; add_header Pragma public; add_header Cache-Control public; access_log off;

add_header Debug PicFont;

}

Zips + PDF valid 2 weeks in Cache

location ~* .(bz2|exe|gz|pdf|rar|tgz|zip)$ { try_files $uri =404; expires 2w; add_header Pragma public; add_header Cache-Control public; access_log off;

add_header Debug ZipPDF;

}

Media files (large) valid 1 week in Cache

location ~* .(ac3|avi|flv|iso|mp3|mp4|mpeg|mpg|ogg|qt|rm|swf|wav)$ { try_files $uri =404; expires 1w; add_header Pragma public; add_header Cache-Control public; access_log off;

add_header Debug Media;

}

Infrequent possibly modified content valid 3 days in Cache

location ~* .(dat|doc|docx|dts|ppt|pptx|tar|txt|xls|xlsx)$ { try_files $uri =404; expires 3d; add_header Pragma public; add_header Cache-Control public; access_log off;

add_header Debug Infrequent;

}

location = /fpmstatus { fastcgi_pass "unix:/usr/local/$sockname.sock"; include /etc/nginx/fastcgi.conf; } location = /fpmping { fastcgi_pass "unix:/usr/local/$sockname.sock"; include /etc/nginx/fastcgi.conf; }

Virtually nothing should arrive here: We've already (hopefully) done any

special protected / allowed locations, all ".php" scripts, all static assets.

location ~* /$ { index index.php; }

location ~ ^/.+ { rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

Allow the unrecognised type to be a file or directory, redirect all else to /index.php

try_files $uri $uri/ /index.php;

Let this be logged – we want to know of anything untoward!

}

Finally, switch gzipping on

gzip on; gzip_proxied any; gzip_min_length 100; gzip_buffers 8 16k; # number size, default 32 4k|16 8k gzip_types text/css text/plain text/javascript application/javascript application/json application/x-javascript application/xml application/xml+rss application/xhtml+xml application/x-font-ttf application/x-font-opentype application/vnd.ms-fontobject image/svg+xml image/x-icon application/rss+xml application/atom_xml; gzip_vary on; gzip_comp_level 9; gzip_http_version 1.0; gzip_disable "MSIE [1-6].(?!.*SV1)";

PHP Compilation

PHP 7.0.1

export CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe" ./configure --prefix=/usr/local/php701 --with-pic --disable-debug --disable-phpdbg --disable-rpath --without-mm --without-gdbm --without-sqlite3 --without-pdo-sqlite --without-readline --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-iconv --with-libxml-dir=/usr --enable-mbstring --enable-xmlreader=/usr --enable-xmlwriter=/usr --enable-zip --with-zlib --with-zlib-dir=/usr --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql --with-curl=/usr --enable-fileinfo=/usr --with-bz2=/usr --enable-intl=/usr --with-icu-dir=/usr --with-mcrypt=/usr --enable-exif --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-openssl --enable-sockets --enable-calendar --enable-ftp --enable-pcntl --with-gettext --with-gmp=shared --enable-bcmath=shared --enable-soap=shared --with-ldap=shared --with-tidy=shared --with-xmlrpc=shared --with-xsl=shared --with-imap=shared --with-kerberos --with-imap-ssl --with-unixODBC=shared,/usr --with-pdo-odbc=shared,unixODBC,/usr --enable-fpm --with-fpm-user=root --with-fpm-group=root --enable-zend-signals

PHP 5.6.16

export CFLAGS="-march=native -O2 -fomit-frame-pointer -pipe" ./configure --prefix=/usr/local/php5616 --with-pic --disable-debug --disable-rpath --without-mm --without-gdbm --without-t1lib --without-sqlite3 --without-pdo-sqlite --without-readline --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-iconv --with-libxml-dir=/usr --enable-mbstring --enable-xmlreader=/usr --enable-xmlwriter=/usr --enable-zip --with-zlib --with-zlib-dir=/usr --with-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql --with-curl=/usr --enable-fileinfo=/usr --with-bz2=/usr --enable-intl=/usr --with-icu-dir=/usr --with-mcrypt=/usr --enable-exif --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-openssl --enable-opcache --enable-sockets --enable-calendar --enable-ftp --enable-pcntl --with-gettext --with-gmp=shared --enable-bcmath=shared --enable-soap=shared --with-ldap=shared --with-tidy=shared --with-xmlrpc=shared --with-xsl=shared --with-imap=shared --with-kerberos --with-imap-ssl --with-unixODBC=shared,/usr --with-pdo-odbc=shared,unixODBC,/usr --enable-fpm --with-fpm-user=root --with-fpm-group=root

Logs

Web server error log

[22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "NOTICE: PHP message: PHP Warning: spl_autoload(): open_basedir restriction in effect. File(ocp/lock/ilockingprovider.inc) is not within the allowed path(s): (/var/www/vhosts/reeves.one/:/tmp/:/dev/urandom:/var/run/redis:/home/timbackup) in /var/www/vhosts/reeves.one/owncloud.reeves.one/lib/private/files/view.php on line 1055" [22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "NOTICE: PHP message: PHP Warning: spl_autoload(): open_basedir restriction in effect. File(ocp/lock/ilockingprovider.php) is not within the allowed path(s): (/var/www/vhosts/reeves.one/:/tmp/:/dev/urandom:/var/run/redis:/home/timbackup) in /var/www/vhosts/reeves.one/owncloud.reeves.one/lib/private/files/view.php on line 1055" [22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught LogicException: Class OCP\Lock\ILockingProvider could not be loaded in /var/www/vhosts/reeves.one/owncloud.reeves.one/lib/private/files/view.php:1055" [22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "Stack trace:"

[22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "#1 /var/www/vhosts/reeves.one/owncloud.reeves.one/lib/private/files/view.php(1055): spl_autoload_call('OCP\Lock\ILocki...')"

[22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "#3 /var/www/vhosts/reeves.one/owncloud.reeves.one/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(106): call_user_func(Object(Closure))"

[22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: "#5 {main}" [22-Dec-2015 22:34:54] WARNING: [pool reeves.one] child 17409 said into stderr: " thrown in /var/www/vhosts/reeves.one/owncloud.reeves.one/lib/private/files/view.php on line 1055"

ownCloud log (data/owncloud.log)

{"reqId":"4ZTkfC4czdaTjJS\/1u8U","remoteAddr":"188.192.9.177","app":"PHP","message":"Array to string conversion at \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/lib\/private\/template\/functions.php#36","level":3,"time":"2015-12-22T22:35:34+00:00"}

{"reqId":"EOTvgVd8beXzy/8AOgWJ","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line":472}","level":4,"time":"2015-12-22T22:48:52+00:00"}

{"reqId":"k8XkCNqFAFng4cmcybbk","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line\":472}","level":4,"time":"2015-12-22T22:50:43+00:00"}

{"reqId":"2WurYbASR3ICYsJRseCC","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line":472}","level":4,"time":"2015-12-22T22:53:19+00:00"}

{"reqId":"RpEP3nSMLS/A4kOjcj6a","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line\":472}","level":4,"time":"2015-12-22T23:09:03+00:00"}

{"reqId":"a1nIGiFs6b58iNEUn6j6","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhosts \/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line\":472}","level":4,"time":"2015-12-22T23:09:38+00:00"}

{"reqId":"IqTAdrNl/fMve8YKSYhr","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhost s\/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line\":472}","level":4,"time":"2015-12-22T23:11:38+00:00"}

{"reqId":"7XgdLB8kAIJ85xu6H5xK","remoteAddr":"188.192.9.177","app":"caldav","message":"Exception: {\"Message\":\"HTTP\/1.1 501 There was no handler found for this \"GET\" method\",\"Exception\":\"Sabre\DAV\Exception\NotImplemented\",\"Code\":0,\"Trace\":\"#0 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/apps\/calendar\/appinfo\/remote.php(60): Sabre\DAV\Server->exec()\n#2 \/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/remote.php(137): require_once('\/var\/www\/vhosts...')\n#3 {main}\",\"File\":\"\/var\/www\/vhosts\/reeves.one\/owncloud.reeves.one\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php\",\"Line\":472}","level":4,"time":"2015-12-22T23:19:15+00:00"}

My Ideas

Is ownCloud or PHP7 itself causing the problems?

PVince81 commented 8 years ago

@LukasReschke @DeepDiver1975 @danimo @icewind1991

PVince81 commented 8 years ago

@timreeves ownCloud and Webdav should work fine with PHP 7 (we have a running instance and syncing works, but I don't know the tech details or versions). So I don't think it's a problem with Sabre.

@timreeves regarding the "no handler for GET method", it looks like Sabre is not getting the correct URL / base path. Do you have a reverse proxy ? Maybe double check your "overwrite*" settings in config.php ? Not sure if there's a difference there between PHP versions.

danimo commented 8 years ago

Hint: Generally, I'd strongly advise against disabling locking. Using redis this becomes reasonably fast. I have a Setup with PHP 7.0.0 (still), redis and APCu and everything works as expected.

timreeves commented 8 years ago

@PVince81 Thanks for looking at it! My config is included above. I've taken a closer look at the error message about "There was no handler found for this "GET" method": The core of it seems to be: SabreDAVServer->invokeMethod(Object(SabreHTTPRequest), Object(SabreHTTPResponse)) at which I'm scuppered, as the trace does not include the actual request object passed.

I'm not using overwrite settings in my config.php - I see them in the sample, what you mean - but I don't want to "cheat" - if there is a bug or a problem with my config/setup, I'd rather find it. A documented fix or bug is more help to the rest of the community.

Re Reverse Proxy: Yes, I'm using Nginx. And not (as Plesk would have) in front of Apache. I use an own config, see above, which passes PHP requests directly to the PHP-FPM socket (and delivers everything else directly too, Apache is never consulted). During looking for the problem I found the tip to use "fastcgi_pass_header Authorization;" which I added - although before it always worked without that - but adding ti did not help.

timreeves commented 8 years ago

@danimo Thanks for the hint! In fact, looking again at my config, I am in fact using file locking (although only two of us use this OC, and hardly ever working on the same files) - perhaps I turned it off during testing to elimante it as a possible cause. I'm intrigued that you use redis AND APCu - I assume the former for locking and the latter as userland cache. I'm using the PHP7 branch of phpRedis, and I assume you mean the master branch of APCu (the previous "seven" branch seems to have been integrated to the master). Do you see a significant advantage of APCu over redis as userland cache? Or did you just want to separate the two usages? Anyway, I recompiled my php7 redis today from the current version of that branch, just to be sure. Still no joy with PHP7.

danimo commented 8 years ago

I'm intrigued that you use redis AND APCu - I assume the former for locking and the latter as userland cache. I'm using the PHP7 branch of phpRedis, and I assume you mean the master branch of APCu (the previous "seven" branch seems to have been integrated to the master).

Yes and yes, see https://build.opensuse.org/project/show/home:danimo:php7

Do you see a significant advantage of APCu over redis as userland cache? Or did you just want to separate the two usages?

@timreeves I don't have hard benchmarks, but according to developers (and by logic, because it's in-process) ACPu should faster than redis for user caching, and should be preferred in non-cluster scenarios.

timreeves commented 8 years ago

OK, so first I pored over my PHP7 compilation configuration, and made some changes, inspired by the way Plesk compiles it's version of PHP7 (which I can't use "as is", it misses some vital modules). Now mine is compiled like this:

./configure --prefix=/usr/local/php701 --with-pic --disable-debug --disable-phpdbg --disable-rpath --without-mm --without-gdbm --without-sqlite3 --without-pdo-sqlite --without-readline --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --with-iconv --enable-mbstring --enable-xmlwriter=/usr --with-libxml-dir=/usr --enable-zip --with-zlib --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql --with-curl=/usr --enable-fileinfo=/usr --with-bz2=/usr --enable-intl=/usr --with-icu-dir=/usr --with-mcrypt=/usr --enable-exif --with-openssl --enable-sockets --enable-calendar --enable-ftp --enable-pcntl --with-gettext --with-gmp=shared --enable-bcmath=shared --enable-soap=shared --with-ldap=shared --with-tidy=shared --with-xmlrpc=shared --with-xsl=shared --with-imap=shared --with-kerberos --with-imap-ssl --enable-fpm --with-fpm-user=root --with-fpm-group=root --disable-cgi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-layout=GNU --without-pear --with-bz2 --with-pcre-regex --disable-dba --without-unixODBC --disable-phar build_alias=x86_64-linux-gnu host_alias=x86_64-linux-gnu

Still no joy. I followed the troubleshooting guide and could authenticate no problem at /remote.php/webdav via the browser. Then I captured the client log of the client failing to connect from a linux PC:

OC-Client-Log-Linux-Nginx.txt

So the WebDAV authentication is failing - but with exactly the same credentials as worked previously, and still work via the browser.

I thought maybe this is an issue with Nginx. I can't completely circumnavigate Nginx without a major disruption to my server, which serves a number of domains and all configured to use Nginx. Since I'm using Plesk I did the next best thing - passing the request through to Apache, and Apache passes PHP on to FPM. But that only made things worse: At the GUI still "All checks passed", but WebDAV Authentication failing consistently:

OC-Client-Log-Windows-Apache.txt

And from the browser: {d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"} {s:exception}Sabre\DAV\Exception\NotAuthenticated}{/s:exception} {s:message}No basic authentication headers were found>{/s:message} {/d:error}

So maybe it is an issue with Nginx - but then howcome it all works with PHP 5.6.16? Another idea: My last (virtual) server had only 1 vcore, the new one has 4 - could there be a race condition?

Looks like I'll be falling back to 5.6.16...

timreeves commented 8 years ago

Could "security.limit_extensions = .php .php5 .inc" in the fpm pool config create any problems?

timreeves commented 8 years ago

I noticed a typo in the current config.sample.php: 'memcache.locking' => '\OC\Memcache\Redis', i.e. a doubling-up of the namespace separators. I had copied this to my config.php, so I corrected that, but it made no difference to the sporadic problems with PHP7.

timreeves commented 8 years ago

Finally, I migrated local caching to APCu as Daniel suggested - both on 5.6.16 (works fine) and 7.0.1. But that also did'nt solve my problem, here is a typical log entry section using 7.0.1 where the OC client loses the connection in the middle of working:

12-28 13:12:07:411 0x4d37b08 OCC::SocketApi::command_RETRIEVE_FILE_STATUS: void OCC::SocketApi::command_RETRIEVE_FILESTATUS(const QString&, QIODevice) "C:\HIDDEN" 12-28 13:12:07:412 0x4d37b08 OCC::SocketApi::sendMessage: SocketApi: Sending message: "STATUS:OK:C:\HIDDEN" 12-28 13:12:07:476 0x88c7e08 unknown: void QHttpNetworkConnectionChannel::_qerror(QAbstractSocket::SocketError) QAbstractSocket::RemoteHostClosedError QSslSocket(0xb4c0640) QHttpNetworkReply(0xd915ca8) 0 false 3 8 QAbstractSocket::ConnectedState 12-28 13:12:07:476 0x88c7e08 unknown: ERRORING CURRENT QHttpNetworkReply(0xd915ca8) QUrl( "https://owncloud.HIDDEN/remote.php/webdav/" ) 12-28 13:12:07:533 0x4d37b08 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() 2 "Verbindung beendet" QVariant(Invalid) 12-28 13:12:07:534 0x4d37b08 OCC::AccountSettings::showConnectionLabel: "Keine Verbindung zu ownCloud auf https://owncloud.HIDDEN Verbindung beendet" 12-28 13:12:07:539 0x4d37b08 OCC::FolderMan::slotAccountStateChanged: Account "TimReeves@owncloud.HIDDEN" disconnected, terminating or descheduling sync folders 12-28 13:12:07:541 0x4d37b08 OCC::PropfindJob::finished: PROPFIND request *not successful, http result code is 0 "" 12-28 13:12:07:476 0x88c7e08 unknown: void QHttpNetworkConnectionChannel::_q_disconnected() 0 QSslSocket(0xb4c0640) QObject(0x0) 0 false 3 16 12-28 13:12:07:594 0x4d37b08 OCC::SocketApi::command_RETRIEVE_FILE_STATUS: void OCC::SocketApi::command_RETRIEVE_FILE_STATUS(const QString&, QIODevice*) "C:\HIDDEN" 12-28 13:12:07:595 0x4d37b08 OCC::SocketApi::sendMessage: SocketApi: Sending message: "STATUS:OK:C:\HIDDEN"

A note to those wanting APCu for PHP7: Krakjoe has moved the backward compatibility stuff out to an own repository - you need to compile that too as well as the APCu Master itself - and load apcu.so before apc.so

A request to OC dev: Please test for APCu, not APC - then we won't need to load the backward compatibility module (currently OC does not start up if PHP7 apc.so is missing).

For now I must stick with 5.6.16 - and do some urgent work for clients!

LukasReschke commented 8 years ago

A request to OC dev: Please test for APCu, not APC - then we won't need to load the backward compatibility module (currently OC does not start up if PHP7 apc.so is missing).

Already fixed for 9.0 at https://github.com/owncloud/core/pull/21308

timreeves commented 8 years ago

This problem is driving me nuts! I have tried

ALWAYS the same problem: Connecting via WebDAV.

@skjnldsv I think this is indeed probably the same problem, as I use PHP7 with WordPress and the OC GUI it works fine, as you also noted.

Here an excerpt from my OC Client Log:

01-10 14:20:41:182 0xa790598 unknown: void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError) QAbstractSocket::RemoteHostClosedError QSslSocket(0xa7ecd48) QHttpNetworkReply(0xc513410) 0 false 3 8 QAbstractSocket::ConnectedState 01-10 14:20:41:182 0xa790598 unknown: ERRORING CURRENT QHttpNetworkReply(0xc513410) QUrl( "https://owncloud.##HIDDEN##/remote.php/webdav/" ) 01-10 14:20:41:185 0x4d77bb0 OCC::AbstractNetworkJob::slotFinished: void OCC::AbstractNetworkJob::slotFinished() 2 "Verbindung beendet" QVariant(Invalid) 01-10 14:20:41:187 0x4d77bb0 OCC::AccountSettings::showConnectionLabel: "Keine Verbindung zu ownCloud auf https://owncloud.##HIDDEN##Verbindung beendet"

And Thunderbird: tb-fehlerkonsole-oc

Again I must fall back to 5.6.16, how disappointing!

timreeves commented 8 years ago

Maybe we need to compare our operating systems? Since some people say it works, some say broken. Mine is Ubuntu 14.04.3 LTS

jkroepke commented 8 years ago

Broken with Ubuntu 14.04/PHP7.0.2.

I use the latest packages from here: https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0

I'm use APCu, too. Filelocking enabled. No Redis configuered. Frontend Server is nginx with fpm.

skjnldsv commented 8 years ago

Same here: Linux 4.3.3-2-ARCH (#21461)

JapSeyz commented 8 years ago

Using Ubuntu 14.04 PHP7.0.2 with Nginx.

timreeves commented 8 years ago

Light has finally shone on this topic, see the latest comments on issue https://github.com/owncloud/core/issues/21461. So closing this here.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.