Skip to content

Duplicate first-level folders in Nextcloud external storage when sharing files #17856

Open

Description

@piiskop

⚠️ 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

  1. Open MyPeugeot or Google Photos on an Android 16 device.
  2. Select a file and use Share → Nextcloud.
  3. Navigate to an external storage folder named 20tb.
  4. Observe that all first-level folders are listed twice, with different modification dates.
  5. Open either copy. The newer one initially appears empty, but its contents become visible after waiting.
  6. Both copies ultimately lead to the same files and subfolders.

Expected behaviour

Each folder should appear only once. The folder contents should load normally.

Actual behaviour

When sharing a file from MyPeugeot or Google Photos to Nextcloud, all first-level folders inside the external storage 20tb appear twice, with different modification dates.

The newer entries initially appear empty, but their contents become visible after waiting. Both entries lead to the same files and subfolders.

Subfolders at deeper levels are displayed only once. When browsing directly in the Nextcloud app, there are no duplicates.

The problem is reproducible from multiple apps.

Android version

16

Device brand and model

Motorola Edge 60

Stock or custom OS?

Stock

Nextcloud android app version

35.0.1

Nextcloud server version

34.0.3

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

Additional information

The issue occurs only in the external storage 20tb, not in the regular Nextcloud folders.

It is reproducible when sharing files from both MyPeugeot and Google Photos.

The duplicate entries have different modification dates but eventually display identical contents. No actual duplicate folders have been observed on the server.

Android and server logs have not been collected yet. They can be provided if needed.

Activity

  1. daniele-verducci commented on Oct 21, 2026

    @daniele-verducci
    Contributor

    Hey @piiskop , I spent a fair amount of time trying to reproduce the issue on two different servers (one with an existing very big external storage, and one in a docker instance I specifically set up for this issue that replicates your setup), but I wasn't able to reproduce it unfortunately.
    Can you check I'm doing the right way?

    Screen_recording_20261021_182935.webm

    Can you provide more info? Specifically what kind of external share is (webdav, local filesystem, sftp...) and how it's setup. Can you confirm the duplication appears only on the share chooser but not in the Files app or in the web version?
    Logs here could be useful, in this case both the Android's one and the server's one.

  2. added
    needs infoWaiting for info from user(s). Issues with this label will auto-stale.
    and removed on Oct 21, 2026
  3. piiskop commented on Oct 22, 2026

    @piiskop
    Author

    Thanks for taking the time to investigate and for providing the video!

    I watched your recording and can confirm that you are following the correct steps. The difference is that, in my case, every first-level folder inside 20tb appears twice in the upload destination chooser, with different modification dates.

    The external storage is configured as follows:

    • Storage type: SMB/CIFS (Windows network share)
    • Mount point: /20tb
    • Authentication: Login and password
    • Share name: 20tb
    • Read-only: No
    • Nextcloud server: 34.0.3
    • Nextcloud Android: 35.0.1
    • Device: Motorola Edge 60, Android 16

    I have also checked the Nextcloud web interface. There are no duplicates there, nor in the regular Nextcloud Android file browser.

    The issue occurs only in the upload destination chooser when sharing from other applications (confirmed with both MyPeugeot and Google Photos).

    Both copies lead to the same contents. The newer entry initially appears empty, but its contents become visible after waiting. Deeper subfolders are displayed only once.

    Was the external storage in your test also configured using SMB/CIFS?

    I have not collected Android or server logs yet, but can provide them if necessary.

  4. 6801318d8d commented on Oct 26, 2026

    @6801318d8d

    We have a fix

  5. jfpesant commented on Oct 26, 2026

    @jfpesant

    I got the exact same issue.

    Android version
    17

    Device brand and model
    Pixel 9

    Stock or custom OS?
    Custom (GrapheneOS)

    Nextcloud android app version
    35.0.1

    Nextcloud server version
    34.0.5.1 (installed as snap on Ubuntu)

  6. LemonHard commented on Nov 6, 2026

    @LemonHard

    Hi,

    I'm experiencing a similar issue with Nextcloud Dev (F-Droid), but with some differences that may help identify the cause.

    Environment

    • Device: Xiaomi Redmi Note 15 4G
    • Android client: Nextcloud Dev (F-Droid), updated on November 6, 2026
    • Version : 20261010
    • Integration: Android Storage Access Framework (SAF) / Nextcloud DocumentsProvider
    • Nextcloud server: Self-hosted

    Actual behavior

    • Every folder and file appears twice throughout the entire directory tree, not just at the root or first level.
    • The first entry works normally and opens the expected content.
    • The second, identically named entry does not open anything.
    • The issue occurs when browsing Nextcloud through Android's storage/document provider.
    • Browsing the same folders directly inside the Nextcloud Android app works correctly, with no duplicates.
    • Updating Nextcloud Dev did not resolve the issue.

    Expected behavior

    Each file and folder should appear exactly once in the Android document picker, and every displayed entry should be functional.

    Difference from the original report

    Unlike the original issue, the duplication affects the entire directory hierarchy, rather than only the first level of an external SMB/CIFS storage.

    Also, the second entry is completely non-functional, rather than eventually loading its contents.

    This seems related to how Nextcloud's DocumentsProvider exposes or indexes entries through Android SAF, although the root cause is not confirmed.

    I can provide additional diagnostic information if needed.

  7. piiskop commented on Nov 6, 2026

    @piiskop
    Author

    Thanks @LemonHard for the additional report. I also noticed PR #17885, which proposes a fix for duplicate local file entries caused by concurrent folder refreshes.

    Could the maintainers clarify two points?

    1. Is PR fix: prevent and clean up duplicate file entries from concurrent folder refreshes #17885 expected to fix both the original behaviour reported here (duplicate first-level folders in the external SMB/CIFS storage when choosing an upload destination) and LemonHard's case (every file and folder duplicated at all levels in Android SAF / DocumentsProvider, with the second entry not opening)? Or should the latter be tracked separately?
    2. If fix: prevent and clean up duplicate file entries from concurrent folder refreshes #17885 is the intended fix, which Nextcloud Android release or test build will include it, and how can we verify that it has been merged or backported?

    I can retest the original issue on my Motorola Edge 60 once a build containing the fix is available.

  8. taz-man73 commented on Nov 14, 2026

    @taz-man73

    I would like to share that I have the same issue on my setup.
    Only the first level folders are duplicated and some with different dates, and only when I use the share function of my smartphone to send files to Nextcloud. Once entered inside one first level folder, the subfolders are no more duplicated.
    When I use the app to navigate, the first level folders are not duplicated. Same when I use a web browser on my computer, first level folders are note duplicated.
    The bug appears only when using the sharing function og my smartphone.

    Android version
    17

    Device brand and model
    Samsung S25 Edge

    Stock or custom OS?
    Stock

    Nextcloud android app version
    35.0.2

    Nextcloud server version
    Nextcloud Hub 26 Summer (35.0.2).

    Nextcloud server setup
    My server is AIO running on docker in Ubuntu server and it uses local server disks for data storage.

    Using a reverse proxy?
    Yes

  9. 6801318d8d commented on Nov 14, 2026

    @6801318d8d

    I would like to share that I have the same issue on my setup. Only the first level folders are duplicated and some with different dates, and only when I use the share function of my smartphone to send files to Nextcloud. Once entered inside one first level folder, the subfolders are no more duplicated. When I use the app to navigate, the first level folders are not duplicated. Same when I use a web browser on my computer, first level folders are note duplicated. The bug appears only when using the sharing function og my smartphone.

    Android version 17

    Device brand and model Samsung S25 Edge

    Stock or custom OS? Stock

    Nextcloud android app version 35.0.2

    Nextcloud server version Nextcloud Hub 26 Summer (35.0.2).

    Nextcloud server setup My server is AIO running on docker in Ubuntu server and it uses local server disks for data storage.

    Using a reverse proxy? Yes

    The issue can be fixed with my PR #17885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds infoWaiting for info from user(s). Issues with this label will auto-stale.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions