OC7 files and contacts stopped working after update
After updating to the latest master commit 077a542d59ea5c992ebb1b3ac0e6117f6289582c from I believe it was last weeks commit 70e0ae063739b9749883bd184fee0a80f184685b The website briefly entered maintanance mode, did an update and reported successful. On logging in however I get a blank empty page with both the files and contacts pages. Directly linking to the calendar page looks and behaves like expected.
In the log it gives:
{"app":"PHP","message":"Call to a member function getFileInfo() on a non-object at \/usr\/share\/owncloud\/lib\/private\/files\/filesystem.php#717","level":3,"time":"June 11, 2014 01:07:35"}
{"app":"PHP","message":"Call to a member function free_space() on a non-object at \/usr\/share\/owncloud\/lib\/private\/files\/filesystem.php#639","level":3,"time":"June 11, 2014 01:08:48"}
Because I saw in my client I also had a permission error I applied the #8901 fix, which fixed that issue but unfortunately did nothing for the web pages.
Server configuration
Operating system: Ubuntu 13.10 Web server: Apache Database: MYSQL PHP version: 5.5.3 ownCloud version: OC7 Updated from an older ownCloud or fresh install: updated List of activated apps: activity calendar contacts documents files files_external files_pdfviewer files_sharing files_texteditor files_trashbin files_versions files_videoviewer firstrunwizard gallery mozilla_sync music notes search_lucene tasks_enhanced user_ldap videos The content of config/config.php:
<?php
$CONFIG = array (
'installed' => true,
'dbtype' => 'mysql',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'forcessl' => true,
'datadirectory' => '/data/owncloud',
'trusted_domains' =>
array (
0 => '***********.nl',
),
'defaultapp' => 'files',
'knowledgebaseenabled' => true,
'appstoreenabled' => true,
'mail_smtpdebug' => false,
'mail_smtptimeout' => 10,
'trashbin_retention_obligation' => 30,
'trashbin_auto_expire' => true,
'allow_user_to_change_display_name' => true,
'updatechecker' => true,
'has_internet_connection' => true,
'check_for_working_webdav' => true,
'check_for_working_htaccess' => true,
'log_type' => 'owncloud',
'logfile' => '/var/log/owncloud.log',
'loglevel' => '3',
'logdateformat' => 'F d, Y H:i:s',
'logtimezone' => 'Europe/Berlin',
'log_query' => true,
'log_authfailip' => true,
'log_rotate_size' => false,
'cron_log' => true,
'remember_login_cookie_lifetime' => 1296000,
'session_lifetime' => 86400,
'session_keepalive' => true,
'maintenance' => false,
'appcodechecker' => true,
'asset-pipeline.enabled' => false,
'filesystem_check_changes' => 1,
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/share/owncloud/apps',
'url' => '/apps',
'writable' => true,
),
),
'preview_libreoffice_path' => '/usr/bin/libreoffice',
'enable_avatars' => true,
'openssl' =>
array (
),
'singleuser' => false,
'instanceid' => 'ocb0e2037d20',
'version' => '6.90.0.4',
'ldapIgnoreNamingRules' => false,
'theme' => '',
);
Are you using external storage, if yes which one: No Are you using encryption: no
Client configuration
Browser: Firefox 29 / Chromium 34 Operating system: Ubuntu 14.04
Any thoughts?
I increased logging to debug and these are the messages given when trying to open the files page:
{"reqId":"53983ab7b702f","app":"core","message":"DB prepare : SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB prepare : SELECT `uid`, `displayname` FROM `oc_users` WHERE LOWER(`uid`) = LOWER(?)","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'remco', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB prepare : SELECT `appid`, `configvalue` FROM `oc_appconfig` WHERE `configkey` = 'installed_version'","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'remco', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'remco', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'remco', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'remco', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB prepare : \n\t\t\tSELECT DISTINCT `configkey`\n\t\t\tFROM `oc_appconfig`\n\t\t\tWHERE `appid` = 'user_ldap'\n\t\t\t\tAND `configkey` LIKE ?\n\t\t AND `configvalue` = '1'","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => '%ldap_configuration_active', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB prepare : \n\t\t\tSELECT DISTINCT `configkey`\n\t\t\tFROM `oc_appconfig`\n\t\t\tWHERE `appid` = 'user_ldap'\n\t\t\t\tAND `configkey` LIKE ?\n\t\t","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => '%ldap_configuration_active', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'remco', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB prepare : SELECT `gid` FROM `oc_groups` WHERE `gid` = ?","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"core","message":"DB execute with arguments : array ( 0 => 'admin', )","level":0,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
{"reqId":"53983ab7b702f","app":"PHP","message":"Call to a member function getFileInfo() on a non-object at \/usr\/share\/owncloud\/lib\/private\/files\/filesystem.php#717","level":3,"time":"June 11, 2014 13:17:11","method":"GET","url":"\/index.php\/apps\/files"}
If I remove line 66 and 67 in the file apps/files/index.php
$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false);
$storageInfo=OC_Helper::getStorageInfo('/', $dirInfo);
my file menu comes back but without any results on all files. Shared files and deleted files are shown like expected.
It is this call that causes:
Call to a member function getFileInfo() on a non-object at \/usr\/share\/owncloud\/lib\/private\/files\/filesystem.php#717 but I do not understand why,
However there looks to be several calls to filesystem.php returning non-object (also on getMimeType) so I think I am not searching at the actual error.
Can anyone give me a suggestion on what could be the root cause of this error so I can try to fix this? (I presume something in the database which did not convert properly when updating but I see nothing suspicious.)
@PVince81 Ok, took me quite some time to find this (mostly due to my inexperience) but some parts are not being initialized anymore in base (or somewhere before they are needed), if I add:
if (!self::checkUpgrade(false)) {
OC_App::loadApps(array('authentication'));
OC_App::loadApps(array('filesystem', 'logging'));
}
to base.php#575 (part of quite an old PR commit f03a3d9 ) everything is working again (most of the web based OC was not working properly anymore).
I am not sure why not everyone is having this problem. It could maybe be that it has something to do with the combination of ldap backend and oc backend. I am using a ldap group mapping for my main user container and local OC groups for specific OC tasks. What I saw was that everytime setupFS was called the username was still empty so no FS was initiated.
I could proceed and make an nasty check if these apps are loaded already and the call these, but probably it should be fixed elsewhere?
There is a bug with routing, see https://github.com/owncloud/core/pull/9047
It seems it's the same basic issue as for #8963
CC @blizzz @LukasReschke
@requist still, kudos for diving that deep into the code :smile:
@requist would you mind testing #9047 and leave your feedback over there?
@PVince81 code reads like a book after a crash course OO, though it's not what I call light reading :confounded: @blizzz I tested #9047 and it fixes this issue. So issue is identified and solution a duplicate, cleaning up this one by closing.