nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.18k stars 1.75k forks source link

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

Open w9hdg opened 1 year ago

w9hdg commented 1 year ago

⚠️ Before posting ⚠️

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

mnheia commented 1 year ago

I can confirm the same issue.

Device brand and model

Stock or custom OS?

Nextcloud android app version

Nextcloud server version

cryologic commented 1 year ago

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

mnheia commented 1 year ago

@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 mobileediting --value="yes"

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

cryologic commented 1 year ago

Can you give it a try? _sudo -u www-data php -f /opt/nextcloud/occ config:app:set richdocuments mobileediting --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)

lckarssen commented 1 year ago

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.

mr-bolle commented 1 year ago

_sudo -u www-data php -f /opt/nextcloud/occ config:app:set richdocuments mobileediting --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

zpackrat commented 1 year ago

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.

ralfi commented 11 months ago

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

joshtrichards commented 11 months ago

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?

lckarssen commented 11 months ago

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

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 commented 11 months ago

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.

cryologic commented 11 months ago

@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.

lckarssen commented 11 months ago

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.

mhzawadi commented 8 months ago

I too have issues open office docs on my mobile

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

joshtrichards commented 8 months ago

@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

mhzawadi commented 8 months ago

@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

joshtrichards commented 8 months ago

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:

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.

ralfi commented 7 months ago

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 )

pwyde commented 7 months ago

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.

joshtrichards commented 7 months ago

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?

pwyde commented 7 months ago

@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.

ralfi commented 7 months ago

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.

joshtrichards commented 7 months ago

@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?

ralfi commented 7 months ago

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

ksnip_20240125-160112

joshtrichards commented 7 months ago

@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

ralfi commented 7 months ago

hasMobilSupport: true mystic...

joshtrichards commented 7 months ago

@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.

ralfi commented 7 months ago

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

AndyXheli commented 7 months ago

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

ralfi commented 7 months ago

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

AndyXheli commented 7 months ago

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

Same issue fixed for me also 
mr-bolle commented 7 months ago

Hi, i have the same behavior. After the current update to v3.28.0 the issue are gone.

overflow-ITA commented 7 months ago

Update to 3.28 resolve for me too

joshtrichards commented 7 months ago

@AndyXheli Yours looks like #12338, but it's the same matter that has come up in this issue several times. That's fixed in, well, now the just released v3.28.0.

AndyXheli commented 7 months ago

@AndyXheli Yours looks like #12338, but it's the same matter that has come up in this issue several times. That's fixed in, well, now the just released v3.28.0.

Thank you very much 🙂

Sommerwiesel commented 6 months ago

Hello, still happening for me even after update to v3.28.0:

Device Google Pixel 4

Stock or custom OS? Stock

Nextcloud android app version 3.28.0

Nextcloud server version 27.1.7

Using a reverse proxy? Yes, nginx

Other info No server-side editor is installed. The files are all .doc, trying to open with Google Docs

Update: It's only broken with apps that try to "edit" the file. If I try using "Librera Reader" which only shows the file contents read-only, it works.

info.jpg error.jpg

Sommerwiesel commented 6 months ago

Update:

The problem was an old installation of richdocuments (collabora), which upon uninstallation half a year ago, had some leftovers, that caused all these issues with editable documents.

I just tried reinstalling richdocuments (with a self-hosted collabora) and ran into a plethora of problems upon installation, all due to left-over invalid values, most of them in the database. After wiping these left-overs, everything suddenly worked (with or without richdocuments).

The problem (problematic leftovers) is already known on the github of nextcloud/richdocuments so I'm not gonna open another issue.

FYI for anyone having similar problems even after 3.28.0: Clean your system of any richdocuments left-overs and/or cleanly reinstall it.

felixschndr commented 5 months ago

The problem (problematic leftovers) is already known on the github of nextcloud/richdocuments so I'm not gonna open another issue.

Can you please provide a link to this, I am facing the same issue

felixschndr commented 5 months ago

I am running into the same issue but only sometimes:

Does somebody face the same behaviour?