I copied my usb backup storage(~1.5TB) to nextcloud earlier yesterday and files:scan showed 'file is locked' after a long while. I already check oc_file_locks table but there is no locked files.
~~~
mysql> select * from oc_file_locks;
Empty set (0.00 sec)
mysql>
~~~
I don't know which file is locked. How can i debug it?
~~~
~# nextcloud.occ files:scan ed
Starting scan for user 1 out of 1 (ed)
Exception during scan: "files/e1e43e5db8822170262fffc03cef32a9" is locked, existing lock on file: exclusive
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+
~ #
~~~
I'm afraid I'm not sure. The snap uses redis for locks, but I've never seen an error like that before-- it doesn't seem snap-specific. I suggest asking over at https://help.nextcloud.com/ .
I found radis-cli flushall tricks in Forum.
~
sudo redis-cli -s /var/run/redis/redis.sock flushall
~
But, nextcloud-snap does not export redis.sock to outside.
Can i access this redis socket?
Hey, I face the same issue, but I did not modify or move my attached storage at all. One user simply has the issue that a file is locked (same message as @hwiorn).
Checking the oc_file_locks table shows 0 entries.
My setup is a RaspberryPi 3+ with an Ubuntu core 18 and Nextcloud 15.0.10. Harddrive is an 1TB spinning disk.
The file in question is within a group-folder located - so maybe this is a special case ...
So far only one user is affected by this and I still need to investigate further.
@hwiorn any further progress for you yet?
Groupfolder scan shows no issue
$ sudo nextcloud.occ groupfolders:scan 5
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 219 | 794 | 00:00:16 |
+---------+-------+--------------+
and files scan too:
$ sudo nextcloud.occ files:scan --all
Starting scan for user 1 out of 15
...
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 6114 | 34241 | 00:04:55 |
+---------+-------+--------------+
I have the same problem
You can access the socket via /tmp/snap.nextcloud/tmp/sockets/redis.sock so the following command should do the trick:
sudo redis-cli -s /tmp/snap.nextcloud/tmp/sockets/redis.sock flushall
Most helpful comment
I found radis-cli flushall tricks in Forum.
~sudo redis-cli -s /var/run/redis/redis.sock flushall
~
But, nextcloud-snap does not export redis.sock to outside.
Can i access this redis socket?