Files locked although Redis and APCu are in place

Hello everyone,

I use Owncloud 10.0.8 and I'm the only user on the system. but as soon as I set 'filelocking.enabled' => true,in the config.php I get almost always the error message that a file is locked although I haven't touched it for hours.
I already configured Redis and APCu for the system and I use a system cron that runs every 15 min. but all those steps heven't helped.
Does anyone have the same problem and may help me.?
I ask because at the moment 'filelocking.enabled' => false is set to make the system useable, But then I get a warning in Settings->General for the Admin that Transactional file locking is disabled.

Many thanks in advance for your help.

Steps to reproduce

Setup a system like mine and log in as the only user on the system.
Set Apache as owner of all files of the installation and set the recommended file rights.
Try to upload more than one file or try to touch a file. You get a locked message.

Expected behaviour

No files locked due to the fact that only one user with one session is using the system..

Actual behaviour

Files I haven't touched for hours are locked and I'm not able to upload or download things. The system is almost unuseable.

Server configuration

Operating system:
Ubuntu 16.04

Web server:
Apache 2.4.18 (Ubuntu)

Database:
MariaDB 10.2.12

PHP version:
7.0.28 (Ubuntu)

Redis version
Redis: 3.2.10

ownCloud version: (see ownCloud admin page)
10.0.8

Updated from an older ownCloud or fresh install:
Updated from 10.0.7 but the behaviour was the same on 10.0.7

Where did you install ownCloud from:
Installed Owncloud repository for Ubuntu 16.04.and then run apt-get install owncloud-files

The content of config/config.php:
{
"basic": {
"license key": "REMOVED SENSITIVE VALUE",
"date": "Mon, 23 Apr 2018 01:58:54 +0000",
"ownCloud version": "10.0.8.5",
"ownCloud version string": "10.0.8",
"ownCloud edition": "Enterprise",
"server OS": "Linux",
"server OS version": "Linux ip-172-31-172-43 4.4.0-1054-aws #63-Ubuntu SMP Wed Mar 28 19:42:42 UTC 2018 x86_64",
"server SAPI": "apache2handler",
"webserver version": "Apache\/2.4.18 (Ubuntu)",
"hostname": "loony.info",
"user count": 2,
"user directories": 2,
"logged-in user": "REMOVED SENSITIVE VALUE"
},
"config": {
"updatechecker": false,
"updater.server.url": "https:\/\/updates.owncloud.com\/server\/",
"has_internet_connection": true,
"check_for_working_webdav": true,
"check_for_working_wellknown_setup": true,
"check_for_working_htaccess": true,
"operation.mode": "single-instance",
"instanceid": "ocgxrv4lh7zr",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"localhost",
"loony.info"
],
"datadirectory": "\/mnt\/efs\/www\/owncloud\/data",
"overwrite.cli.url": "https:\/\/loony.info",
"htaccess.RewriteBase": "\/",
"dbtype": "mysql",
"version": "10.0.8.5",
"dbname": "ownclouddb",
"dbhost": "loonyinfo.cgjmc5efrkph.eu-west-1.rds.amazonaws.com",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"logtimezone": "UTC",
"installed": true,
"memcache.local": "\OC\Memcache\APCu",
"filelocking.enabled": false,
"filelocking.ttl": 60,
"memcache.locking": "\OC\Memcache\Redis",
"memcache.distributed": "\OC\Memcache\Redis",
"redis": {
"host": "loonyredis.wq1zqa.clustercfg.euw1.cache.amazonaws.com",
"port": 6379,
"timeout": 0,
"password": "REMOVED SENSITIVE VALUE"
},
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtpsecure": "ssl",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "465",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"loglevel": 3,
"singleuser": false,
"maintenance": false,
"upgrade.automatic-app-update": true
},
"integritychecker": {
"passing": true,
"enabled": true,
"result": []
},
"core": {
"allow_user_mount_sharing": "yes",
"backgroundjobs_mode": "cron",
"default_encryption_module": "OC_DEFAULT_MODULE",
"enable_external_storage": "yes",
"encryption_enabled": "yes",
"installedat": "1520676864.3005",
"lastcron": "1524447907",
"lastupdateResult": "[]",
"lastupdatedat": "1524448690",
"public_files": "files_sharing\/public.php",
"public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
"remote_nonshib-webdav": "user_shibboleth\/appinfo\/remote.php",
"shareapi_allow_public_notification": "yes",
"umgmt_send_email": "true",
"umgmt_show_backend": "true",
"umgmt_show_email": "true",
"umgmt_show_is_enabled": "true",
"umgmt_show_last_login": "true",
"umgmt_show_storage_location": "true",
"vendor": "owncloud"
},
The rest I deleted due to size limitations.

From what i know the forums here is mostly used by community users so not sure if enterprise support is given here as well. Maybe you need to contact your support on www.owncloud.com ?

Thanks Tom42 for your remark, maybe I should have clarified this.

My installation uses the 30 day Enterprise trial at the moment, which is availabe for everyone. That's why it says "ownCloud edition": "Enterprise",. But as long as you have not paid for the license there is no Enterprise support for the installation. That's the reason, why I posted my problem here.

Ah, thanks for the clarification. Then i would just create a new bugreport at https://github.com/owncloud/core/issues as this doesn't look to me like a normal operation of this locking feature.

Can you provide the owncloud log file?

I reenabled filelocking and here is the log I get:
{"reqId":"06vgqIa3vZtDANzuouZH","level":4,"time":"2018-04-23T10:50:08+00:00","remoteAddr":"172.31.27.40","user":"loonyadmin","app":"webdav","method":"GET","url":"\/remote.php\/webdav\/ILS\/Hinweise_Fernlernen.pdf","message":"Exception: {\"Message\":\"HTTP\\/1.1 423 \\"ILS\\/Hinweise_Fernlernen.pdf\\" is locked\",\"Exception\":\"OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked\",\"Code\":0,\"Trace\":\"#0 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/CorePlugin.php(85): OCA\\DAV\\Connector\\Sabre\\File->get()\n#1 [internal function]: Sabre\\DAV\\CorePlugin->httpGet(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/event\\/lib\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \\/mnt\\/efs\\/www\\/owncloud\\/apps\\/dav\\/appinfo\\/v1\\/webdav.php(63): Sabre\\DAV\\Server->exec()\n#6 \\/mnt\\/efs\\/www\\/owncloud\\/remote.php(165): require_once('\\/mnt\\/efs\\/www\\/ow...')\n#7 {main}\",\"File\":\"\\/mnt\\/efs\\/www\\/owncloud\\/apps\\/dav\\/lib\\/Connector\\/Sabre\\/File.php\",\"Line\":386,\"User\":\"loonyadmin\"}"}
{"reqId":"9XSIooAuhkWkegnoZ2BL","level":4,"time":"2018-04-23T10:50:42+00:00","remoteAddr":"172.31.27.40","user":"loonyadmin","app":"webdav","method":"GET","url":"\/remote.php\/webdav\/Photos\/San%20Francisco.jpg?downloadStartSecret=efzn2fvjk2","message":"Exception: {\"Message\":\"HTTP\\/1.1 423 \\"Photos\\/San Francisco.jpg\\" is locked\",\"Exception\":\"OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked\",\"Code\":0,\"Trace\":\"#0 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/CorePlugin.php(85): OCA\\DAV\\Connector\\Sabre\\File->get()\n#1 [internal function]: Sabre\\DAV\\CorePlugin->httpGet(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/event\\/lib\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \\/mnt\\/efs\\/www\\/owncloud\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \\/mnt\\/efs\\/www\\/owncloud\\/apps\\/dav\\/appinfo\\/v1\\/webdav.php(63): Sabre\\DAV\\Server->exec()\n#6 \\/mnt\\/efs\\/www\\/owncloud\\/remote.php(165): require_once('\\/mnt\\/efs\\/www\\/ow...')\n#7 {main}\",\"File\":\"\\/mnt\\/efs\\/www\\/owncloud\\/apps\\/dav\\/lib\\/Connector\\/Sabre\\/File.php\",\"Line\":386,\"User\":\"loonyadmin\"}"}
I also opened an issue on github as suggested: https://github.com/owncloud/core/issues/31243

Help me understand here.

So you install oc 10.0.7 from repository, get this error, and then try to solve it via updating to 10.0.8?

Have you started the enterprise trial before or after updating?

I installed 10.0.7 in mid March 2018 when 10.0.8 wasn't out yet. I got the error and lastly disabled filelocking such that I was able to work with the system. Then I made the update as 10.0.8 was available for production use. I did the update with filelocking disabled. And I also enabled the Enterprise trial last weekend with filelocking disabled.
The reason I open this issue is, because maybe I'm a fool and haven't thought of something or maybe it's an anknown issue. That's why.

Okay, thanks for the info.

You have ownCloud installed on hosted servers, right? AWS?

Also have you configured redis like it's described in the documentation?

I run Owncloud on AWS yes. The webserver is an EC2 instance with EFS mounted as storage for the files and the installation. The webserver points to the EFS location where all the files are located.
The database is a RDS instance and Redis is an ElasticCache instance. They are all located in the same local network.
Concerning the configuaration I installed all the stuff mentioned in the manual and did all the config stuff.

Okay, I have installed your setup or a similar one on my machine, and could not reproduce your error.

This is my config.php configuration:

'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),

The only time I had an error was when I forgot to start the redis server.
Make sure you have the required modules installed:

apt-get install -y php-apcu php-redis redis-server

Also, what repository channel are you on? Because 10.0.8 is not in production yet. I suppose you are in testing.

Also what are the exact steps when you get the error?

I can upload pictures or create textfiles with the Texteditor and open - edit - close those files without any errors.

Hi loonyinfo,

Just an idea: try to truncate the oc_locks table. Maybe there are stray locks which don`t get cleared because redis locking is used now.

Okay, first things first:
I got my mistake. I was a fool.. It was these two lines in the redis array in the config.php for owncloud:
"timeout": 0,
"password": "REMOVED SENSITIVE VALUE"
As soon as I removed them.. It worked.
What channel I'm on i can't say, because I just did what it says here:
https://download.owncloud.org/download/repositories/stable/owncloud/index.html for Ubuntu 16.04 and in the URL it says stable. So why should it be testing. And when I do apt list owncloud I get this:
owncloud-files/unknown,now 10.0.8-1+1.1 all [installed]
Further on 10.0.8 ist not marked as Release candidate or so.

Anyway many thanks for the help!!

Hi Ilja,

that I already checked, before I opened this entry. But thanks for the suggestion. In the end it was two lines to much in the config.php for owncloud. My bad.

Anyways thanks for the help!!