richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Android app cannot open/edit Office documents, but browser editing works

Open phrogpilot73 opened this issue 5 months ago • 13 comments

Describe the bug

When using Nextcloud Office with an external Collabora Online server, Office documents cannot be opened for editing from the Android Nextcloud app.

The issue has been reproduced on multiple Android devices and with a newly-created Nextcloud user account. Browser editing (desktop and mobile) works correctly using the same document, same user, same Nextcloud server, and same Collabora server.

The Android app displays:

"Loading is taking longer than expected"

and the document never opens.

However:

  • Desktop browser editing works correctly.
  • Mobile browser editing works correctly.
  • The Android app can create a new Office document.
  • The Android app can edit and save a newly created document.
  • The saved document is visible and editable from a browser.
  • Re-opening the same document from the Android app fails with the same "Loading is taking longer than expected" message.

The issue reproduces on multiple Android devices and multiple Nextcloud user accounts.


To Reproduce

  1. Open the Nextcloud Android app.

  2. Navigate to an existing Office document (DOCX, XLSX, ODT, etc.).

  3. Tap the document.

  4. Wait for the editor to load.

  5. Observe the message:

    "Loading is taking longer than expected"

  6. The document never opens.

Additional reproduction:

  1. Create a new DOCX document from the Android app.
  2. Edit and save the document.
  3. Close the document.
  4. Attempt to reopen the same document from the Android app.
  5. Observe the same behavior.

Expected behavior

The document should open in Nextcloud Office / Collabora Online for editing, as it does when opened from a desktop or mobile browser.


Screenshots

Android app displays:

"Loading is taking longer than expected"

Image

Client details

  • OS: Android 16
  • Browser: Chrome (also tested with Firefox as default browser)
  • Nextcloud Android App Version: 34.0.0
  • Android System WebView: Current version from Play Store
  • Device 1: Android phone (primary device)
  • Device 2: Separate Android device (same behavior)

Server details

Operating system:

OpenMediaVault (Debian-based)

Web server:

SWAG (Nginx reverse proxy)

Database:

MariaDB 11.4.12

PHP version:

8.4.16

Nextcloud version:

Nextcloud Hub 26 Spring (34.0.0.12)

Version of the richdocuments app

11.0.0

Version of Collabora Online

26.04.1.4


Configuration of the richdocuments app

{
  "disable_certificate_verification": "",
  "doc_format": "ooxml",
  "enabled": "yes",
  "external_apps": "",
  "installed_version": "11.0.0",
  "mobile_editing": "yes",
  "public_wopi_url": "https://collabora.mydomain.org",
  "types": "filesystem,prevent_group_restriction",
  "wopi_allowlist": "172.23.0.0/24,192.168.1.0/24",
  "wopi_url": "https://collabora.mydomain.org"
}

Additional troubleshooting performed

The following were verified:

Nextcloud / Collabora integration

  • Discovery XML loads successfully.
  • WOPI token generation succeeds.
  • WOPI CheckFileInfo requests succeed.
  • Collabora successfully loads the document.
  • Desktop browser editing works.
  • Mobile browser editing works.

Android-specific testing

  • Tested on multiple Android devices.
  • Tested with Chrome as default browser.
  • Tested with Firefox as default browser.
  • Cleared Android app cache and data.
  • Re-authenticated account.
  • Same behavior on all devices.

Nextcloud testing

  • Tested with a completely new user account.
  • Same behavior.
  • Disabled and re-enabled office.
  • Disabled and re-enabled richdocuments.
  • Same behavior.

Redis

Redis was initially misconfigured but has since been corrected.

occ setupchecks now reports:

āœ“ Transactional File Locking
āœ“ Memcache: Configured

No change in Android behavior after Redis was fixed.


Logs

Nextcloud log

When attempting to open a document from the Android app, Nextcloud successfully generates and loads a WOPI token:

Loaded WOPI Token record:
{
  "fileid":3361,
  "canwrite":1,
  "server_host":"https://nextcloud.mydomain.org/"
}

Nextcloud successfully retrieves the Collabora discovery document:

WOPI::getUrlSrc discovery:
<wopi-discovery>
  <net-zone name="external-https">

The discovery document correctly points to:

https://collabora.mydomain.org/browser/.../cool.html

No WOPI authentication failures are logged.

Collabora log

The Android request reaches Collabora:

Nextcloud-android/34.0.0
x-requested-with: com.nextcloud.client

Collabora successfully loads the document:

