core icon indicating copy to clipboard operation
core copied to clipboard

Calendar and addressbook sync through webdav broken after upgrading from 6.0.3 to 6.0.4

Open torlasz opened this issue 12 years ago • 13 comments

After I upgraded from 6.0.3 to 6.0.4 everything works as expected except webdav sync of calendars and addressbooks. Syncing of files is ok. The sync client reports: Server error (status code 500). The webserver logs are always the same: [error] [client xx.xx.xx.xx] PHP Fatal error: Call to a member function instanceOfStorage() on a non-object in /var/www/owncloud/lib/private/util.php on line 67

It doesn't matter if I try to sync with a remote calendar or addressbook, the error is the same.

The same error was reported in issue #9424, but it was triggered by accessing a google drive.

This is on RHEL 6.5, mysql-server-5.1.73-3.el6_5.x86_64, httpd-2.2.15-30.el6_5.x86_64, php-5.3.3-27.el6_5.x86_64.

torlasz avatar Jul 07 '14 07:07 torlasz

Hmm strange. Are you able to get a stack trace for that, maybe by enabling XDebug ? (if acceptable on your env).

PVince81 avatar Jul 07 '14 09:07 PVince81

Here you are:

[Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP Fatal error: Call to a member function instanceOfStorage() on a non-object in /var/www/owncloud/lib/private/util.php on line 67 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP Stack trace: [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 1. {main}() /var/www/owncloud/remote.php:0 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 2. require_once() /var/www/owncloud/remote.php:43 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 3. Sabre_DAV_Server->exec() /var/www/owncloud/apps/contacts/appinfo/remote.php:71 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 4. Sabre_DAV_Server->invokeMethod() /var/www/owncloud/3rdparty/Sabre/DAV/Server.php:213 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 5. Sabre_DAV_Server->broadcastEvent() /var/www/owncloud/3rdparty/Sabre/DAV/Server.php:454 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 6. call_user_func_array() /var/www/owncloud/3rdparty/Sabre/DAV/Server.php:432 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 7. Sabre_DAV_Auth_Plugin->beforeMethod() /var/www/owncloud/3rdparty/Sabre/DAV/Server.php:432 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 8. OC_Connector_Sabre_Auth->authenticate() /var/www/owncloud/3rdparty/Sabre/DAV/Auth/Plugin.php:107 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 9. OC_Util::setupFS() /var/www/owncloud/lib/private/connector/sabre/auth.php:78 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 10. OC\Files\Filesystem::addStorageWrapper() /var/www/owncloud/lib/private/util.php:76 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 11. OC\Files\Mount\Mount->wrapStorage() /var/www/owncloud/lib/private/files/filesystem.php:160 [Mon Jul 07 17:41:44 2014] [error] [client xx.xx.xx.xx] PHP 12. {closure}() /var/www/owncloud/lib/private/files/mount/mount.php:146

torlasz avatar Jul 07 '14 15:07 torlasz

Did you set a quota for that user ? Assuming yes from the stack trace.

@icewind1991 do you have an idea in what situation the $storage would be null ?

PVince81 avatar Jul 07 '14 21:07 PVince81

Yes, the quota is set in LDAP. It gets recognized for file sync, it gets reported correctly for the admin and for the user as well. Looks like the problem is quota is not set for certain operations in 6.0.4. The same system with the same setup worked correctly for 6.0.3.

torlasz avatar Jul 08 '14 07:07 torlasz

I can confirm the same issue. It doesn't affect all user, but many. Error log from the web server: 2014/07/09 22:39:35 [error] 20465#0: *40549330 FastCGI sent in stderr: "PHP message: PHP Fatal error: Call to a member function instanceOfStorage() on a non-object in /var/www/oc/lib/private/util.php on line 67" while reading response header from upstream, client: 11.11.11.11, server: example.com, request: "PROPFIND /remote.php/caldav/calendars/user10/defaultcalendar/ HTTP/1.0", upstream: "fastcgi://unix:/var/run/php-fpm/oc.sock:". oC log: {"app":"PHP","message":"Call to a member function instanceOfStorage() on a non-object at /var/www/oc/lib/private/util.php#67","level":3,"time":"2014-07-09T21:00:50+00:00"}

After upgrade to 6.0.4 some users aren't able to sync using Cal or CardDAV. Can you please give this issue priority @PVince81 @karlitschek Thank you!

fossxplorer avatar Jul 09 '14 21:07 fossxplorer

Yes, I saw many people reporting this but still don't understand what combination of circumpstances or in what environment it happens. When I updated my ownCloud to 6.0.4 the syncing worked properly.

Is this specific to FastCGI ? Can we get more info about the environment ?

PVince81 avatar Jul 10 '14 08:07 PVince81

@torlasz can you use the issue template ? Goal is to be able to recreate an environment where the issue happens so we can understand what is causing it. Thanks.

PVince81 avatar Jul 10 '14 08:07 PVince81

Are you using FactCGI / php5-fpm ?

@fossxplorer do you have an env where it happens ?

PVince81 avatar Jul 10 '14 08:07 PVince81

I think I found the problem. I mounted a Google Drive in my owncloud homedir many months ago. At some point (can't remember what version that was) the way to set up a GDrive mount was changed. (In the past all users used the same API key and secret, now everyone has to generate his/her own access codes.) So my Google drive became inaccessible, but I didn't care since that was mainly for testing purposes anyway. I think this defunct settings caused the problem, because after deleting the GDrive mount from my personal settings, suddenly my problem got solved: syncing calendars and addressbooks now works as expected. I recreated a proper GDrive mount according to the new rules, and everything seems to be ok now. I cannot recreate my old defunct GDrive settings, so I cannot really test if that brings back the problem this issue is about, but it looks very much like it would. I hope other users will find my description helpful. I still think it is a bug that a bad user setting about an absolutely different function of owncloud pervents users from using sync of calendars and addressbooks. But it is looks like the problem gets triggered by a personal non functional Gdrive setting. This wasn't a problem in 6.0.3, only in 6.0.4.

torlasz avatar Jul 10 '14 12:07 torlasz

@torlasz awesome findings. Thx a lot. I will try to reproduce it with your findings!

fossxplorer avatar Jul 10 '14 13:07 fossxplorer

I think the issue with that blocking CardDAV/CalDAV is because for every user operation it will internally try and mount the user's filesystem, so if one fails it might block it.

Not sure what can be done here, whether these two calls could work without setupFS.

@icewind1991 what do you think ?

PVince81 avatar Jul 10 '14 13:07 PVince81

any news here?

blizzz avatar Nov 26 '14 15:11 blizzz

Please try again with 7.0.5 or 8.0.2 where setup/mounting is done in a more lazy manner (on-demand), which should fix this too.

If you're still seeing the issue in those versions, feel free to reopen. Thanks.

PVince81 avatar Mar 24 '15 21:03 PVince81