- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2019-03-08T14:18:09+09:00","default:kuji","kuji")
CONTENTS
#contents
----
Lastmodified &lastmod;
----
*ファイルがロックされている - ロックを解除する方法 [#nb635079]
*Nextcloud ファイルがロックされている - ロックを解除する方法 [#nb635079]
https://www.dbonline.jp/mysql/insert/index10.html
** 最善策は? [#yd6d0dad]
いろいろ試したけど、以下のスクリプトを走らせることで、アンロックする。
oc_unlock.sh
#!/bin/sh
mysql -v -u root -pPASSWORD nc << EOF
DELETE FROM oc_file_locks WHERE oc_file_locks.\`lock\` <> 0;
EOF
注)二行目 -p に続いてDBのパスワードを記述。 nc はDB名
これを実行権つけて、ロックファイルができてクライアントからファイル削除でできないときにサーバで実行する。 で、OK!
----
【参考URL】https://arimasou16.com/blog/2018/02/16/00247/
「oc_file_locks テーブルの全レコードを消去」でいいらしい。まじか?
phpMyAdmin だと、こう。
[[&resizeimage(oc_file_locks_Record_delete.png,320,240,70,k);>https://piano2nd.smb.net/PukiWiki/index.php?plugin=attach&refer=nextcloud%20file%20unlock&openfile=oc_file_locks_Record_delete.png]]
但し、巨大DBだと、ロックファイル再生成にかなり時間が掛かる副作用あり。
やっぱ、
SELECT * FROM `oc_file_locks` WHERE 1
をこまめにやるヨロシ
----
もしくは、phpMyAdmin で、
SELECT * FROM `oc_file_locks` WHERE `lock` = 1
検索してヒットしたレコードを削除
DELETE FROM oc_file_locks WHERE 1
**Nextcloud のルートディレクトリへ遷移したのち [#s2ffac62]
root@sun1:/usr/local/www/nextcloud:18_08_23:17:02 # sudo -u www php occ files:scan --all
----
*File is locked - how to unlock [#k0356f14]
https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883/2
You can’t access files because they are locked and you find such errors in your logfile:
{"reqId":"0DijSqEkfOg2iyh9VD8J","remoteAddr":"xx.xx.xx.xx","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 423 \\\"path\\\/file.extension\\\" is locked\",\"Exception\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Exception\\\\FileLocked\",\"Code\":0,\"Trace\":\"#0
**Manually disable locking state: [#u7b7ed47]
•put Nextcloud in maintenance mode: edit config/config.php and change this line:
'maintenance' => true,
•Empty table oc_file_locks: Use tools such as phpmyadmin or connect directly to
your database and run (the default table prefix is oc_, this prefix can be different or even empty):
DELETE FROM oc_file_locks WHERE 1
•disable maintenance mode (undo first step).
•Make sure your cron-jobs run properly (you admin page tells you when cron ran the last time):
https://docs.nextcloud.org/server/13/admin_manual/configuration_server/background_jobs_configuration.html 357
**Permanent solution (if it happens regularly) [#x1683d12]
•on your own server: Use redis for this feature. It is faster and so far no problems have been reported. You
can follow the instructions for memory-caching in the docs:
https://docs.nextcloud.org/server/13/admin_manual/configuration_server/caching_configuration.html#id4 1.2k
• Shared hosting (others who can’t install redis): You can disable the file locking, edit your configuration
file config/config.php:
'filelocking.enabled' => false,
However, disabling is not a good solution. You can run into problems when several processes try to write to a
file (especially online editors in the web-interface). In single-
user and single-client environments, it’s probably less of a problem.
----
Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);