Failure: "Please ensure the file type is supported and not corrupted"

Greetings, community, and thanks in advance for any help you can provide!

I’m running Nextcloud 11.0.1, apache 2.4.25, php 7.1.1, mariadb 10.1.21, and docker 1.12.6.
I’m up to date on the collabora/code latest Docker image.
I have version 1.1.25 of the Collabora Online app for Nextcloud.
I have current valid certs from LetsEncrypt for mydomain.tld and office.mydomain.tld.
Docker is using overlay2, not aufs.
I copied the virtualhost config directly from https://nextcloud.com/collaboraonline changing only the ServerName and SSL paths. The new websocket stuff and the nocanon are all intact.
The Docker image was run using the command provided at https://nextcloud.com/collaboraonline except with mydomain.tld (properly escaped) and prepended with sudo.
The admin interface for the Collabora Online app for Nextcloud points to https://office.mydomain.tld (without the port number).
The Collabora Online app is not restricted to only certain groups (not that such an option exists any longer for this app).
https://office.mydomain.tld/hosting/discovery is reachable and gives the expected output.

When I visit https://office.mydomain.tld/loleaflet/2.0.2/loleaflet.html? in my browser, CODE tells me
"Well, this is embarrassing, we cannot connect to your document. Please try again.“
followed by
"Wrong WOPISrc, usage: WOPISrc=valid encoded URI, or file_path, usage: file_path=/path/to/doc/”
(which I think is the expected behavior since I didn’t pass it anything to do).

When I try to open any existing or new document in Nextcloud, CODE tells me
"Failed to load the document. Please ensure the file type is supported and not corrupted, and try again."

I feel like I’ve tried everything and searched thoroughly but I haven’t gotten anywhere. I’m sure I’ve just got some dumb mistake hanging out in an old config file that I’ve been dragging around in the years since I first started messing with this installation.

Please let me know what I can provide to help troubleshoot this problem.
I appreciate any help more than I can express in a single post.

I hate to “bump” a post but I’ve continued to have no luck figuring this out after 2 weeks so I’m hoping some kind soul has a hint. Thanks, again.

Also experiencing the same thing.

Today’s CODE 2.0 update changed the message to “Service is unavailable. Please try again later and report to your administrator if the issue persists.” I guess that’s an improvement?

EDIT: Nevermind, if you give it long enough, it still throws the supported/not corrupted error.

Alright, I seem to have figured out some voodoo that works on my end.

  1. Run the Docker image as normal
  2. Keep trying to open docs on Nextcloud…
  3. Click “OK” on “Well, this is embarrassing, we cannot connect to your document. Please try again.”
  4. Click “OK” on “Service is unavailable. Please try again later and report to your administrator if the issue persists.”
  5. Keeping going back to step 3 until you finally get “Failed to load the document. Please ensure the file type is supported and not corrupted, and try again.”
  6. Click “OK” and exit to Files.
  7. Restart Docker itself (the service, not just the image).
  8. Profit.

Why this works, I have no idea but it has worked three times in a row for me. I hope it’ll help someone else and, ultimately, I hope it provides a clue needed to address the problem.

It’s not a real “Solution” but I’ll mark this as solved for now.

9 Likes

Docker seems very unstable for sure…

1 Like

Ok seriously? I can’t believe this worked! Thanks!

I’ve been sitting here restarting the machine and restarting the containers to no avail but this simple solution fixed it?! It even remained fixed across reboots. Whats up with this?

I wish I knew! This is still the only thing that gets it working for me. For what it’s worth, I don’t actually believe it is a Docker issue. I get the same series of error messages when I run LibreOffice Online without Docker.

The voodoo works !! The only thing that works !
anyone able to get technical details about this fault?

This voodoo really works on my machine too…

I can also confirm that a service docker restart solved the “Failed to load the document. Please ensure the file type is supported and not corrupted, and try again.” error with Collabora Online.

2 Likes

I had the exact same issue and

sudo service docker restart

did the job! Ubuntu 16.04 and the docker/apache setup as recommended by Nextcloud. Maybe this can be added to the documentation it took me some time to figure out that my setup was totally fine … :grinning::sunglasses:

I had the same issue (Nextcloud and code in docker on ubuntu 16.04, nginx as reverse proxy in front)
Wasted so much time trying to change all possible proxy settings, I build a test env. for that … but that is really a “magic solution” :smile: … but it works

