Repository navigation
Description
⚠️ Before posting ⚠️
- This is a bug, not a question or an enhancement.
- I've searched for similar issues and didn't find a duplicate.
- I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
- Have the NextCloud app installed and configured.
- Navigate the cloud storage through another app, for example the builtin Files app or Material Files where it is added as External Storage.
Expected behaviour
The directories and files should be listed as expected.
Actual behaviour
Some times directory contents are listed twice, or no directory content is shown at all, even though it works correctly in the NextCloud app directly.
Android version
16
Device brand and model
Samsung Galaxy Tab S6 Lite
Stock or custom OS?
Custom (explain in "additional information")
Nextcloud android app version
33.1.0
Nextcloud server version
32.0.9
Using a reverse proxy?
No
Android logs
Accessing a directory with no content being shown leads to the following log repeating over and over:
05-14 15:35:00.490 5730 7715 D RefreshFolderOperation: ⬇ eTag is changed or ignored, fetching folder: USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.501 5730 7715 D RefreshFolderOperation: Remote folder path: /THAT/FOLDER/I/ACCESSED/ changed - starting update of local data
05-14 15:35:00.507 5730 7715 D FileDataStorageManager: getFolderContent - start
05-14 15:35:00.518 5730 7715 D FileDataStorageManager: getFolderContent - finished
05-14 15:35:00.522 5730 7715 E RefreshFolderOperation: DecryptedMetadata for file 9910 not found!
05-14 15:35:00.522 5730 7715 D FileDataStorageManager: Saving folder /THAT/FOLDER/I/ACCESSED/ with 28 children and 0 files to remove
05-14 15:35:00.536 5730 7715 D FileDataStorageManager: Sending 29 operations to FileContentProvider
05-14 15:35:00.536 5730 7715 D FileContentProvider: applying batch in provider com.owncloud.android.providers.FileContentProvider@c48af7a (temporary: false)
05-14 15:35:00.549 5730 7715 D FileContentProvider: applied batch in provider com.owncloud.android.providers.FileContentProvider@c48af7a
05-14 15:35:00.549 5730 7715 D FileDataStorageManager: saving file: /THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.561 5730 7715 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
05-14 15:35:00.561 5730 7715 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
05-14 15:35:00.566 5730 5771 D DocumentsStorageProvider: queryChildDocuments(), id=31b2fccbc99010679162a61a6520b18c/9922
05-14 15:35:00.568 5730 5771 D FileDataStorageManager: getFolderContent - start
05-14 15:35:00.572 5730 5771 D FileDataStorageManager: getFolderContent - finished
05-14 15:35:00.574 5730 7715 D DocumentsStorageProvider: run ReloadFolderDocumentTask(), id=31b2fccbc99010679162a61a6520b18c/9922
05-14 15:35:00.575 5730 7715 D RefreshFolderOperation: Checking changes in USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.575 5730 7715 D OwnCloudClient #0: REQUEST PROPFIND /cloud/remote.php/dav/files/USERNAME/THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.698 5730 7715 D RefreshFolderOperation: Ignoring eTag. mRemoteFolderChanged is true.
05-14 15:35:00.699 5730 7715 I RefreshFolderOperation: Checked USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/ : changed
05-14 15:35:00.700 5730 7715 D OwnCloudClient #0: REQUEST PROPFIND /cloud/remote.php/dav/files/USERNAME/THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.876 5730 7715 I ReadFolderRemoteOperation: Synchronized /THAT/FOLDER/I/ACCESSED/: Operation finished with HTTP status code 207 (success)
05-14 15:35:00.876 5730 7715 D RefreshFolderOperation: ⬇ eTag is changed or ignored, fetching folder: USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.887 5730 7715 D RefreshFolderOperation: Remote folder path: /THAT/FOLDER/I/ACCESSED/ changed - starting update of local data
05-14 15:35:00.897 5730 7715 D FileDataStorageManager: getFolderContent - start
05-14 15:35:00.904 5730 7715 D FileDataStorageManager: getFolderContent - finished
05-14 15:35:00.908 5730 7715 E RefreshFolderOperation: DecryptedMetadata for file 9910 not found!
05-14 15:35:00.908 5730 7715 D FileDataStorageManager: Saving folder /THAT/FOLDER/I/ACCESSED/ with 28 children and 0 files to remove
05-14 15:35:00.918 5730 7715 D FileDataStorageManager: Sending 29 operations to FileContentProvider
05-14 15:35:00.918 5730 7715 D FileContentProvider: applying batch in provider com.owncloud.android.providers.FileContentProvider@c48af7a (temporary: false)
05-14 15:35:00.930 30390 30390 D BoundBrokerSvc: onRebind: Intent { act=com.google.android.gms.libs.gmscorelogger.service.START dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentDirectBootAwareApiService }
05-14 15:35:00.944 5730 7715 D FileContentProvider: applied batch in provider com.owncloud.android.providers.FileContentProvider@c48af7a
05-14 15:35:00.944 5730 7715 D FileDataStorageManager: saving file: /THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.957 5730 7715 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
05-14 15:35:00.957 5730 7715 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
05-14 15:35:00.961 5730 5771 D DocumentsStorageProvider: queryChildDocuments(), id=31b2fccbc99010679162a61a6520b18c/9922
05-14 15:35:00.966 5730 5771 D FileDataStorageManager: getFolderContent - start
05-14 15:35:00.981 5730 5771 D FileDataStorageManager: getFolderContent - finished
05-14 15:35:00.984 5730 7715 D DocumentsStorageProvider: run ReloadFolderDocumentTask(), id=31b2fccbc99010679162a61a6520b18c/9922
05-14 15:35:00.986 5730 7715 D RefreshFolderOperation: Checking changes in USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/
05-14 15:35:00.987 5730 7715 D OwnCloudClient #0: REQUEST PROPFIND /cloud/remote.php/dav/files/USERNAME/THAT/FOLDER/I/ACCESSED/
05-14 15:35:01.141 5730 7715 D RefreshFolderOperation: Ignoring eTag. mRemoteFolderChanged is true.
05-14 15:35:01.141 5730 7715 I RefreshFolderOperation: Checked USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/ : changed
05-14 15:35:01.143 5730 7715 D OwnCloudClient #0: REQUEST PROPFIND /cloud/remote.php/dav/files/USERNAME/THAT/FOLDER/I/ACCESSED/
05-14 15:35:01.318 5730 7715 I ReadFolderRemoteOperation: Synchronized /THAT/FOLDER/I/ACCESSED/: Operation finished with HTTP status code 207 (success)
05-14 15:35:01.318 5730 7715 D RefreshFolderOperation: ⬇ eTag is changed or ignored, fetching folder: USERNAME@NEXTCLOUD.HOST/cloud/THAT/FOLDER/I/ACCESSED/
05-14 15:35:01.331 5730 7715 D RefreshFolderOperation: Remote folder path: /THAT/FOLDER/I/ACCESSED/ changed - starting update of local data
05-14 15:35:01.337 5730 7715 D FileDataStorageManager: getFolderContent - start
05-14 15:35:01.345 5730 7715 D FileDataStorageManager: getFolderContent - finished
05-14 15:35:01.349 5730 7715 E RefreshFolderOperation: DecryptedMetadata for file 9910 not found!
05-14 15:35:01.349 5730 7715 D FileDataStorageManager: Saving folder /THAT/FOLDER/I/ACCESSED/ with 28 children and 0 files to remove
05-14 15:35:01.359 5730 7715 D FileDataStorageManager: Sending 29 operations to FileContentProvider
05-14 15:35:01.360 5730 7715 D FileContentProvider: applying batch in provider com.owncloud.android.providers.FileContentProvider@c48af7a (temporary: false)
05-14 15:35:01.374 5730 7715 D FileContentProvider: applied batch in provider com.owncloud.android.providers.FileContentProvider@c48af7a
05-14 15:35:01.374 5730 7715 D FileDataStorageManager: saving file: /THAT/FOLDER/I/ACCESSED/
05-14 15:35:01.385 5730 7715 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
05-14 15:35:01.385 5730 7715 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
05-14 15:35:01.390 5730 5771 D DocumentsStorageProvider: queryChildDocuments(), id=31b2fccbc99010679162a61a6520b18c/9922
05-14 15:35:01.392 5730 5771 D FileDataStorageManager: getFolderContent - start
05-14 15:35:01.396 5730 5771 D FileDataStorageManager: getFolderContent - finished
Server error logs
Additional information
This has started happening a month or two back, most likely with the 33 release. Directory or file size doesn't seem to matter, it appears to be rather random. Some times navigating to the directory again produces the content, some times it doesn't. Accessing the directories through the NextCloud app always works.
Android version doesn't matter, I'm seeing this on 10 and 16. Whether the server is in the LAN or WAN doesn't matter, happens on both. Third party app doesn't matter, this happens in Material Files and through the builtin Files app. This happened also on a new Android 16 installation with 33 being the first version installed.
Activity
xundeenergie commentedon May 24, 2026
I have the ssme problrm on all my devices with graphene-OS.
When i view folders containing images, the images are shows only once in the folder.
Then i open an image, the app tries to open the image... and stuck. I swipe to the next image, and the first is shown. I swipe back, and it is shown again.
It happens to almost all images.
Viewing an image shows it twice, while swiping through the images.
When i try to attach an image to an upload-website and i use the filebrowser sn choose "nextcloud" app, all folders and images are shown twice in this browser
But this happens NOT on all folders!
As you can see here
Sometimes, when i move images on the server to a new location, they are shown only once.
Newly uploaded are shown always twice.
I thought it started with changing to nextcloud aio on the server, but i can verify it with my bare metal installation too.
The behaviour of loading (not loading the first try, swiping to the next and see the first, seiping back, see it a second time) let me think, that the app loafs a preview an shows ist, and the load the preview again and shows it a second time.
This only happenswith the nextcloud app (android). Memories shows images only once.
It happens also with nextcloud-dev app on android!
xundeenergie commentedon May 25, 2026
I think it's a caching problem eith slow connection, that the app shows images snd folder twice.
I added my old nextcloud again to the app and viewed some photos there.
Some images are loaded instantly snd they are shown only once.
Then i had an image, ehich took 3 seconds to be loaded... and it is shown twice.
The next image was loaded fast, it is shown only once.
The folder itself was loaded very fast eith sll its preview images.
I opened another folder, which took 10 seconds and more and shows nothing. An empty folder.
Step one folder up, and again down.
Now it also took several seconds, then the content was shown and thumnails are loaded.
Now i open sn image and swipe through the next image... each and every image in this folder now is shown twice.
Went back to the first folder, each image is shoen only once, exept the one, which took longer to be loaded. This is again shown twice.
The nextcloud app notifies in android "an error occured on downloading" several times. I think for each image and folder, which took longer and is shown on the next try twice. But the error-notifications don't say on ehich element the error occured.
danielw01 commentedon Jun 13, 2026
have the same issue when browsing nextcloud content from grapheneos built in file browser
nc_bug.log
Kompanjero commentedon Sep 27, 2026
I am experiencing very similar symptoms with Nextcloud Android 35.0.0 on all three of these devices:
The exact Nextcloud server version is currently unknown.
Folders appear multiple times when accessing Nextcloud through Android's Storage Access Framework (SAF). The normal Nextcloud app displays them correctly. On the Yoga, one folder entry works while another entry with the same name appears empty. Triple entries have also been observed on the TB-J616F.
Controlled reproduction on the Yoga
Additional finding from ADB logcat
Two different document IDs with the same account prefix resolve to the same remote folder path. The folder name is anonymized below as
/Example/:queryChildDocuments()for document ID ending in/214834. The subsequent reload resolves to/Example/. This is the working entry./214827.queryChildDocuments()for document ID ending in/214843. The subsequent reload resolves to the same/Example/path. This entry appears empty.Both entries trigger PROPFIND requests for the same WebDAV path.
Even after opening the empty entry, the log reports HTTP 207 (success) and saves the folder with 9 children and 0 files to remove. Child queries and folder refreshes then repeat several times.
Resetting DocumentsUI did not resolve the issue. Direct inspection of the app database was not possible because the installed package is not debuggable.
This may be related to the issue reported here, but we have not established the root cause. In particular, duplicate local records or incorrect parent/child associations remain hypotheses, not confirmed findings.
Would a sanitized log excerpt covering both document IDs and their refresh operations help investigate this?
NotMilk commentedon Oct 6, 2026
This is happening to me, Samsung S24 Ultra - deleting cache, and data solves for a few minutes if I am lucky.
If there is additional data I can provide, LMK. Looks like there are already a lot of contributors pointint this one out.
PeterPablo commentedon Nov 9, 2026
One datapoint that may narrow this — two SAF consumers against the same Nextcloud root, same device, minutes apart:
Environment: HONOR 200, Android 16 / MagicOS 10 (10.0.0.167) · Nextcloud 35.0.2 (the app reports the same version string) · Material Files 1.7.5 (40) · Twig 1.17.0.
/as external storage: folders list normally, no duplicates, contents open./and every folder is listed twice. Opening either copy fails withjava.nio.fileSystemException: /tmp: java.lang.InterruptedException— no further detail in Material Files' error dialog.
What does work: selecting a subfolder in the picker instead (here
tmp) and adding that. It then browses normally, documents open in the editor, and — for what it is worth — a save from that path does reach Nextcloud (new size, new version).So in our case the tree is fine and one consumer reads it correctly, while the other gets doubled entries and an exception on open. That reads like a query/listing pattern the provider answers wrongly rather than a broken tree — maybe the duplicated
queryChildDocumentsresult is what the second consumer then trips over. Happy to run a debug build or hand over logs if that helps; the exception above is reproducible on demand.#AI-ASSISTED— comment drafted with AI assistance; every value above was read off the device or our server; the two results come from separate sessions on the same day.PeterPablo commentedon Nov 9, 2026
A correction to my own datapoint above (Twig "no duplicates"), because I have since measured it properly and it was wrong — or rather, it was measuring a different source:
Twig's own WebDAV mount never doubles; the SAF document tree does. Same phone, same hour, both mounts of the same account: a WebDAV mount of the same Nextcloud account (
webdav://cloud.example.org/remote.php/dav/files/<user>/) lists every folder once, while Dokumentenbaum (SAF) → Nextcloud lists each top-level folder twice (identical name and identical mtime) — exactly like Material Files.That comparison also localises the defect, which may save someone a bisect: Twig maps the provider cursor 1:1. Its listing is a single query —
— and one output row per cursor row, with no merge and no second source. So a duplicated folder on screen means the cursor contained it twice, i.e. the provider handed out two rows for one directory entry.
Where that can come from, from reading
stable-35.0.2:queryChildDocumentswalksstorageManager.getFolderContent(parentFolder.getFile(), false), which ends in the Room DAO'sA plain select with no join — it can only return a directory twice if
filelistholds two rows with the sameparentandfilename. That fits the "clear app data and it is fine for a while" reports as well: a rebuilt database has one row each.I cannot read the app's database on a release build (no
run-as), so I have not proven the duplicate rows — it is a prediction with a specific next test: count rows for one folder in a debuggable build. Happy to file that separately rather than guess here.#AI-ASSISTED
PeterPablo commentedon Nov 9, 2026
Root cause, from the source at
stable-35.0.2— it is the provider handing out two rows for one entry, and the chain is three facts:filelisthas no unique index. The Room schema (app/schemas/com.nextcloud.client.database.NextcloudDatabase/106.json) declares_id INTEGER PRIMARY KEY AUTOINCREMENTand zero indices. Nothing in the database forbids two rows for the same file.FileContentProvider.upsertSingleFilecannot ever resolve a conflict. It starts withdb.insert(FILE_TABLE_NAME, CONFLICT_IGNORE, values)and only falls back toUPDATE … WHERE path=? AND file_owner=?if that insert fails. The values come fromcreateContentValuesBase, which does not put_id— so with no constraint to violate the insert always succeeds, and the update branch is unreachable fromsaveFile. For these writes the function is insert-only, whatever its name says.The only thing preventing a twin is an inexact pre-check.
FileDataStorageManager.saveFileguards withfileExists(path)→getFileByEncryptedRemotePath(path, accountName)— an exact string match, filtered by account name. The same class'sgetFileByRemotePathexplicitly tolerates a missing trailing slash (path, thenpath + "/"). Two writers that disagree about/tmpvs/tmp/, or about the account name, both pass the guard and both insert.The read side has no safety net either:
SELECT * FROM filelist WHERE parent = :parentId— no owner filter and noDISTINCT. A consumer that maps the cursor 1:1 (which is what the twig app I tested does) therefore shows the folder twice, while the same content is fine everywhere the rows are keyed by path.What a fix would look like, in that order: (a) make
upsertSingleFilean explicit update-or-insert by(path, file_owner)instead of relying on a conflict that cannot happen; (b) a migration that deduplicates the table and then adds a unique index on(path, file_owner), so the invariant lives in the database rather than in every caller's memory; (c) filtergetFolderContentby owner for good measure.What I have not proven: which writer produces the twins on a given device, and whether the app's own list is genuinely clean — there is a
distinctBy { remotePath }inOCShareToOCFileConverter, but the plain list path has none, so "the app shows it correctly" may be an observation rather than a difference in code. A debuggable build with twoSELECT count(*) … WHERE parent=? AND filename=?would settle both.#AI-ASSISTED
fix: one row per file — unique (path, file_owner) index on filelist
PeterPablo commentedon Nov 9, 2026
Proposing a fix for this: #18001 — one row per file: unique
(path, file_owner)index onfilelist.It does not add another guard on the read path; it makes the invariant hold in the database:
_idperpath/file_ownerwins, rows without a path are left alone) and then createsUNIQUE INDEX idx_filelist_path_owner ON filelist (path, file_owner)— declared onFileEntityas well, because Room builds a fresh database from the entity and the migration only reaches installs that already exist;upsertSingleFilefalls back to the stored row when the insert is refused by that index, instead of returning a URI ending in-1.That is the part that matters for the reports in this thread: no code-side fix removes duplicates that are already on a device — clearing app data was the only cure. With the migration they are gone on the first start after the update.
Verified with a migration test plus the existing provider tests on an Android 16 emulator, and on a device against a second build installed beside the current app; details in the PR.
#AI-ASSISTED
xundeenergie commentedon Nov 11, 2026
Is this possibly the reason, why directory-listings are deadly slow in many cases?
Kompanjero commentedon Nov 12, 2026
That coul be possible. I use an App called Dazeimanager+(File Manager Plus) It uses the web.dav path to access Nextcloud and ist works 10times faster and mor efficiently than the nextcloud App.
xundeenergie commentedon Nov 12, 2026
I use cx-datei-explorer, which also uses webdav. And it is also very fast and shows files and dirs only once.