Skip to content

Persistent "Locked by Text" file lock after opening Markdown file in iOS app (MOVE fails with Sabre\DAV\Exception\Locked) #8858

Description

@Tewelus

Describe the bug

Markdown files become permanently "Locked by Text" after being opened in the Nextcloud iOS app.

The file remains editable in both the browser and the iOS app, but it can no longer be renamed or moved. WebDAV clients (e.g. Obsidian) also lose write access because the file remains locked.

The lock persists indefinitely (tested overnight) and is not removed automatically.

The lock can only be removed manually using:

sudo -u www-data php occ files:lock -u

or, in some cases, by editing the document in the browser (not consistently reproducible).

To Reproduce
Create a new Markdown (.md) file in the Nextcloud web interface.
Verify that the file is not locked.
Open the file in the Nextcloud iOS app.
Simply opening the file is sufficient (editing is not always required).
Return to the file list.
Open the same folder in the Nextcloud web interface.
Actual behavior

The file is displayed as "Locked by Text".

The following behaviour can be observed:

The file remains editable in the browser.
The file remains editable in the iOS app.
The file can no longer be renamed or moved.
WebDAV clients (Obsidian) can no longer modify the file.
The lock remains visible in both the browser and the iOS app.
Waiting several hours (including overnight) does not release the lock.
Closing the iOS app does not release the lock.
Running cron jobs does not release the lock.
Disabling and re-enabling the Text app no longer releases the lock once the issue occurs.

The lock can be removed manually using:

sudo -u www-data php occ files:lock -u

Expected behavior

The lock created by Nextcloud Text should be released automatically when the editing session ends.

Afterwards the file should again be:

renameable
movable
writable through WebDAV clients
Screenshots

The browser displays the file as "Locked by Text".

(attach screenshot if available)

Server details
Nextcloud version: Nextcloud Hub 26 Spring (34.0.1)
Text app: 8.0.0
PHP Version: 8.3.31
Database: mysql Ver 8.0.46-0ubuntu0.22.04.3 for Linux on x86_64 ((Ubuntu))
Redis configured as locking backend
filelocking.enabled = true
memcache.locking = \OC\Memcache\Redis
Client details
OS: iOS
Nextcloud iOS app: 33.1.0.9
Device: (please insert iPhone model if relevant)

Browser used for verification:

Firefox
Linux
Logs
Nextcloud log
Exception: Sabre\DAV\Exception\Locked

Method: MOVE

The exception occurs whenever trying to rename or move the locked file.

(The complete stack trace can be attached.)

Additional observations

The issue appears to be specific to files opened with the integrated Text editor through the iOS app.

The following tests were performed:

Action Result
Create Markdown file in browser Lock disappears normally
Edit with Obsidian (WebDAV) No persistent lock
Open file in iOS app Persistent "Locked by Text"
Edit file in browser File remains editable but lock often persists
Rename file Fails (Sabre\DAV\Exception\Locked)
occ files:lock -u Lock immediately removed

The issue is fully reproducible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions