core icon indicating copy to clipboard operation
core copied to clipboard

Fatal error when \OC\Files\Filesystem::resolvePath does not return a storage object.

Open landure opened this issue 13 years ago • 22 comments

This PHP error appear during file cache update, and it break the cache update:

Mar 15 11:02:06 php5 www: PHP Fatal error: Call to a member function getId() on a non-object in /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php on line 121 Mar 15 11:02:06 php5 www: PHP Stack trace: Mar 15 11:02:06 php5 www: PHP 1. {main}() /opt/owncloud/cloud.biapy.fr/index.php:0 Mar 15 11:02:06 php5 www: PHP 2. OC::handleRequest() /opt/owncloud/cloud.biapy.fr/index.php:28 Mar 15 11:02:06 php5 www: PHP 3. OC_Router->match() /opt/owncloud/cloud.biapy.fr/lib/base.php:606 Mar 15 11:02:06 php5 www: PHP 4. call_user_func() /opt/owncloud/cloud.biapy.fr/lib/router.php:127 Mar 15 11:02:06 php5 www: PHP 5. OC::loadAppScriptFile() /opt/owncloud/cloud.biapy.fr/lib/router.php:127 Mar 15 11:02:06 php5 www: PHP 6. require_once() /opt/owncloud/cloud.biapy.fr/lib/base.php:672 Mar 15 11:02:06 php5 www: PHP 7. OC\Files\Cache\Upgrade->upgradePath() /var/lib/owncloud/cloud.biapy.fr/apps/files/ajax/upgrade.php:17 Mar 15 11:02:06 php5 www: PHP 8. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:44 Mar 15 11:02:06 php5 www: PHP 9. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 10. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 11. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 12. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 13. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 14. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 15. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 16. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 17. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 18. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 19. OC\Files\Cache\Upgrade->upgradeChilds() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:58 Mar 15 11:02:06 php5 www: PHP 20. OC\Files\Cache\Upgrade->getNewData() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:54 Mar 15 11:02:06 php5 www: PHP 21. OC\Files\Cache\Upgrade->getNumericId() /opt/owncloud/cloud.biapy.fr/lib/files/cache/upgrade.php:105

I'm investigating the trigger conditions.

landure avatar Mar 15 '13 13:03 landure

@icewind1991

karlitschek avatar Mar 15 '13 14:03 karlitschek

This totally stops owncloud from working. I'm using nginx in front of it, and the "trick" in https://github.com/owncloud/core/issues/2300#issuecomment-14950005 does not work.

Glandos avatar Mar 15 '13 18:03 Glandos

Same problem here, with Fedora 17 and apache.

sciurius avatar Mar 15 '13 20:03 sciurius

debian squeeze/apache/mysql upgrade from 4.5.7 to 5.0 first got maintenance mode... which when turned to false in config.php leads to ... "upgrading filesystem cache" for files
stops permanently on this screen.

log shows... Error core storage backend \OC\Files\Storage\Archive not found March 16, 2013 18:17 Error core storage backend \OC\Files\Storage\Archive not found March 16, 2013 18:17 Error core storage backend \OC\Files\Storage\Archive not found March 16, 2013 18:17 Error core storage backend \OC\Files\Storage\Archive not found March 16, 2013 18:17 Fatal PHP Call to a member function getId() on a non-object at /var/www/clients/client4/web23/web/lib/files/cache/upgrade.php#121 ...etc

Any further info which might help just send me a message and I'll be glad to supply whatever needed to help diagnose this.

Cheers.

teoverton avatar Mar 16 '13 17:03 teoverton

Do you have external storage mounted?

Can you investigate what path is not returning a storage object. It appears from your backtrace that the file cache was properly upgraded for a few paths.

MTGap avatar Mar 16 '13 17:03 MTGap

MTGap, Hi, I have no external storage mounted if that is relevant, but I think you were asking the original poster? Thomas

teoverton avatar Mar 16 '13 17:03 teoverton

@MTGap,

no, i've got no external storage mounted. My server is divided in / and /var partitions, but it is all. I have not been able to reproduce the error and determine witch file trigger the problem.

landure avatar Mar 16 '13 17:03 landure

I can confirm that disabling the Archive application fix the cache update problem.

landure avatar Mar 16 '13 17:03 landure

Hot damn, disabled archive app as suggested in previous comment and the upgrade completed. I am now seeing what re-enabling archive does. Thanks.

Cheers.

teoverton avatar Mar 16 '13 17:03 teoverton

Thanks guys, I'm testing the upgrade now with archive enabled.

Update: I can reproduce this.

MTGap avatar Mar 16 '13 17:03 MTGap

Well it is failing because files_archive was not packaged with ownCloud 5 and so the old app is still on your instances and breaking your upgrades.

@karlitschek Why wasn't it packaged?

MTGap avatar Mar 16 '13 18:03 MTGap

I have got the same problem - I reinstalled files_archive from a backup, tried to enable and disable it again, deleted the files_archive folder from the apps-folder - Nothing happened. The problem still exists.

eingemaischt avatar Mar 16 '13 18:03 eingemaischt

The upgrade.php file in Pull Request #2383 doesn't work either. The problem is away, sure; but I can't see me files....

Edit: The error says that I don't have write permissions...

eingemaischt avatar Mar 16 '13 18:03 eingemaischt

@TeGuy Notice #2383 said error handling, not fix.

Sounds like you have a different issue then this, maybe #2086

MTGap avatar Mar 16 '13 18:03 MTGap

the upgrade to php5 worked fine, even with the original upgrade.php

If you are using Ubuntu 10.04 LTS you have to upgrade php5 - this is really weak for owncloud....

eingemaischt avatar Mar 16 '13 18:03 eingemaischt

MTGap, Thanks mate. Cheers.

teoverton avatar Mar 16 '13 23:03 teoverton

@MTGap We have ongoing quality problems and bugs with files_archive so we decided to go without it for now. The normal way to update is to replace ownCloud but keep only config and data so an old version should be removed. And even if the old files_archive is still there then ownCloud should disable it during upgrade automatically. At least in theory. If this is the problem here then we have to build a workaround somehow for 5.0.1 Any ideas?

karlitschek avatar Mar 16 '13 23:03 karlitschek

Once again: There seems to be two different bugs with the same error: On the one hand an activated old files_archive-module - on the other hand the problem with PHP 5.3 on Ubuntu 10.04 LTS

eingemaischt avatar Mar 16 '13 23:03 eingemaischt

@TeGuy The Ubuntu 10.04 issue was discussed over here #2310

@karlitschek The app version compatibility check was changed just recently #1903 #1888 I think we only have minimum version checking right now. Quick fix is shipping a changed app.php file with a bogus version for required.

MTGap avatar Mar 17 '13 00:03 MTGap

"Ubuntu 10.04" is incorrect. I have the same problem on 12.04:

"PHP Fatal error: Call to a member function getId() on a non-object in ..."

I have read tons of googlets but couldn't find a solution. What to do?

deplonix avatar Mar 17 '13 20:03 deplonix