OCP\Lock\ILockingProvider' not found

Hello, When every I try to download something it starts and after it reaches like 2% it fails with the error below. Now I know this has something to do with Redis and file locking but I don’t know what.

Uncaught Error: Class ‘OCP\Lock\ILockingProvider’ not found in /srv/users/serverpilot/apps/nextcloud/public/lib/private/files/view.php:1129 Stack trace: #0 [internal function]: OC\Files\View->OC\Files{closure}() #1 /srv/users/serverpilot/apps/nextcloud/public/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #2 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #3 {main} thrown at /srv/users/serverpilot/apps/nextcloud/public/lib/private/files/view.php#1129

A little about my server… I am on ubuntu 16.04 and user serverpilot for management. Serverpilot installs mysql 5.7 with apache and nginx along with php7. Now I followed serverpilots directions to install Redis see below for the links for redis server and redis extention

redis server install

redis php extension install

After I follow those directions this is the code I put into config.php

‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘filelocking.enabled’ => true,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ => array(
‘host’ => ‘localhost’,
‘port’ => 6379,
‘timeout’ => 0.0,
‘password’ => ‘’, // Optional, if not defined no password will be used.
),

moved to category “support”

Please make sure that lib/public/lock/ilockingprovider.php exists on your server

Hey Nick, I checked and I do have that file.it’s permissions are 644…

I am seeing a very similar error:

[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 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/hidden.org/:/tmp/:/dev/urandom:/var/run/redis:/home/timbackup) in /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php on line 1152”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 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/hidden.org/:/tmp/:/dev/urandom:/var/run/redis:/home/timbackup) in /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php on line 1152”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: “NOTICE: PHP message: PHP Fatal error: Uncaught Error: Class ‘OCP\Lock\ILockingProvider’ not found in /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php:1152”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: “Stack trace:”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: “#0 [internal function]: OC\Files\View->OC\Files{closure}()”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: “#1 /var/www/vhosts/hidden.org/owncloud.hidden.org/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: “#2 [internal function]: Icewind\Streams\CallbackWrapper->stream_close()”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: “#3 {main}”
[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 said into stderr: " thrown in /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php on line 1152"

I have a similar config to @shoutcast, except Ubuntu 14.04 (on a HostEurope VPS). And using Redis for the file locking.

What gets my goat is the message about open_basedir, that is completely bananas. The open_basedir as quoted in the message is correct, and the Nextcloud installation passes the integrity check. It’s a Plesk-managed host, and PHP-FPM is running (called directly by Nginx) with the owner ID of the NC files. So there REALLY should be no problem there. Of course the class will be missing if the files could not be loaded - the problem seems to me to be the open-basedir problem preceeding the “class not found”.

If any more info is needed, just tell me.

I am still seeing this error, quite often in the logs. Here a corresponding message from the NC log:

{"reqId":"J4HJOLF0nTloNYMVkjjN","remoteAddr":"178.11.114.73","app":"PHP","message":"Uncaught Error: Class 'OCPLockILockingProvider' not found
 in /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php:1152
 Stack trace:
 #0 [internal function]: OCFilesView->OCFiles{closure}()
 #1 /var/www/vhosts/hidden.org/owncloud.hidden.org/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))
 #2 [internal function]: IcewindStreamsCallbackWrapper->stream_close()
 #3 {main}
 thrown at /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php#1152",
 "level":3,"time":"2016-11-09T11:07:39+00:00","method":"GET",
 "url":"/index.php/apps/files/ajax/getstoragestats.php?dir=%2FPeter%2FWinston%20Shrout%2FAudio%20Winston%20Shrout%2FWinston%20Shrout%20-%20Phoenix%20(Mastering%20Solutions)%2FPhoenix%20HO%20CD%2F6.%20Oath%20of%20Office","user":"PeterHarms"}

Could it be something to do with the round brackets in the file name?

Cheers, Tim

No takers? I’m STILL getting this error in the logs intermittently.

I think it may pay to look at the preceeding error before the fatal one:

[07-Nov-2016 07:14:17] WARNING: [pool hidden.org] child 20876 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/hidden.org/:/tmp/:/dev/urandom:/var/run/redis:/home/timbackup) in /var/www/vhosts/hidden.org/owncloud.hidden.org/lib/private/Files/View.php on line 1152”

Note that the complaint is about “ocp/lock/ilockingprovider.php” not being in open_basedir. So it looks like somewhere, the prefix to NC is getting lost.

Cheers, Tim

Same problem here.

{
  "reqId": "LkqYUC/Iip1ji9V44l+U",
  "remoteAddr": "X.Y.Z.A",
  "app": "PHP",
  "message": "Uncaught Error: Class 'OCPLockILockingProvider' not found in /var/www/html/lib/private/Files/View.php:1156nStack trace:n#0 [internal function]: OCFilesView->OCFiles{closure}()n#1 /var/www/html/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))n#2 [internal function]: IcewindStreamsCallbackWrapper->stream_close()n#3 {main}n  thrown at /var/www/html/lib/private/Files/View.php#1156",
  "level": 3,
  "time": "2016-12-19T11:29:24+01:00",
  "method": "POST",
  "url": "/apps/mail/accounts/2/folders/detectChanges",
  "user": "FOO",
  "version": "11.0.0.10"
}

It happens while downloading large files. Disabled locking and now all seems to work very well :slight_smile:

P.S.: lib/public/Lock/ILockingProvider.php is present

We have the same problem on our server.

Uncaught Error: Class 'OCP\Lock\ILockingProvider' not found in /app/lib/private/Files/View.php:1156 Stack trace: #0 [internal function]: OC\Files\View->OC\Files\{closure}() #1 /app/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #2 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #3 {main} thrown at /app/lib/private/Files/View.php#1156

This error is thrown sometimes for small and big files.
The necessary file is there on our webserver.

Just disable your open_basedir() restrictions. If you have problems, disable such modules if the software itself is working and then you can slowly activate them and you have to adapt the settings to the used setup.

@tflidd How can i do this?

Edit: I dont understand why this is the problem… it happens randomly on some files… if i had configured something wrong, should it not always occur?

Edit2: It happens sometimes on shared files (/s/RANDOMSTRING/…) and sometimes if i check the serverinfo with nagios (/ocs/v2.php/apps/serverinfo/api/v1/info)

In your case, it’s probably better to open a bug report on github.com/nextcloud/server/issues providing all details specified in the template. Make sure to run a current version of NC 10, 11 or 12. For NC 12 it might be worth waiting a few days until 12.0.1 is released.

Already done a month ago: https://github.com/nextcloud/server/issues/5381

1 Like