-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
files locked for no obvious reason #8723
Comments
When I try to upload files with web browser it's return: |
Releated: #6655 Still get file locks from time to time without any reason. Just by downloading the file (I think) it get's locked which is kind of stupid. |
I can download any files but I can not upload files on my nextcloud. |
@Floflobel Yes I understand that, but what I was meaning is that it gets locked when someone downloads and therefore you can't upload or download, that's what I think at least. Strange thing is that it happens randomly, and I have no clue how to debug it. My log is filled with "file is locked" with this file: https://cloud.techandme.se/s/whxC00V1I0l4CY8 and it's been like that forever. Just giving my input on this matter. :) |
@enoch85 Ok, I understand better. I do not think it's the fact that it's downloading it locks it because I'm the only user .. Hoping that we will find something to debug the problem. ;) |
@Floflobel Feel free to debug it, if you find the cause then we can fix it. :) |
Hi, i cannot synchronize my files, because a file has been "locked" on the server. What can i do to remove it ? |
@Wenzel Do you have any shared folders which syncs with the client? Like federated shares or similar. |
@enoch85 not at all. I tried to remove the file on the filesystem, and i'm now rescanning the filesystem with |
@Wenzel OK, please post the output. |
@Wenzel You should always use Do it with caution though, and I'm no expert just so you know. |
Ping @MorrisJobke and others (don't know who this belongs to). |
cc @icewind1991 and @rullzer because we discussed about this lately |
I just want to confirm it is happening also to me. I run two NC servers, one 12.0.0 the other 13.0.2. Both suffers of this ".. server replied: Locked (''/path/to/filename/" is locked) issue. My NC desktop client is "Version 2.3.3", it however from the response it looks it is probably server issue. My observation is that this is happening on files which change frequently. Could it be something with the timestamp resoluttion? Just to note, I do not believe it may cause the issue, my server runs UTC time, my client runs CEST time, both auto synced through NTP. Server runs on Ubuntu 16.04, nginx version: nginx/1.13.6, PHP 7.0.28-0ubuntu0.16.04.1 (fpm-fcgi). Also the suggested fix to disable locking and './occ files:scan' did not solved the issue. |
I have the same kind of problem... but the files syncs well after waiting a while. It occures when uploading a folder with a lot of files. I have write a topic on help nextcloud https://help.nextcloud.com/t/sync-some-files-are-blocked-error-during-sync-and-then-synced-after-a-second-third-try-no-app-in-context/30986 |
Same issue here. Typically it happens when a file is edited both on my server and on my laptop. (I think). The lock then persists for days or longer, unless manually removed. The errors seem to come in pairs. One
Negative numbers of shared locks seems suspect to me, especially considering that this post seems to assume that they should all be 1, but I really don't know much about this. Redis is active, but this issue was much more prevalent before turning on Redis. EDIT: This doesn't seem right:
EDIT2: Solution was |
Have also experienced the same issue as @ConorIA with the logs showing negative numbers of file locks when using redis as a result of syncing via the Mac desktop client. There were no locks in the MySQL database as expected. Didn’t know about the redis flush command but the issue resolved itself after a few hours, through did persist through restarts. |
This has been an issue for quite some time I'm afraid. Maybe NC 14 will be more stable, let's hope for that anyway. |
I understand it may be here for some time, it however does not solve the issue and leave the Nextcloud unusable (due to the lack of trust) for everyday syncing of multiple devices. Is there test case which always fails and can be reproduced? |
Lock values getting negative should-not-happen™ and is a likely cause of files being persistently locked. #10116 should prevent this from happening. |
I stopped apache, applied the patch, cleared the locks table, then started apache. Still getting dozens of "OCP\Lock\LockedException" |
There a different options for the file locking. Which one are you currently using (Redis or DB?). You could try to disable it (and enabled it again after you restored the files) like suggested here #8723 (comment). It's easier for us to help you if you provide the information from the issue template: https://github.com/nextcloud/server/issues/new?labels=bug%2C+0.+Needs+triage&template=Bug_report.md |
Then it's something else. Could you enable the debug log of the file locking? See server/config/config.sample.php Lines 1621 to 1630 in e6333c8
|
Set 'filelocking.debug' to false to enable it or set it to true? Should I open new bug report? |
set it to |
Looks like on 15.0.2 and now on 15.0.6 everything is fine. No locks. Thanks. |
Looks like desktop client version 2.5.2git with server from 13.x to 15.0.7 still has the issue. |
Just as a reference, since Nextcloud 15.0.3 + desktop client 2.5.1 I didn't have any issues at all. Before this got fixed I had issues every time I uploaded the Nextcloud VM using the client. So for me this is totally fixed, and I'm a pretty heavy user / tester. |
Please open a new issue (https://github.com/nextcloud/server/issues/new?labels=bug%2C+0.+Needs+triage&template=Bug_report.md) if you still observe locking problems. Let us know if you use redis or db for locking. |
Opened here: #15235; I do not know if my instance is using Redis; when checked for 'redis' process through ps auwx |grep redis did not find any process. |
2 years later, and the same bug is still lurking around in Nextcloud code. Some of my files have been locked again, and I can't remove them anymore. Why this bug is still here ? :( |
@Wenzel Can you use occ web app for this task? |
hey @bpcurse, thank you so much for the quick reply ! I just installed it. |
@Wenzel you can try a |
@warnerbryce I tried that, and there is a locked folder that I still can't remove. |
Okay so you have to interact with the database of your nextcloud. Do you have access to your mysql database with phpmyadmin or something like that ? |
@Wenzel I suppose you have database access? What you could try is occ files:cleanup and if that doesn't help delete all entries in the table file_locks. WARNING: Make sure to have a backup files/database and no user/no sync client connected to your cloud! Manipulating the database is always a risk and I am not a developer. If you need further support, please use https://help.nextcloud.com. |
@warnerbryce @bpcurse I will try however, I'm using a hosted solution, and I don't have SSH access, so no database either. |
@Wenzel you must have access to a phpmyadmin or other page to manipulate your database. It can’t be other way. |
This issue is still here. None of the fixes I have found anywhere work. I am using redis. tried flushing it. did not work. |
I can reproduce this issue every time I use the following workflow (NC 18.04., encrypted enabled, shared hosting with 128MB RAM): 1.) On Win10 PC: Create a new folder 'test' and copy at least 6 JPEGs to it (each 5MB) The deletion ALWAYS fails for me in this setup. I get the message, that the data is locked. Trying to delete the JPEGs file by file after that does work for some images, for others not (with locked message). I do NOT get errors, when I delete the folder from Android/IOS App without going into it before. |
@krusta4711 encryption with a 128MB ram on shared hosting is really low specs for having a good working nextcloud server. |
Yes you are right @warnerbryce So I wrote down my workflow to help the other users in this thread with this issue. Nobody could state a workflow to reproduce the issue until now. Maybe someone with a bigger server can try to reproduce my workflow. If it fails too that might help to solve the issue. |
Hello the same here. |
@beatrfrm and you have encryption enabled or not ? |
@warnerbryce as I know I didn't enabled any encryption. Actually is a new installation, with some apps. But if I disable all (the basic apps to) apps the problem is still here. It is a LAMP Server. filelocking is disabled. |
I see that the problem has been around for 3 years and has not been resolved in any way. |
@p6002 in my case it was caused by a mis-configuration of the basic setting for Cron instead of AJAX Cron. So if you go to Settings > Administration > Basic Settings it will tell you when it last ran the Background Jobs I found something along the following SQL quite useful for debugging that cause: See #15235 for more details Kind regards, |
Steps to reproduce
Expected behaviour
Files synchronise
Actual behaviour
Files not synchronise
Server configuration
Operating system: Ubuntu 16.04.4 LTS
Web server: apache2 2.4.18
Database: postgres 9.6
PHP version: 7.0.25
Nextcloud version: (see Nextcloud admin page) 13.0.0.14
Updated from an older Nextcloud/ownCloud or fresh install: updated
Where did you install Nextcloud from:
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: local/smb/sftp/...
Yes local storage
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Just nextcloud client
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
The text was updated successfully, but these errors were encountered: