Skip to content

File Manager, other apps unable to access Nextcloud documents #15857

Description

@gbakeman

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

When trying to open a file in Nextcloud using a file manager:

  1. Use an app that supports opening files using a file manager app (such as KeePassDX opening a password database file)
  2. Find the Nextcloud provider in the hamburger menu
  3. Presented with an error (in my case, "Can't load content at the moment")

Image

When trying to open the file using a third party app (KeePassDX) that had a URI at one point:

  1. Select file from recently opened list
  2. Receive an "Access to the file revoked by the file manager" and "Permission Denial: opening provider androidx.core.content ..."

Image

Expected behaviour

Files and documents are presented without error

Actual behaviour

Multiple errors encountered

Android version

OxygenOS 9.0.16 (Android 9)

Device brand and model

Oneplus 6T

Stock or custom OS?

Stock

Nextcloud android app version

3.34.0

Nextcloud server version

31.0.9

Using a reverse proxy?

Yes

Android logs

1761492878.860 10248 30370 30784 D UriUtil : Take read permission content://org.nextcloud.files/external_files/emulated/0/Android/media/com.nextcloud.client/nextcloud/[my NC user]%40[my current, valid NC host]/passwords.kdbx
1761492878.861 10248 30370 30784 E UriUtil : java.lang.SecurityException: No persistable permission grants found for UID 10248 and Uri content://org.nextcloud.files/external_files/emulated/0/Android/media/com.nextcloud.client/nextcloud/[my NC user]@[my current, valid NC host]/passwords.kdbx [user 0]
1761492881.967 10047 27917 30837 W LastAccessedStorage: java.io.FileNotFoundException: Failed to find matching mRoot for Root{authority=org.nextcloud.documents, rootId=[my NC user]@[my old, invalid NC host]/nextcloud, title=Nextcloud, isUsb=false, isSd=false, isMtp=false} @ content://org.nextcloud.documents/root/[my NC user]%40[my old, invalid NC host]%2Fnextcloud
1761492882.051 10047 27917 28223 W Documents: Failed to load org.nextcloud.documents, [my NC user]@[my current, valid NC host]
1761492884.370 10047 27917 28223 W DocumentAccess: Couldn't create DocumentInfo for uri: content://org.nextcloud.documents/document/null
1761492884.391 10047 27917 27917 E GetRootDocumentTask: Cannot find document info for root: Root{authority=org.nextcloud.documents, rootId=[my NC user]@[my current, valid NC host], title=Nextcloud, isUsb=false, isSd=false, isMtp=false} @ content://org.nextcloud.documents/root/[my NC user]%40[my current, valid NC host]

Note: Interestingly, both my current NC server host and my old, invalid host show up in these log entries. Some time ago I migrated my data to a docker container and changed the hostname along with it. I cleared out my old account info in the Nextcloud app and added the new account info. My third-party app has been using files from the new host.

Server error logs

Additional information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions