NextCloud Office with separate Collabora instance failing to open .doc files

I have a server running the latest TrueNAS Scale and I have both NextCloud and Collabora Online installed as apps (docker containers). In NextCloud, I have the NextCloud Office app installed and enabled and it is pointing to my instance of Collabora Online. This integration works great. I can open many Office formats quickly and with no problems. However, for whatever reason, when I attempt to open anything with a .doc extension, I get an error in Office Online saying Failed to load the document. Please ensure the file type is supported and not corrupted, and try again.

If I download the file and open it locally using Microsoft Office, it works just fine. The Collabora Online logs in the docker container say the following (the file I am trying to open is called Annie's biggest toilet.doc).

2024-12-22 15:36:14.783191+00:00wsd-00001-01220 2024-12-22 08:36:14.783164 -0700 [ docbroker_018 ] INF  WOPI::GetFile downloaded 24064 bytes from [https://www.myserver.net:9001/index.php/apps/richdocuments/wopi/files/49005_ocl11w6b8ft5/contents?access_token=&access_token_ttl=0] -> /opt/cool/child-roots/1-e3cb526f/WLGnJoCgWnHUeiS9/tmp/user/docs/2V1qlQuXLphc9hLm/Annie's biggest toilet.doc in 69ms| wsd/wopi/WopiStorage.cpp:697
2024-12-22 15:36:14.783429+00:00wsd-00001-01220 2024-12-22 08:36:14.783401 -0700 [ docbroker_018 ] INF  SHA1 for DocKey [https%3A%2F%2Fwww.myserver.net%3A9001%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F49005_ocl11w6b8ft5] of [/tmp/user/docs/2V1qlQuXLphc9hLm/Annie's biggest toilet.doc]: 1611f098fb326b0f6ecb25de45576ef10bfceeff| wsd/DocumentBroker.cpp:1241
2024-12-22 15:36:14.783449+00:00wsd-00001-01220 2024-12-22 08:36:14.783425 -0700 [ docbroker_018 ] DBG  Quarantine ctor for [https%3A%2F%2Fwww.myserver.net%3A9001%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F49005_ocl11w6b8ft5], filename: [_1184_Annie%27s%20biggest%20toilet.doc]| wsd/QuarantineUtil.cpp:51
2024-12-22 15:36:14.783459+00:00wsd-00001-01220 2024-12-22 08:36:14.783438 -0700 [ docbroker_018 ] INF  TileCache ctor for uri [https://www.myserver.net:9001/index.php/apps/richdocuments/wopi/files/49005_ocl11w6b8ft5?access_token=&access_token_ttl=0], modifiedTime=1734881774], dontCache=false| wsd/TileCache.cpp:46
2024-12-22 15:36:14.783517+00:00wsd-00001-00021 2024-12-22 08:36:14.783492 -0700 [ admin ] DBG  Added admin document [https%3A%2F%2Fwww.myserver.net%3A9001%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F49005_ocl11w6b8ft5].| wsd/AdminModel.cpp:544
2024-12-22 15:36:14.783550+00:00kit-01184-01184 2024-12-22 08:35:43.806809 -0700 [ kit_spare_01b ] INF  New kit client websocket inserted.| kit/Kit.cpp:3688
2024-12-22 15:36:14.783564+00:00kit-01184-01184 2024-12-22 08:35:43.806811 -0700 [ kit_spare_01b ] INF  Setting disabled log areas to [Socket,WebSocket,Admin,Pixel]| common/Log.cpp:777
2024-12-22 15:36:14.783572+00:00kit-01184-01184 2024-12-22 08:35:43.806822 -0700 [ kit_spare_01b ] INF  Kit unipoll loop run| kit/Kit.cpp:3718
2024-12-22 15:36:14.783579+00:00kit-01184-01184 2024-12-22 08:36:14.783514 -0700 [ kit_spare_01b ] DBG  #19: child_ws: recv [session 259 https%3A%2F%2Fwww.myserver.net%3A9001%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F49005_ocl11w6b8ft5 018 | kit/KitWebSocket.cpp:49
2024-12-22 15:36:14.783780+00:00kit-01184-01184 2024-12-22 08:36:14.783544 -0700 [ kitbroker_018 ] INF  Thread 1184 (7f6eb3339800) of process 1184 formerly known as [kit_spare_01b] is now called [kitbroker_018]| common/Util.cpp:321
2024-12-22 15:36:14.783793+00:00kit-01184-01184 2024-12-22 08:36:14.783728 -0700 [ kitbroker_018 ] INF  Document ctor for [https%3A%2F%2Fwww.myserver.net%3A9001%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F49005_ocl11w6b8ft5] url [https://www.myserver.net:9001/index.php/apps/richdocuments/wopi/files/49005_ocl11w6b8ft5] on child [WLGnJoCgWnHUeiS9] and id [018].| kit/Kit.cpp:772
2024-12-22 15:36:14.783799+00:00kit-01184-01184 2024-12-22 08:36:14.783739 -0700 [ kitbroker_018 ] INF  Creating first session for url: https://www.myserver.net:9001/index.php/apps/richdocuments/wopi/files/49005_ocl11w6b8ft5 for sessionId: 259 on jailId: WLGnJoCgWnHUeiS9| kit/Kit.cpp:851
2024-12-22 15:36:14.783803+00:00kit-01184-01184 2024-12-22 08:36:14.783742 -0700 [ kitbroker_018 ] INF  ToMaster-259: ChildSession ctor [ToMaster-259]. JailRoot: []| kit/ChildSession.cpp:132
2024-12-22 15:36:14.783807+00:00kit-01184-01184 2024-12-22 08:36:14.783746 -0700 [ kitbroker_018 ] INF  New session [259] created. Have 1 sessions now| kit/Kit.cpp:865
2024-12-22 15:36:14.816321+00:00wsd-00001-01220 2024-12-22 08:36:14.816202 -0700 [ docbroker_018 ] INF  ToClient-259: Client timestamps: Date.now():1734881775752, performance.now():208 => 1734881775544000| wsd/ClientSession.cpp:621
2024-12-22 15:36:14.816544+00:00wsd-00001-01220 2024-12-22 08:36:14.816513 -0700 [ docbroker_018 ] INF  ToClient-259: Requesting document load from child.| wsd/ClientSession.cpp:1260
2024-12-22 15:36:14.816668+00:00kit-01184-01184 2024-12-22 08:36:14.816591 -0700 [ kitbroker_018 ] DBG  #19: child_ws: recv [child-259 load xjail=file:///tmp/user/docs/2V1qlQuXLphc9hLm/Annie%27s%20biggest%20toilet.doc verifyHost=false xauthorid=ncadmin xauthor=Tyson%20Jones readonly=0 isAllowChangeComments=true lang=en-US deviceFormFactor=desktop timezone=America/Denver darkTheme=true darkBackground=true enableMacrosExecution=false macroSecurityLevel=1 | kit/KitWebSocket.cpp:49
2024-12-22 15:36:14.816686+00:00kit-01184-01184 2024-12-22 08:36:14.816646 -0700 [ kitbroker_018 ] INF  Loading url [file:///tmp/user/docs/2V1qlQuXLphc9hLm/Annie%27s%20biggest%20toilet.doc] for session [259] which has 0 sessions.| kit/Kit.cpp:1272
2024-12-22 15:36:14.816722+00:00kit-01184-01184 2024-12-22 08:36:14.816689 -0700 [ kitbroker_018 ] INF  Loading new document from URI: [file:///tmp/user/docs/2V1qlQuXLphc9hLm/Annie%27s%20biggest%20toilet.doc] for session [259].| kit/Kit.cpp:1952
2024-12-22 15:36:14.816735+00:00kit-01184-01184 2024-12-22 08:36:14.816706 -0700 [ kitbroker_018 ] DBG  Calling lokit::documentLoad(file:///tmp/user/docs/2V1qlQuXLphc9hLm/Annie%27s%20biggest%20toilet.doc, "Language=en-US,DeviceFormFactor=desktop,EnableMacrosExecution=false,MacroSecurityLevel=1,Timezone=America/Denver")| kit/Kit.cpp:1971
2024-12-22 15:36:14.825199+00:00kit-01184-01184 2024-12-22 08:36:14.825103 -0700 [ kitbroker_018 ] DBG  Returned lokit::documentLoad(file:///tmp/user/docs/2V1qlQuXLphc9hLm/Annie%27s%20biggest%20toilet.doc) in 8ms| kit/Kit.cpp:1979
2024-12-22 15:36:14.825248+00:00kit-01184-01184 2024-12-22 08:36:14.825113 -0700 [ kitbroker_018 ] ERR  Failed to load: file:///tmp/user/docs/2V1qlQuXLphc9hLm/Annie%27s%20biggest%20toilet.doc, error: loadComponentFromURL returned an empty reference| kit/Kit.cpp:1985
2024-12-22 15:36:14.825258+00:00kit-01184-01184 2024-12-22 08:36:14.825119 -0700 [ kitbroker_018 ] ERR  ToMaster-259: error: cmd=load kind=faileddocloading| common/Session.hpp:181
2024-12-22 15:36:14.825272+00:00kit-01184-01184 2024-12-22 08:36:14.825135 -0700 [ kitbroker_018 ] FTL  Failed to load the document. Setting TerminationFlag| kit/Kit.cpp:2012

There are some extra logs after this, but they’re all synonymous to the idea that the document failed to load. My Collabora Online installation has the following extra parameters set:

--o:welcome.enable=false
--o:user_interface.mode=notebookbar
--o:ssl.termination=true
--o:ssl.enable=false
--o:net.proto=IPv4
--o:logging.level=warning
--o:logging.level_startup=warning
--o:mount_jail_tree=false

Does anyone have any idea what is happening?

I tested some old .doc documents I have from the past and CODE opened them without issues, so the problem is no generic. Likely something is wrong despite the fact MS Office can edit without issues. I would check if other .doc files open - if yes the problem is related to the document. Maybe you can convert it to .docx or .odt using MS Office which might fix the problem already. if there is no sensitive information you can share the document with me and I can double check in my instance.

I checked several other .doc files, and they all have the same issue. Here is a link to a .doc file that fails for me: Google Docs wird geladen

for me it works :man_shrugging:

Huh. Is there a chance you are running CODE with some special arguments that I am missing? If not, I may just attempt to run CODE locally and see if I can get more information on the error.

I don’t think there is any special parameter… CODE_VERSION=24.04.9.1.1

  collabora:
    image: collabora/code:${CODE_VERSION}
    container_name: collabora
    restart: unless-stopped
    expose:
      - "9980"
    environment:
      # https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html
      - aliasgroup1=${NEXTCLOUD1}
      - aliasgroup2=${NEXTCLOUD2}
      - aliasgroup3=${NEXTCLOUD3}
      - dictionaries=de_DE en_US es_ES ru
      - VIRTUAL_PROTO=http
      - VIRTUAL_PORT=9980
      - VIRTUAL_HOST=${COLLABORA_FQDN}
      - extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:user_interface.mode=compact --o:remote_font_config.url=${NEXTCLOUD2}/apps/richdocuments/settings/fonts.json --o:logging.level=warning
      # --o:net.proto=IPv4 --o:hexify_embedded_urls=true
      - username=redis
      - password=3VZk5kjwCFO0FCunwiMC
    mem_limit: 8192mb
    cpus: 2.0
    cap_add:
      - MKNOD
    tty: true
    networks:
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.collabora.rule=Host(`${COLLABORA_FQDN}`)
      - traefik.http.routers.collabora.tls=true
      - traefik.http.routers.collabora.tls.certresolver=letsencryptresolver
      - traefik.http.routers.collabora.middlewares=crowdsec@file,secHeaders5@file
      - traefik.http.services.collabora.loadbalancer.server.port=9980
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      #- ./collabora/loolwsd.xml:/etc/loolwsd/loolwsd.xml

but there is an interesting finding after update to collabora/code:24.04.11.1.1

image

collabora  | wsd-00001-00026 2024-12-23 21:57:18.583883 +0100 [ asyncdns ] ERR  Failed to lookup host [rating.collaboraonline.com]: No address associated with hostname (EAGAIN: Resource temporarily unavailable)| net/NetUtil.cpp:106
collabora  | wsd-00001-00026 2024-12-23 21:57:18.584111 +0100 [ asyncdns ] ERR  Failed to lookup host [rating.collaboraonline.com]. Skipping (EAGAIN: Resource temporarily unavailable)| net/NetUtil.cpp:453
collabora  | wsd-00001-00026 2024-12-23 21:57:18.584127 +0100 [ asyncdns ] WRN  Waking up dead poll thread [main], started: false, finished: false| net/Socket.hpp:808
collabora  | wsd-00001-00001 2024-12-23 21:57:18.584157 +0100 [ coolwsd ] ERR  #-1: Failed to connect to rating.collaboraonline.com:443| net/HttpRequest.hpp:1673
collabora  | frk-00028-00028 2024-12-23 21:57:20.568935 +0100 [ forkit ] WRN  The systemplate directory [/opt/cool/systemplate] is read-only, and at least [/opt/cool/systemplate//etc/hosts] is out-of-date. Will have to clone dynamic elements of systemplate to the jails. To restore optimal performance, make sure the files in [/opt/cool/systemplate/etc] are up-to-date.| common/JailUtil.cpp:587
collabora  | kit-00147-00147 2024-12-23 21:57:20.687367 +0100 [ kitbroker_005 ] ERR  Failed to load: file:///tmp/user/docs/b6ByYj9Mt67ymnTy/Doc1.doc, error: loadComponentFromURL returned an empty reference| kit/Kit.cpp:1944
collabora  | kit-00147-00147 2024-12-23 21:57:20.687392 +0100 [ kitbroker_005 ] ERR  ToMaster-025: error: cmd=load kind=faileddocloading| common/Session.hpp:181
collabora  | Failed to load the document. Setting TerminationFlag
collabora  | kit-00147-00147 2024-12-23 21:57:20.687427 +0100 [ kitbroker_005 ] FTL  Failed to load the document. Setting TerminationFlag| kit/Kit.cpp:1971
collabora  | kit-00147-00147 2024-12-23 21:57:20.687439 +0100 [ kitbroker_005 ] ERR  ToMaster-025: Failed to get LoKitDocument instance for [file:///tmp/user/docs/b6ByYj9Mt67ymnTy/Doc1.doc]| kit/ChildSession.cpp:935
collabora  | wsd-00001-00165 2024-12-23 21:57:20.687451 +0100 [ docbroker_005 ] ERR  ToClient-025: Document load failed: faileddocloading| wsd/ClientSession.cpp:1982
collabora  | wsd-00001-00165 2024-12-23 21:57:20.687495 +0100 [ docbroker_005 ] ERR  Unexpected message: [o1030 close: ].| wsd/DocumentBroker.cpp:3665
collabora  | wsd-00001-00165 2024-12-23 21:57:20.687529 +0100 [ docbroker_005 ] WRN  #31: DocBroker [https%3A%2F%2Fdev-nc.mydomain.tld%3A443%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F138285_oc52dthqts8g] got disconnected from its Kit (147) unexpectedly. Closing| wsd/COOLWSD.cpp:2735

in the last version there must be a regression starting with 24.04.10.2.1 - 24.04.9.1.1 works well. Please report at Collabora forum or Github

Ooh good find! I will report this on GitHub. Thanks for the assist!

1 Like