Returned lokit::documentLoad(file:///tmp/user/docs/.../Ketichan.docx)

Collabora initializes a rendering session:

Initializing for rendering session [...]

The document is successfully loaded and a view is created:

Document url
[https://nextcloud.mydomain.org:443/index.php/apps/richdocuments/wopi/files/...]
for session [...] loaded view [4].
Have 1 view.

At this point the Android app still displays:

Loading is taking longer than expected

and never opens the editor.

Additional recurring warning

The following exception appears repeatedly in Nextcloud logs:

Exception: fclose(): supplied resource is not a valid stream resource

/config/www/nextcloud/apps/richdocuments/lib/Service/RemoteService.php
line 73

Stack trace:

OCA\Richdocuments\Service\RemoteService->convertFileTo()
OCA\Richdocuments\Preview\Office->getThumbnail()
OC\Preview\GeneratorHelper->getThumbnail()

This appears to occur during thumbnail/preview generation and is present for both browser and Android editing sessions, so it may be unrelated to the Android-specific issue.

The document is successfully opened by LibreOfficeKit.

No document load failure is reported.

phrogpilot73 avatar Jun 12 '26 00:06 phrogpilot73

Same behavior on iOS - after upgrade to NC34/Nextcloud Office 11.0.0 no dokument is able to be opened in mobile. We are using a external Collabora (with own Subdomain) with their docker Container

Timschgi avatar Jun 12 '26 05:06 Timschgi

The thumbnail/preview generation problem you highlighted at the end looks like https://github.com/nextcloud/richdocuments/issues/5743, which is already being fixed by https://github.com/nextcloud/richdocuments/pull/5755. I doubt that these would have any impact on mobile editing, especially since the issue you are describing happens only on 34+ (that I can tell from reports, anyway).

I am wondering if this issue is related to https://github.com/nextcloud/richdocuments/issues/5758, or if that issue is a duplicate of this one. My guess is that it has something to do with https://github.com/nextcloud/richdocuments/pull/5656.

Your analysis is already very helpful. So, browser editing works on mobile, but editing directly from the app is the thing that is not working? But you're able to initially edit it from mobile but then cannot re-open it?

elzody avatar Jun 12 '26 18:06 elzody

Your analysis is already very helpful. So, browser editing works on mobile, but editing directly from the app is the thing that is not working? But you're able to initially edit it from mobile but then cannot re-open it?

Sorry if it was a little bit confusing/obtuse, I posted it late yesterday after two days of chasing everything down on my server that could have been causing it.

I can create and save documents on the mobile app. If I try to open and edit an existing document on the Nextcloud server (even the one I just created and saved), that's when the "Loading is taking longer than expected" appears.

On the mobile browser (both Firefox and Chrome), it acts exactly as if I was on a browser on my desktop or laptop. No issues whatsoever.

phrogpilot73 avatar Jun 12 '26 18:06 phrogpilot73

I am having this issue as well. Several fresh installs/upgrades/roll-backs later I can say for sure that it is related to version 34. I am not sure if this is a clue, but when running Android debugging, I noticed a difference between the working vs. non-working operations.

The following operations work, and they have in common that a com.owncloud.android.ui.activity.RichDocumentsEditorWebView is created:

  • Opening an existing document/sheet on a server running version 33
  • Creating and opening (in the same operation) a document/sheet on a server running version 34

On the contrary, just opening an existing document on version 34 does not work, and in the logs there is no reference to RichDocumentsEditorWebView. Instead, the apps seems to open a "com.owncloud.android.ui.activity.TextEditorWebView". There is no reference at all to RichDocuments in my logs when opening an existing document in version 34.

As a sidenote, the document creation dialouge in the Android app is really really slow and buggy. But thats an entirely other issue.

aerodinamica avatar Jun 14 '26 07:06 aerodinamica

Can confirm this issue occurs on my setup as well.

Environment:

  • Nextcloud Server: Linuxserver.io Nextcloud 34.0.0 image running in a Podman container
  • Reverse Proxy: Caddy
  • Clients: iPad (iOS Nextcloud App 33.0.9.1) & Android (App 34.0.0)
  • Office Integration: Nextcloud Office / Collabora Online Development Edition 26.04.1.4

Behavior:

  • iOS/iPadOS App: Returns a "Page not found" (404) error when opening any document.
  • Android App: Hangs on an infinite loading screen.
  • Web Browser (PC & Mobile Safari/Chrome): Documents open and can be edited without any issues.

SirAbgehoben avatar Jun 14 '26 11:06 SirAbgehoben

Same issue since i upgraded my Nextcloud to version 34 (Docker). Sucks big time!

gitslut1 avatar Jun 15 '26 09:06 gitslut1

I see the same behavior with

Nextcloud 34.0.0
Richdocuments 11.0.0
Collabora Online COOLWSD 25.04.9.4
Nextcloud Android app 33.1.0

and also the 404 on /apps/files/directEditing/ (mentioned in #5758 )

StijnVanhandsaeme avatar Jun 18 '26 14:06 StijnVanhandsaeme

Same issue for me

I see the same behavior

My Environment:

* Nextcloud Server: 34.0.0.12
* Clients: Nextcloud iOS app 33.0.9.1 (issue also reported on Android in this thread)
* Office Integration: Richdocuments 11.0.0 + external/self-hosted Collabora Online Development Edition 26.04.1.4 (build 7d478de54b), behind a reverse proxy

Behavior:

* iOS/iPadOS App: Returns a "Page not found" (404) error when opening any document.
* Web Browser (PC & Mobile Safari/Chrome): Documents open and can be edited without any issues.

Log evidence

With Nextcloud loglevel set to 0 (debug), I captured the exact request sequence when tapping a file to open it in the iOS app: POST /ocs/v2.php/apps/richdocuments/api/v1/document -> user: eddy (authenticated)

GET /apps/files/directEditing/{token} -> user: -- (NOT authenticated)

The first request (createDirect) succeeds and is correctly authenticated as my user. The very next request to /apps/files/directEditing/{token} is logged with "user":"--", meaning Nextcloud processes it as an anonymous/unauthenticated request, resulting in a 404 instead of opening the editor.

This suggests the app loses session context (cookie/auth) between generating the direct-editing token and following the resulting link.

Ruled out on my side (all already correctly configured before testing):

- WOPI allowlist
- SSL certificate trust between Nextcloud and Collabora
- `mobile_editing` config flag
- Disabling/re-enabling `richdocuments` and `office` apps
- App cache cleared, account re-logged-in

eddyv321 avatar Jun 21 '26 13:06 eddyv321

I’m having a similar problem: I can open and edit documents on my Android smartphone, but as soon as I close the app and Collabora Online terminates the connection, the changes are lost.

When using a browser on Windows, everything is saved immediately, and the user disappears from the Collabora admin panel right away once the file is closed.

However, when editing on Android, the user remains listed as online in the Collabora admin panel.

I suspect the changes are only being stored in the cache, so naturally, they vanish once Collabora drops the connection...

Moto1987 avatar Jun 25 '26 11:06 Moto1987

I’m having a similar problem: I can open and edit documents on my Android smartphone, but as soon as I close the app and Collabora Online terminates the connection, the changes are lost.

When using a browser on Windows, everything is saved immediately, and the user disappears from the Collabora admin panel right away once the file is closed.

However, when editing on Android, the user remains listed as online in the Collabora admin panel.

I suspect the changes are only being stored in the cache, so naturally, they vanish once Collabora drops the connection...

I have this exact issue. I have made some interesting finds in the logs, but I am not really done with the investigation. Are you by any chance running Nextcloud behind a separate Caddy instance?

Edit: We should probably break this one out to a separate issue, since this affects version 33 as well.

aerodinamica avatar Jun 25 '26 12:06 aerodinamica

I’m having a similar problem: I can open and edit documents on my Android smartphone, but as soon as I close the app and Collabora Online terminates the connection, the changes are lost.

When using a browser on Windows, everything is saved immediately, and the user disappears from the Collabora admin panel right away once the file is closed.

However, when editing on Android, the user remains listed as online in the Collabora admin panel.

I suspect the changes are only being stored in the cache, so naturally, they vanish once Collabora drops the connection...

I have this exact issue. I have made some interesting finds in the logs, but I am not really done with the investigation. Are you by any chance running Nextcloud behind a separate Caddy instance?

Edit: We should probably break this one out to a separate issue, since this affects version 33 as well.

I have an npm proxy running on a separate computer and installed nextcloud as a snap version.

Current Nextcloud Snap version is 33.0.5

Moto1987 avatar Jun 25 '26 12:06 Moto1987

I'm experiencing this same exact issue as well. Running the latest Nextcloud AIO Docker image, behind Pangolin tunneled reverse proxy. Attempted to open a default docx file after initial install on my Android device with the latest version of the Nextcloud app. Here's the versions of everything:

  • Nextcloud Android app: 34.0.1
  • Nextcloud Hub 26 Spring: 34.0.1
  • Collabora Online Development Edition: 26.04.1.3
  • Richdocuments: 11.0.0

Same thing as everyone else, works in the browser on the phone app, but on the Android app it pops up saying "Loading is taking longer than expected".

Edit: Seems like a similar issue on ticket #5758.

GardenOfWyers avatar Jun 26 '26 16:06 GardenOfWyers

+1 here. Nextcloud for Android doesn't open Word, Excel & PDFs. It is stuck in loading (forever)

Tried with: NextCloud for Android: 34.0.0 & 34.0.1 NextCloud server: 34.0.1.2 (running as docker container) Richdocuments: 11.0.0 Collabora (CODE): 26.04.1.4

felipesanescobar-pixel avatar Jun 30 '26 09:06 felipesanescobar-pixel

3 weeks and no activity, update or anything?

2Rukus avatar Jul 01 '26 18:07 2Rukus

I'm facing the same Issue here with: Nextcloud 34.0.1 Collabora 11.0.0 Nextcloud Android App: 34.0.1 Possibly related to https://github.com/nextcloud/richdocuments/issues/5758

Benny7623 avatar Jul 07 '26 09:07 Benny7623

Guess I'll switch to onlyoffice until this gets fixed :(

2Rukus avatar Jul 07 '26 20:07 2Rukus

I'm also facing a similar issue, with the most recent version as of the time I'm writing this.

As3r1408 avatar Jul 08 '26 05:07 As3r1408

Will Collabora still be supported in the Future? Or is this Bug the End of Life of Collabora and will only the new Onlyoffice be supported?

Benny7623 avatar Jul 08 '26 07:07 Benny7623

Same issue here

raphamotta avatar Jul 10 '26 10:07 raphamotta

I think this issue #5758 is related and is already fixed.

ruiaraujo012 avatar Jul 10 '26 10:07 ruiaraujo012