Skip to content

[BUG] Deleted/renamed remote folder stays in file list forever – parent folder sync doesn't remove stale entries (oCIS, 404 loop) #5014

In review

Description

@blicknix

Actual behaviour

  • A folder that was deleted or renamed on the server still shows up in the app, together with its files, even after the parent folder is refreshed.
  • The parent folder syncs fine (207), and the server no longer lists the folder in its response. The app keeps the stale entries anyway.
  • Opening the stale folder or tapping one of its files gets a 404 Not Found every time. The app logs a FileNotFoundException but never removes the local entries.
  • When a stale file is tapped, the sync use case returns FileNotFound as a Success result, and the UI only says "File must be downloaded before opening it".
  • "Open in Collabora" still works for these stale files. The file opens and can be edited in Collabora. This suggests the file still exists on the server under its file ID (moved/renamed rather than deleted), and only the app's path-based requests (/Parent/Subfolder/...) fail with 404.
  • The user is stuck with "ghost" items that can't be opened, downloaded, synced or cleaned up.

Expected behaviour

  • When the parent folder (/Parent/) syncs and the server no longer lists Subfolder/, the app removes Subfolder/ and all its children from the local database.
  • At the latest, a 404 on PROPFIND of a folder or file should mark the local entries as deleted, remove them from the list, and send the user back to the parent folder.

Steps to reproduce

  1. Set the folder as "available offline"
  2. In the app, browse and sync a folder that contains files (e.g. /Parent/Subfolder/ with document-1.pdf and document-2.pdf).
  3. Delete or rename Subfolder on the server (web UI or another client).
  4. In the app, open /Parent/ and pull to refresh. Subfolder is still listed. Open it, or tap one of its files. You get a 404 error every time and the entries are never removed.

Can this problem be reproduced with the official owncloud server?
(url: https://ocis.ocis.master.owncloud.works, user: einstein, password: relativity)

  • not tested yet

Environment data

Android version: 16.1.134

Device model: Nothing Phone (3a) Pro

ownCloud app version: 4.8.4 (build 8fd9e36)

ownCloud server version: ownCloud Infinite Scale 8.2.1

Logs

Web server error log

Not applicable. The server behaves correctly: the folder is missing from the parent PROPFIND response, and direct requests return a proper 404:

PROPFIND https://<server>/dav/spaces/<space-id>/Parent/ → 207 (Subfolder not listed)
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/Subfolder/ → 404 Sabre\DAV\Exception\NotFound
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/Subfolder/document-1.pdf → 404 Sabre\DAV\Exception\NotFound
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/Subfolder/document-2.pdf → 404 Sabre\DAV\Exception\NotFound

ownCloud log (data/owncloud.log)

Android app log (excerpt):

I: ReadRemoteFolderOperation.kt:97 Synchronized /Parent/ with 9 files. - HTTP status code: 207

W: ReadRemoteFolderOperation.kt:101 Synchronized /Parent/Subfolder/ Local file does not exist
D: ViewModelExt.kt:69 Use case executed: SynchronizeFolderUseCase with result: Error(throwable=com.owncloud.android.domain.exceptions.FileNotFoundException)

I: ReadRemoteFileOperation.kt:75 Read remote file /Parent/Subfolder/document-1.pdf with status 404
I: SynchronizeFileUseCase.kt:56 File does not exist anymore in remote
com.owncloud.android.domain.exceptions.FileNotFoundException
at com.owncloud.android.data.RemoteOperationHandlerKt.handleRemoteOperationResult(RemoteOperationHandler.kt:110)
at com.owncloud.android.data.RemoteOperationHandlerKt.executeRemoteOperation(RemoteOperationHandler.kt:85)
at com.owncloud.android.data.files.datasources.implementation.OCRemoteFileDataSource.readFile(OCRemoteFileDataSource.kt:158)
at com.owncloud.android.data.files.repository.OCFileRepository.readFile(OCFileRepository.kt:334)
at com.owncloud.android.usecases.synchronization.SynchronizeFileUseCase.run(SynchronizeFileUseCase.kt:50)
at com.owncloud.android.usecases.synchronization.SynchronizeFileUseCase.run(SynchronizeFileUseCase.kt:36)
at com.owncloud.android.domain.BaseUseCaseWithResult.invoke(BaseUseCaseWithResult.kt:30)
at com.owncloud.android.extensions.ViewModelExt$runUseCaseWithResult$1.invokeSuspend(ViewModelExt.kt:67)
D: ViewModelExt.kt:69 Use case executed: SynchronizeFileUseCase with result: Success(data=...SynchronizeFileUseCase$SyncType$FileNotFound@f2308a9)
D: FileDetailsFragment.kt:429 /Parent/Subfolder/document-1.pdf : File must be downloaded before opening it

I: ReadRemoteFileOperation.kt:75 Read remote file /Parent/Subfolder/document-2.pdf with status 404
I: SynchronizeFileUseCase.kt:56 File does not exist anymore in remote
D: FileDetailsFragment.kt:429 /Parent/Subfolder/document-2.pdf : File must be downloaded before opening it

Activity

  1. blicknix commented on Oct 12, 2026

    @blicknix
    Author

    @LukasHirt thats the issue I told you about in the App. I could reproduce it.

  2. jesmrec commented on Oct 14, 2026

    @jesmrec
    Member

    @blicknix not sure if i understood correctly, so, i tried to reproduce and wasn't able. Let me know if my steps are wrong.

    In oCIS account, i created the following simple structure: a parent folder in root that contains 2 files (images) and a subfolder that also contains other 2 images:

    Parent
    └── image1.jpg
    └── image2.jpg
    └── Subfolder
             └── image3.jpg
             └── image4.jpg
    

    I set the parent as av. offline, so, all the structure becomes available offline. I browsed all the structure.

    Then, in web client, i deleted the Subfolder folder.

    I browsed again through Parent and Subfolder is gone

    With a video:

    Screen_recording_20261014_085338.mp4

    In the second 20' is when i go to the web and remove Subfolder. Then, browsing into Parent and Subfolder is not there anymore.

    This is the server i used with Android app 4.8.4

    Image

    Let us know if these are the same steps, or, where were we wrong, thanks!!

  3. blicknix commented on Oct 14, 2026

    @blicknix
    Author
  4. jesmrec commented on Oct 14, 2026

    @jesmrec
    Member

    got it and reproduced. Thanks for reporting

  5. added this to the 5.0 - Current milestone on Oct 14, 2026
  6. self-assigned this
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions