I did just install nextcloud on my archlinux server. I am using postgresql and uwsgi. Here is list of installed packages:
Everytime I upload file or files I am getting several error messages in journal. For upload one file I get 4 times following output:
postgres: 2019-02-18 20:07:12.312 CET  ERROR: duplicate key value violates unique constraint "lock_key_index"
postgres: 2019-02-18 20:07:12.312 CET  DETAIL: Key (key)=(files/400cc953a3e9981fad972cd0d650dbd3) already exists.
postgres: 2019-02-18 20:07:12.312 CET  STATEMENT: INSERT INTO "oc_file_locks" ("key", "lock", "ttl") VALUES($1, $2, $3)
Same error I get when deleting or rename file.
Already trying to find what is the problem, but I could not find any help.
Thank you for any tip and help.
I did configure NC to connect to PSQL over unix socket. I did think that it could be a problem.
SO I did change that to 127.0.0.1 (using standart port).
but error is still there
127.0.0.1 should not change anything because it only defines the database access but doesn’t effect file locking within Nextcloud. Have you searched the issue tracker to find a solution for your problem? Especially the mentioned locking problem has already been reported in one or the other way, like e.g. https://github.com/nextcloud/server/issues/9305. As far as I can see one recommendation is e.g. to install and use Redis for file locking.
well, I did find several locking problems but not with table oc_file_locks so thank you for pointing me to that thread.
I did disable APC cache and using only opcache. Problem is still there.
now I am getting message “No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the [documentation]”(https://docs.nextcloud.com/server/15/go.php?to=admin-performance).
OK I will try redis. I assume that I should use redis instead APC not together, right?
I did install redis and configure it to used only unix socket.
sudo redis-cli -s /run/redis/redis.sock ping
I did add these line into my config of nextcloud
'filelocking.enabled' => true,
'memcache.local' => '\OC\Memcache\APCu',
//'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array (
'host' => '/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
I did restat firstname.lastname@example.org but still getting errors from postgresql about duplicate key.
if I am uncomment memcache.distributed option from config
I am getting this error in webbrowser
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
and I am not know where I am doing a mistake.
thank you for any help and tip
finally I did find a problem, I did enable php-redis modul in uwsgi config
php-set = extension=redis