android icon indicating copy to clipboard operation
android copied to clipboard

Can't open this document: "Can't open this document. This file isn't available offline"

Open w9hdg opened this issue 11 months ago • 28 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [X] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

Ensure that your android phone is updated with both the current OS (Android 13 in my case) and current NextCloud app (3.26.0). Attempt to open any file with a .docx, .xlsx, etc. An error screen will pop up saying

"Can't open this document This file isn't available offline. Make file "Available offline" in the file's options menu."

My phone is on the same network as my NextCloud server and collabora works as expected in my browser on my computer and via firefox on my phone.

Expected behaviour

The app previously would load collabora and open the document

Actual behaviour

Receive an error message saying:

"Can't open this document This file isn't available offline. Make file "Available offline" in the file's options menu."

Android version

13

Device brand and model

Google Pixel 7

Stock or custom OS?

Stock

Nextcloud android app version

3.26.0

Nextcloud server version

27.1.0

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

No response

Additional information

No response

w9hdg avatar Sep 17 '23 16:09 w9hdg

I can confirm the same issue.

Device brand and model

  • Google Pixel 6
  • OnePlus

Stock or custom OS?

  • Stock

Nextcloud android app version

  • 3.26.0

Nextcloud server version

  • 27.0.2.

mnheia avatar Sep 18 '23 11:09 mnheia

Also confirming the same issue.

Device brand and model Google Pixel 7a

Stock or custom OS? Stock

Nextcloud android app version 3.26.0

Nextcloud server version 27.0.2

cryologic avatar Sep 18 '23 23:09 cryologic

@w9hdg, @cryologic

I was playing around and it appears to me that the issue is in the fact that config is not set properly. This seems to resolve the issue for me. Can you give it a try?

sudo -u www-data php -f /opt/nextcloud/occ config:app:set richdocuments mobile_editing --value="yes"

Obviously change 'www-data' with your 'web' user and the path '/opt/nextcloud/occ' according to your setup.

mnheia avatar Sep 19 '23 12:09 mnheia

Can you give it a try? sudo -u www-data php -f /opt/nextcloud/occ config:app:set richdocuments mobile_editing --value="yes"

I'm not running the richdocuments app, I'm running a standalone CODE server. Not sure where to allow mobile editing? (I did try the above anyway with understandably no success)

cryologic avatar Sep 19 '23 23:09 cryologic

I run the Nextcloud Office app (with CODE on the same machine as Nextcloud) and adding that setting (it didn't exist before) didn't work for me.

lckarssen avatar Sep 21 '23 11:09 lckarssen

sudo -u www-data php -f /opt/nextcloud/occ config:app:set richdocuments mobile_editing --value="yes"

@mnheia thanks for this hind :+1:

with the Nextcloud integration Collabora Server, i can now edit Office Documents. I try with follow Nextcloud Android App v3.26.0 and DEV v20230921

mr-bolle avatar Sep 21 '23 17:09 mr-bolle

Can confirm setting the flag to yes works..odd how 3.25 didn't honor that setting, but 3.26 does. Thanks for posting the fix.

zpackrat avatar Sep 22 '23 02:09 zpackrat

Confirm with android 3.26 and NC Docker 27.1.1 Thanks a lot!

ralfi avatar Oct 03 '23 16:10 ralfi

If occ config:app:set richdocuments mobile_editing --value="yes" fixes the matter for you then you have #11979 which has since been fixed (it was a richdocuments app bug: nextcloud/richdocuments#3184).

@w9hdg Are you still experiencing this either after applying that fix or upgrading the richdocuments app? THis is your issue so I'll leave it open for now just in case it's not that matter.

@cryologic Did this work previously but stop working for you after updating the Android client... or are you simply unable to open documents?

@lckarssen Did this work previously but stop working for you after updating the Android client... or are you simply unable to open documents?

joshtrichards avatar Oct 15 '23 15:10 joshtrichards

@joshtrichards I just tested again (see also https://github.com/nextcloud/android/issues/12039#issuecomment-1763474298), with these versions:

  • richdocuments: 8.2.0
  • richdocumentscode: 23.5.403

Editing on mobile used to work, before I chimed in on this topic. However, as I don't use this feature often, I can't say for sure when it stopped working.

After I found this issue I tried setting mobile_editing to yes, but that didn't work, so I removed the setting again. Tonight, after seeing your update I tried again, but still no luck.

lckarssen avatar Oct 15 '23 20:10 lckarssen

OK, I just tried to edit on another device, a Lenovo Tab P11 Gen2 I bought recently, and there the remote editing (by directly "clicking" on the file) works fine (my main device is a Samsung S22 phone) :confused:. Both devices run version 3.26.0 of the Nextcloud app. As (just) noted/edited in https://github.com/nextcloud/android/issues/12039#issuecomment-1763493895, using "Edit" in the ... menu for the file does open the (remote) editor.

[Edit]

I tested on two other devices, an older Samsung S2 tablet and an S20FE phone (different user account), and those worked fine too. All devices are connected to the same Nextcloud server.

Back on my S22 I have now also tested opening/editing a file on a different Nextcloud server. That didn't work either.

lckarssen avatar Oct 15 '23 20:10 lckarssen

@cryologic Did this work previously but stop working for you after updating the Android client... or are you simply unable to open documents?

Yes, previous to Android client upgrade, it was working.

cryologic avatar Oct 15 '23 23:10 cryologic

Another data point: I just tested two other Nextcloud servers with my S22. Neither opened the remote editor when "clicking" on the test .odt file. Both servers run Nextcloud 27.1.2, one runs Nextcloud Office app 8.2.0, the other runs version 8.2.1. of the app. Both have CODE running on a separate VM.

lckarssen avatar Oct 16 '23 15:10 lckarssen

I too have issues open office docs on my mobile

  • Realme X50 Pro with Android 12
  • App 3.27.0
  • Server just updated to 27.1.5
  • Nextcloud Office app 8.2.4
  • richdocuments app 8.2.4
  • Collabora Office (CODE) 23.05.7.2

Have tried the mobile_editing setting and that doesnt work

web server - HOMEIPHERE - USERNAME [17/Jan/2024:22:02:01 +0000] "GET /ocs/v2.php/cloud/user?format=json HTTP/2.0" 200 579 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.27.0" "-" "0.278" "SERVERIP:9000" "0.278" TLSv1.3

no logs on the CODE container

mhzawadi avatar Jan 17 '24 22:01 mhzawadi

@mhzawadi v3.27.0 had a specific regression unrelated to whatever is going on here in this issue. Your situation looks like that one. See #12338. It's been fixed and will be in the real-soon-to-be-released v3.27.1

joshtrichards avatar Jan 17 '24 22:01 joshtrichards

@mhzawadi v3.27.0 had a specific regression unrelated to whatever is going on here in this issue. Your situation looks like that one. See #12338. It's been fixed and will be in the real-soon-to-be-released v3.27.1

Thanks for the update, will wait for the next update to see if that fixes it

mhzawadi avatar Jan 18 '24 08:01 mhzawadi

Ensure that your android phone is updated with both the current OS (Android 13 in my case) and current NextCloud app (3.26.0). Attempt to open any file with a .docx, .xlsx, etc. An error screen will pop up saying

"Can't open this document This file isn't available offline. Make file "Available offline" in the file's options menu."

My phone is on the same network as my NextCloud server and collabora works as expected in my browser on my computer and via firefox on my phone.

The original report (I can't speak to the other commenters because they may or may not be the same situation) indicates three things:

  1. Nextcloud Office is not being detected as available by the Android client app server-side (i.e. via the capabilities check) [this would be the specific bug covered in this Issue]
  2. Since there's no server-side editor detected, the Android client is passing the file off to the OS to load it with whatever app(s) have registered themselves locally to open that file [this is expected behavior when there's no server-side editor detected]
  3. The local app(s) are having a problem opening our provided link to the file [this is the cause of the "Can't open this document. This file isn't available offline" dialog, which is from the OS and not the client but we may still be contributing to the cause of - it's likely #11216]

Focusing on item one since that's the original reporter's matter (and items two and three shouldn't even be getting triggered if the goal is to use the server-side editor), here's how we can help debug this to find out if it's something that needs to be fixed in the client or on the server:

  • Run a cURL query against the server's the client is exhibiting this behavior with:

curl -u USERNAME:PASSWORD -X GET 'https://cloud.domain.com/ocs/v1.php/cloud/capabilities' -H "OCS-APIRequest: true"

Look for a section in the XML entitled <richdocuments>. If it's not there, that's a server-side matter. If it's there, share it here so we can try to figure out why the client isn't detecting or trying to use the remote editor.

joshtrichards avatar Jan 24 '24 19:01 joshtrichards

Hi, can not find any richdocuments sections in the XML output. But - as described - this behavior also at me is only if i tried to open a document from my Android phone with Nextcloud Client. ( Server 28.0.1, Client 3.27.0 )

ralfi avatar Jan 25 '24 07:01 ralfi

I also have the issue. Unable to open office documents in Android app (*.ods, *.odt files). After selecting "edit" on a document the mobile app does not open the document and the "spinner" just spins. Unable to observe any error messages on the Nextcloud server. This used to work but broke after a Nextcloud upgrade. Unable to determine exactly which update as I discovered this just recently.

Executing command occ config:app:set richdocuments mobile_editing --value="yes" makes no difference. Except for if I set it to no, then Android device tries to open the document using a local editor.

Currently running Nextcloud AIO v7.11.0 with Docker and reverse proxy (Nginx Proxy Manager). The version of Nextcloud is 27.1.5 Collabora/CODE is 23.05.7.2.1 Nextcloud mobile app is 3.27.0

Executing curl -u USERNAME:PASSWORD -X GET 'https://cloud.domain.com/ocs/v1.php/cloud/capabilities' -H "OCS-APIRequest: true" gives me the following:

   <richdocuments>
    <version>8.2.4</version>
    <mimetypes>
     <element>application/vnd.oasis.opendocument.text</element>
     <element>application/vnd.oasis.opendocument.spreadsheet</element>
     <element>application/vnd.oasis.opendocument.graphics</element>
     <element>application/vnd.oasis.opendocument.presentation</element>
     <element>application/vnd.oasis.opendocument.text-flat-xml</element>
     <element>application/vnd.oasis.opendocument.spreadsheet-flat-xml</element>
     <element>application/vnd.oasis.opendocument.graphics-flat-xml</element>
     <element>application/vnd.oasis.opendocument.presentation-flat-xml</element>
     <element>application/vnd.lotus-wordpro</element>
     <element>application/vnd.visio</element>
     <element>application/vnd.ms-visio.drawing</element>
     <element>application/vnd.wordperfect</element>
     <element>application/msonenote</element>
     <element>application/msword</element>
     <element>application/rtf</element>
     <element>text/rtf</element>
     <element>application/vnd.openxmlformats-officedocument.wordprocessingml.document</element>
     <element>application/vnd.openxmlformats-officedocument.wordprocessingml.template</element>
     <element>application/vnd.ms-word.document.macroEnabled.12</element>
     <element>application/vnd.ms-word.template.macroEnabled.12</element>
     <element>application/vnd.ms-excel</element>
     <element>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</element>
     <element>application/vnd.openxmlformats-officedocument.spreadsheetml.template</element>
     <element>application/vnd.ms-excel.sheet.macroEnabled.12</element>
     <element>application/vnd.ms-excel.template.macroEnabled.12</element>
     <element>application/vnd.ms-excel.addin.macroEnabled.12</element>
     <element>application/vnd.ms-excel.sheet.binary.macroEnabled.12</element>
     <element>application/vnd.ms-powerpoint</element>
     <element>application/vnd.openxmlformats-officedocument.presentationml.presentation</element>
     <element>application/vnd.openxmlformats-officedocument.presentationml.template</element>
     <element>application/vnd.openxmlformats-officedocument.presentationml.slideshow</element>
     <element>application/vnd.ms-powerpoint.addin.macroEnabled.12</element>
     <element>application/vnd.ms-powerpoint.presentation.macroEnabled.12</element>
     <element>application/vnd.ms-powerpoint.template.macroEnabled.12</element>
     <element>application/vnd.ms-powerpoint.slideshow.macroEnabled.12</element>
     <element>text/csv</element>
    </mimetypes>
    <mimetypesNoDefaultOpen>
     <element>image/svg+xml</element>
     <element>application/pdf</element>
     <element>text/plain</element>
     <element>text/spreadsheet</element>
    </mimetypesNoDefaultOpen>
    <collabora>
     <convert-to>
      <available>1</available>
      <endpoint>/cool/convert-to</endpoint>
     </convert-to>
     <hasMobileSupport>1</hasMobileSupport>
     <hasProxyPrefix></hasProxyPrefix>
     <hasTemplateSaveAs></hasTemplateSaveAs>
     <hasTemplateSource>1</hasTemplateSource>
     <hasWASMSupport></hasWASMSupport>
     <hasZoteroSupport>1</hasZoteroSupport>
     <productName>Collabora Online Development Edition</productName>
     <productVersion>23.05.7.2</productVersion>
     <productVersionHash>f76e08a</productVersionHash>
     <serverId>3cc72e86</serverId>
    </collabora>
    <direct_editing>1</direct_editing>
    <templates>1</templates>
    <productName>Nextcloud Office</productName>
    <editonline_endpoint>https://cloud.domain.local/apps/richdocuments/editonline</editonline_endpoint>
    <config>
     <wopi_url>https://cloud.domain.local/</wopi_url>
     <public_wopi_url>https://cloud.domain.local</public_wopi_url>
     <disable_certificate_verification/>
     <edit_groups/>
     <use_groups/>
     <doc_format/>
     <timeout>15</timeout>
    </config>

One strange behaviour I observed is that if I create the document (plus icon > Create new document) in the mobile app I am able to edit. As soon as I close it I am unable to open and edit it again. So basically it only works when I create a new document file.

pwyde avatar Jan 25 '24 11:01 pwyde

I also have the issue. Unable to open office documents in Android app (*.ods, *.odt files). After selecting "edit" on a document the mobile app does not open the document and the "spinner" just spins.

@pwyde - This report is specific to the below error message received in v3.26. Your situation sounds more like https://github.com/nextcloud/android/issues/11975#issuecomment-1897198660

"Can't open this document
This file isn't available offline. Make
 file "Available offline" in the file's options menu." 

Hi, can not find any richdocuments sections in the XML output. But - as described - this behavior also at me is only if i tried to open a document from my Android phone with Nextcloud Client. ( Server 28.0.1, Client 3.27.0 )

@ralfi You might have two problems. Since you're using v3.27.0, you would encounter #12338. Except if your server is saying it doesn't offer the capability to open Office documents then you're not even getting far enough to trigger that bug. If there truly is no richdocuments section in the XML, can you confirm on your server that you can open Office documents alright? Does the menu Administration settings->Nextcloud Office show green in your Nextcloud Server's admin account?

joshtrichards avatar Jan 25 '24 11:01 joshtrichards

@pwyde - This report is specific to the below error message received in v3.26. Your situation sounds more like #11975 (comment)

"Can't open this document
This file isn't available offline. Make
 file "Available offline" in the file's options menu." 

My apologies. Too many tabs open with similar issues. I will move over to #12338. Thank you for the fast reply.

pwyde avatar Jan 25 '24 11:01 pwyde

I also have the issue. Unable to open office documents in Android app (*.ods, *.odt files). After selecting "edit" on a document the mobile app does not open the document and the "spinner" just spins.

@pwyde - This report is specific to the below error message received in v3.26. Your situation sounds more like #11975 (comment)

"Can't open this document
This file isn't available offline. Make
 file "Available offline" in the file's options menu." 

Hi, can not find any richdocuments sections in the XML output. But - as described - this behavior also at me is only if i tried to open a document from my Android phone with Nextcloud Client. ( Server 28.0.1, Client 3.27.0 )

@ralfi You might have two problems. Since you're using v3.27.0, you would encounter #12338. Except if your server is saying it doesn't offer the capability to open Office documents then you're not even getting far enough to trigger that bug. If there truly is no richdocuments section in the XML, can you confirm on your server that you can open Office documents alright? Does the menu Administration settings->Nextcloud Office show green in your Nextcloud Server's admin account?

ksnip_20240125-131532

Yes, it works without problems - also with browser on my android phone.

ralfi avatar Jan 25 '24 12:01 ralfi

@ralfi Well with v3.27.0 it would be broken for you anyhow. :-) But if your server isn't announcing it is capable of supporting richdocuments to the mobile client, there also isn't anything the client can do about that. And that's an entirely different problem (and not one I can reproduce). Can you share the output of occ config:list richdocuments?

joshtrichards avatar Jan 25 '24 14:01 joshtrichards

Please ... using Docker based config with two container (nc / code)

ksnip_20240125-160112

ralfi avatar Jan 25 '24 15:01 ralfi

@ralfi The only other explanation is that your CODE server's own config has hasMobileSupport disabled. Check https://code.domain.com/hosting/capabilities for hasMobileSupport[1].

[1] https://sdk.collaboraonline.com/docs/advanced_integration.html#checking-for-available-features

joshtrichards avatar Jan 25 '24 15:01 joshtrichards

hasMobilSupport: true mystic...

ralfi avatar Jan 25 '24 16:01 ralfi

@ralfi Since your situation seems unrelated, I suggest opening a separate issue for it - probably in the richdocuments repository since since the server isn't even offering up capabilities to the client.

joshtrichards avatar Jan 26 '24 01:01 joshtrichards

@joshtrichards Thank you, i wait until 3.27.1 is released and check it again.

ralfi avatar Jan 26 '24 06:01 ralfi

Hey @joshtrichards is this the same issue as I'm having in thr below screenshot ? Just wanted to confirm before I create another issue.

I'm unable to open any documents via android client only I'm using collabora server just get the spininh circle

Screenshot_20240218_110336_Nextcloud.jpg

AndyXheli avatar Feb 18 '24 17:02 AndyXheli

Okay, solved with latest android app from today. Thanks a lot!

ralfi avatar Feb 19 '24 13:02 ralfi