richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Failed to convert preview: Client error: `POST https://collabora.example.de/cool/convert-to/png` resulted in a `400 Bad Request` response

Open saervices opened this issue 7 months ago • 6 comments

Hi all,

sometimes I getting randomly this kind of error on a clean nextcloud install with richdocuments (collabora) installed. I don´t even have photos. Everything is reachable via curl and I also don´t have any kind of restrictions. Using Traefik as proxy.

ClientException Client error:POST https://collabora.example.de/cool/convert-to/pngresulted in a400 Bad Requestresponse Failed to convert preview: Client error:POST https://collabora.example.de/cool/convert-to/pngresulted in a400 Bad Requestresponse

saervices avatar May 10 '25 15:05 saervices

I have the same issue, I can also see this error in my collabora logs:

full URI: /cool/extract-document-structure?filter=contentcontrol| wsd/ClientRequestDispatcher.cpp:874
wsd-00001-00036 2025-05-13 15:07:38.379188 +0000 [ websrv_poll ] ERR  #21: Unknown resource: /cool/extract-document-structure?filter=contentcontrol WebSocket, host: MY_HOST, path: 3

Everything seems to work, just this error log that is regularly happening.

Simon-Boyer avatar May 13 '25 15:05 Simon-Boyer

@saervices This endpoint is used to generate file previews for documents, so even though you do not have any images it could still be used by the server in the background. There is an issue that came to our attention recently about requests to this endpoint timing out, but yours seem to be malformed somehow. Could you please tell me which version of the Collabora server you're running, and maybe share a larger snippet of logs (same line is good, with just some more context). And, I am assuming you have a real Collabora domain and not just collabora.example.de? ;)

@Simon-Boyer Your issue seems slightly unrelated; I think I would need to verify your Collabora server version as well. If /cool/extract-document-structure?filter=contentcontrol is an unknown/invalid resource, maybe you are running a very out-of-date Collabora server version? If not, would have to dig a bit deeper into that.

elzody avatar May 13 '25 16:05 elzody

Haha i sent the wrong logs, although it might be related to same problem. I wanted to share those:

full URI: /cool/convert-to/png| wsd/ClientRequestDispatcher.cpp:874
wsd-00001-00036 2025-05-13 16:27:01.792858 +0000 [ websrv_poll ] ERR  #30: Unknown resource: /cool/convert-to/png WebSocket, host: collabora-nextcloud.etsmtl.club, path: 3

Still, it might be the version. I used the nextcloud helm chart to deploy collabora (used as a subchart), and it looks like the version referenced there is pretty old: https://github.com/nextcloud/helm/blob/424b029328f664dcf88f15d1c0aa9fd82be6491c/charts/nextcloud/Chart.yaml#L43

I'll set it up by calling the chart directly instead and see if it solves the issue

Simon-Boyer avatar May 13 '25 17:05 Simon-Boyer

That was indeed the issue! @saervices if like me you were using the nextcloud helm chart to deploy collabora, its out of date, switching to using the chart directly solved my issue.

Simon-Boyer avatar May 13 '25 22:05 Simon-Boyer

@elzody Are we sending requests if an old collabora version is in use? We should check and return early before sending maybe by checking the capabilities

juliusknorr avatar Jun 06 '25 10:06 juliusknorr

Some discovery made while debugging a similar issue:

  • The change of the API endpoint from /lool/ to /cool/ is made in revision 6623a4c (>=8.4.0-beta1) by @juliusknorr .
  • The corresponding code appears to be in: https://github.com/nextcloud/richdocuments/blob/f2fbc91/lib/Service/RemoteService.php#L94
  • It appears that this call doesn't honour the capabilities returned by the WSD service.

brlin-tw avatar Aug 15 '25 10:08 brlin-tw