Class 'OC\Cache' not found in /var/www/apps/user_ldap/lib/connection.php

hosting

#1

Steps to reproduce

  1. Execute command: sudo -u www-data php occ upgrade --skip-migration-test

Expected behaviour

I would expect the upgrade to start

Actual behaviour

root@owncloud:/var/www# sudo -u www-data php occ upgrade --skip-migration-test
ownCloud or one of the apps require upgrade - only a limited number of commands are available
Set log level to debug - current level: 'Debug'
Updated database
PHP Fatal error: Class 'OC\Cache' not found in /var/www/apps/user_ldap/lib/connection.php on line 72

Server configuration

Operating system: Ubuntu 14.04

Web server: Apache

Database: MariaDB

PHP version: cg213715_admin@owncloud:~$ php -v
PHP 5.6.23-1+deprecated+dontuse+deb.sury.org~precise+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

ownCloud version: (see ownCloud admin page) Update to 8.1.2

Updated from an older ownCloud or fresh install: Upgrade

Where did you install ownCloud from: Update app

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.
root@owncloud:/var/www# sudo -u www-data php occ app:list
ownCloud or one of the apps require upgrade - only a limited number of commands are available
Enabled:
 - files: 1.1.9
 - files_pdfviewer: 0.7.1
 - files_sharing: 0.6.2
 - files_versions: 1.0.5
 - gallery: 0.6.0
 - updater: 0.4
Disabled:
 - activity
 - external
 - files_encryption
 - files_external
 - files_locking
 - files_texteditor
 - files_trashbin
 - files_videoviewer
 - firstrunwizard
 - provisioning_api
 - templateeditor
 - user_external
 - user_ldap_orig
 - user_webdavauth

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

**Are you using encryption:** yes/no

**Are you using an external user-backend, if yes which one:** ActiveDirectory

#### LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder
root@owncloud:/var/www# sudo -u www-data php occ ldap:show-config
ownCloud is in maintenance mode - no app have been loaded

[InvalidArgumentException]
There are no commands defined in the "ldap" namespace.

root@owncloud:/var/www#

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM oc_appconfig WHERE appid = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

### Client configuration
**Browser:**

**Operating system:**

### Logs
#### Web server error log

Insert your webserver log here

#### ownCloud log (data/owncloud.log)

Insert your ownCloud log here

#### Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
`


#2

Hi,

from what version of owncloud are you updating?


#3

We are working our way up to a current version. But this is applying to our upgrade to 8.1.12.

I was able to get the upgrade to run by doing the following:

Renamed the apps/user_ldap and apps/files_sharing directories. Ran the upgrade command given above. Then renamed the directories back afterwards.

This allowed the upgrade to run successfully:
www-data@owncloud:~$ php occ upgrade --skip-migration-test
ownCloud or one of the apps require upgrade - only a limited number of commands are available
Set log level to debug - current level: 'Debug'
Updated database
Update successful
Maintenance mode is kept active
Reset log level to 'Debug'

However, after restarting Apache, I am now seeing the error in the Apache error.log:

[Wed Sep 27 08:54:03.263837 2017] [:error] [pid 18451] [client 10.28.93.136:60481] PHP Fatal error: Class 'OC\Cache' not found in /var/www/apps/user_ldap/lib/connection.php on line 72
[Wed Sep 27 08:54:03.264660 2017] [:error] [pid 18451] [client 10.28.93.136:60481] {"reqId":"LsHZMaSC\/t7ydMdFUzl4","remoteAddr":"10.28.93.136","app":"PHP","message":"Class 'OC\\Cache' not found at \/var\/www\/apps\/user_ldap\/lib\/connection.php#72","level":3,"time":"2017-09-27T12:54:03+00:00","method":"PROPFIND","url":"\/remote.php\/webdav\/"}


#4

This can be closed.

I backed up my cconfig, downloaded the tarball and exploded it into the directory. Replaced config, and restarted apache. Working.


#5

So you did a manual upgrade? :smiley:

I am glad that you got your system working