File locking problem with Nextcloud 34.0 versions

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 34.0.4
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.5
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.58
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • 8.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After upgrade from Nextcloud 28 to 34.0.3
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Nextcloud web client
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

Server recently upgraded from Nextcloud 29.0 (very far behind!)

User edits file (normally Microsoft Word), and when tries to save work (either intermediary save or document close), Word reports error that the file is read-only, and that work must be saved to a different file name or location.

This is an intermittent issue. Sometimes, it’s possible to work without difficulties (even multiple saves).

I have not been able to replicate this one myself.

User has been running 34.0.3 of the client (and corresponding with 34.0.3 on the server), and upgraded to 34.0.4, when the server was upgraded to 34.0.4.

This is happening only through the Nextcloud client. Primary user is running MacOS 26.6.2 (and edits a lot of files). However, we’ve also seen it happen a couple of times with users running Windows 11 25H2.

When the read-only problem occurs, the file shows a lock icon in the web client, as well as in the MacOS Finder and the Windows Explorer. Sometimes, closing the file in Word is enough to release the lock, but we’ve seen occasions when a file stays locked, and the lock doesn’t clear until either the file is manually unlocked, or the lock eventually times out (hours later).

We’re not hosting the server, but working with a small hosting provider that has the server installed in a VPS (proxmox, I believe – definitely not Docker), but I think the setup is considered to be self-hosted. Just that I’m not doing the hosting myself.

Steps to replicate it (hint: details matter!):

  1. I have not been able to replicate the problem.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

No related is in the logs

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

“system”: {
“instanceid”: “REMOVED SENSITIVE VALUE”,
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“REMOVED SENSITIVE VALUE”
],
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “34.0.4.1”,
“overwrite.cli.url”: “REMOVED SENSITIVE VALUE”,
“dbname”: “REMOVED SENSITIVE VALUE”,
“dbhost”: “REMOVED SENSITIVE VALUE”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“mysql.utf8mb4”: true,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“installed”: true,
“htaccess.RewriteBase”: “/”,
“mail_smtpmode”: “smtp”,
“mail_sendmailmode”: “smtp”,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_domain”: “REMOVED SENSITIVE VALUE”,
“mail_smtphost”: “REMOVED SENSITIVE VALUE”,
“mail_smtpport”: “587”,
“mail_smtpauth”: 1,
“maintenance”: false,
“maintenance_window_start”: 1,
“loglevel”: 2,
“mail_smtpname”: “REMOVED SENSITIVE VALUE”,
“mail_smtppassword”: “REMOVED SENSITIVE VALUE”,
“trashbin_retention_obligation”: “auto, 60”,
“theme”: “”,
“app_install_overwrite”: ,
“updater.secret”: “REMOVED SENSITIVE VALUE”
}

Apps

The output of occ app:list (if possible).

Enabled:

  • activity: 7.0.0
  • app_api: 34.0.0
  • appstore: 1.0.0
  • bruteforcesettings: 7.0.0
  • circles: 34.0.0
  • cloud_federation_api: 1.18.0
  • comments: 1.24.0
  • contactsinteraction: 1.15.0
  • dashboard: 7.14.0
  • dav: 1.40.0
  • federatedfilesharing: 1.24.0
  • files: 2.6.0
  • files_downloadlimit: 5.2.0
  • files_lock: 34.0.1
  • files_pdfviewer: 7.0.0
  • files_reminders: 1.7.0
  • files_sharing: 1.26.0
  • files_trashbin: 1.24.0
  • files_versions: 1.27.0
  • firstrunwizard: 7.0.0-dev.0
  • logreader: 7.0.0
  • lookup_server_connector: 1.22.0
  • nextcloud_announcements: 6.0.0
  • notifications: 7.0.0-dev.1
  • oauth2: 1.22.0
  • office: 1.0.0
  • password_policy: 6.0.0-dev.0
  • photos: 7.0.0
  • privacy: 6.0.0-dev.1
  • profile: 1.3.0
  • provisioning_api: 1.24.0
  • recommendations: 7.0.0
  • related_resources: 5.0.0-dev.0
  • serverinfo: 6.0.0
  • settings: 1.17.0
  • sharebymail: 1.24.0
  • support: 6.0.0
  • survey_client: 6.0.0-dev.0
  • systemtags: 1.24.0
  • text: 8.0.0
  • theming: 2.9.0
  • twofactor_backupcodes: 1.23.0
  • twofactor_totp: 16.0.0
  • updatenotification: 1.24.0
  • user_status: 1.14.0
  • viewer: 7.0.0-dev.0
  • webhook_listeners: 1.6.0
  • workflowengine: 2.16.0
    Disabled:
  • admin_audit: 1.24.0
  • encryption: 2.22.0
  • federation: 1.24.0 (installed 1.19.0)
  • files_automatedtagging: 1.19.0 (installed 1.19.0)
  • files_external: 1.26.0
  • flow_notifications: 5.0.0 (installed 5.0.0)
  • suspicious_login: 12.0.0-dev.0
  • twofactor_nextcloud_notification: 8.0.0
  • user_ldap: 1.25.0
  • weather_status: 1.14.0 (installed 1.9.0)

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Do your macOS clients use the classic folder synchronization or file providers? :thinking:

We’re using file provider.

After I posted, I found documentation for Mac interface at Using the macOS File Provider — Nextcloud 36 User Manual and discovered in the Known Issues section that there is a conflict relating to security structure within MacOS.

I also did some further testing, where I was able to get similar failures – it seems that the primary variable there is time. If I edit something quickly and save, it’s often not a problem. The place where I do see issues is after the file has been open for a while, perhaps 10 minutes. Although Microsoft Word is the place where we’re seeing the issue, I spent some time working in LibreOffice Word, and eventually had the same issue there. Thus, I think this dismisses Word (and any places where a Mac version is different from Windows) as a culprit.

Once I’m finding how to replicate the problem, then there seem to be multiple ways of getting around it. The one that would be preferred by Word is offered in the save dialog, of suggesting “save as” to another file name or another location. A second way that I’ve found is to use the Finder to right-click on the document and release the lock. In Word, there’s a second dialog that requires granting write access to a hidden temporary file (I believe a part of Word’s capacity for tracking unsaved changes), and granting access allows saving the document. In Libre Writer, unlocking the file allows for a save.

I’m not going to pretend that unlocking is a great solution, as doing so removes protection from an open file from being edited by another, and although the chances of that happening are low, they’re also above zero.

Ultimately it may be that for the one Mac user that is having problems (a high-frequency user), the best thing to do would be to shift back to classic folder synchronization, although I need to find out how to do that, as well as make sure I know the behavior for support purposes. But that’s what may be necessary to resolve this problem for this particular user.

As it is, this user still has the procedure of classic synchronization, and hasn’t quite gotten the logic of how virtual files should work, and it may be easier conceptually to not have to unlearn the older way of doing things.