Is this solution working “stable” or is it necessary to restart docker every day or so ? … I will find out , but I will keep the over a year old image from code in my registry as a backup, that is working without magic :grinning:

Many thanks for the help here !

I’m glad it is still helping people a year later. In my experience, it is a “stable” solution. If I recall correctly, it even survives power cycles. The only time I remember needing to revisit it was when I updated the Docker image.

That DID IT … restarting the docker service… it self … runs it now…

Debian GNU/Linux 8 (jessie)
17.5.3 debian8.0.build1705170317.16

After upgrading collabora to latest version, files with russian names can’t open:

Apr 20 11:42:06 Iru113 loolwsd[699]: kit-01700-01906 08:42:06.351323 [ lokit_002 ] ERR Failed to load: file:///user/docs/H1YwVwEuLoKUAj7U/%D0%9F%D0%BE% D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%BE%20%D0%BC%D0%B5%D1%80%D0%BE%D0%BF%D1%80%D0%B8%D1%8F%D1%82%D0%B8%D1%8F%D1%85_%D1%84%D0%BE%D1%80%D1%83%D 0%BC%20%D0%93%D0%BE%D1%80%D0%B8%D0%B7%D0%BE%D0%BD%D1%82%D1%8B.docx, error: Unsupported URL <file:///user/docs/H1YwVwEuLoKUAj7U/%D0%9F%D0%BE%D0%BB%D0%BE% D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%BE%20%D0%BC%D0%B5%D1%80%D0%BE%D0%BF%D1%80%D0%B8%D1%8F%D1%82%D0%B8%D1%8F%D1%85_%D1%84%D0%BE%D1%80%D1%83%D0%BC%20%D0%9 3%D0%BE%D1%80%D0%B8%D0%B7%D0%BE%D0%BD%D1%82%D1%8B.docx>: “type detection failed”| kit/Kit.cpp:1527
Apr 20 11:42:06 Iru113 loolwsd[699]: kit-01700-01906 08:42:06.351529 [ lokit_002 ] ERR Failed to get LoKitDocument instance.| kit/ChildSession.cpp:368
Apr 20 11:42:06 Iru113 loolwsd[699]: kit-01700-01906 08:42:06.352289 [ lokit_002 ] WRN Document::ViewCallback. Session [-1] is no longer active to proc ess [ERROR] [{
Apr 20 11:42:06 Iru113 loolwsd[699]: “classification”: “error”,
Apr 20 11:42:06 Iru113 loolwsd[699]: “cmd”: “load”,
Apr 20 11:42:06 Iru113 loolwsd[699]: “kind”: “io”,
Apr 20 11:42:06 Iru113 loolwsd[699]: “code”: “770”,
Apr 20 11:42:06 Iru113 loolwsd[699]: “message”: ""
Apr 20 11:42:06 Iru113 loolwsd[699]: }
Apr 20 11:42:06 Iru113 loolwsd[699]: ] message to Master Session.| kit/Kit.cpp:1842

English filenames open correctly. How can i downgrade the CODE to prewious version?

i don’t know if you still need this information.

if you are using a docker container you can pull a specific version with the corresponding tag.
see: https://docs.docker.com/engine/reference/commandline/pull/
and https://hub.docker.com/r/collabora/code/tags/

Did you ever find a solution for fixing this without using docker? I have the same problem without using docker but installing the packges like described here https://www.collaboraoffice.com/code/. For me the download of the document from nextcloud works, file is not corrupted (took url from lool log, so below mentioned user/docs/zlsR1DoDPyj5BMNO/NewSpreadsheet.ods is OK) but lool fails to open the file locally. Reads like this

kit-07780-07791 06:28:02.956088 [ lokit_001 ] INF  Loading new document from URI: [file:///user/docs/zlsR1DoDPyj5BMNO/NewSpreadsheet.ods] for session [0003].| kit/Kit.cpp:1498
kit-07780-07791 06:28:02.956171 [ lokit_001 ] DBG  Calling lokit::documentLoad(file:///user/docs/zlsR1DoDPyj5BMNO/NewSpreadsheet.ods, "Language=en").| kit/Kit.cpp:1520
kit-07780-07791 06:28:02.965783 [ lokit_001 ] TRC  Document::GlobalCallback ERROR [{
    "classification": "error",
    "cmd": "load",
    "kind": "io",
    "code": "770",
    "message": ""
}```

If in the name of the document there are Russian symbols or in the name there is a gap, then receive a mistake
“type detection failed”| kit/Kit.cpp:1527

it worked for me too.