nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
350 stars 115 forks source link

Failing startup of Collabora prevents users from downloading documents even if the download option is activated #3332

Open xylo opened 9 months ago

xylo commented 9 months ago

Describe the bug I shared an MS Office document (.xlsm file) via a public link which was actually ment for downloading. However, since I activated Nextcloud Office in my Nextcloud 27 these links do not work as expected anymore. When someone opens the link, Nextcloud offers a download for a second or less and immediately tries to start Nextcloud Office which removes the download option again. For some reason the document cannot be loaded via Nextcloud Office and download option does not come back.

Of course I could increase the timeout for Collabora or give it more RAM. However, I think there will always be very large or very unusual documents which cannot be loaded by LibreOffice/Collabora in time or at all. Therefore, activating Nextcloud Office should IMO never lead to a drawback in functionality. No matter if a document can be loaded by Nextcloud Office or not, there should be always a download button if the sharing user wants to allow downloads.

So a simple solution would be NOT to remove the download button while Nextcloud Office starts up.

To Reproduce Steps to reproduce the behavior:

  1. Find an .xlsm file (or maybe any MS Office file) wich takes a long time open in LibreOffice (more then 30 seconds).
  2. Upload this file to the Nextcloud.
  3. Create a public share on this file with download option and without write permissions.
  4. Open the link of the public share in the webbrowser.
  5. See how the download option appears for one second and disappears afterwards when Nextcloud Office tries to start up.

Expected behavior If the download option is set, the download button should IMO never disappear.

Screenshots Screenshot showing the missing download button: grafik

Screenshot telling me that Nextcloud Office could not establish a connection to the document. grafik

Client details:

Server details

Operating system: Debian bookworm

Web server: Apache2 2.4.57

Database: MariaDB 10.11.4

PHP version: 8.1.25

Nextcloud version: 27.1.4

Version of Nextcloud Office 8.2.3

Collabora Online - Built-in CODE Server 23.5.503

Logs #### Nextcloud log (data/nextcloud.log) ``` [richdocuments] Information: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 25001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://cloud.iat.sport-iat.de/apps/richdocumentscode/proxy.php?req=/lool/convert-to/png at <> 0. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158 GuzzleHttp\Handler\CurlFactory::createRejection("*** sensitive parameters replaced ***") 1. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110 GuzzleHttp\Handler\CurlFactory::finishError() 2. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47 GuzzleHttp\Handler\CurlFactory::finish() 3. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 137 GuzzleHttp\Handler\CurlHandler->__invoke() 4. /var/www/nextcloud/iat/lib/private/Http/Client/DnsPinMiddleware.php line 114 GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***") 5. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 64 OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***") 6. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31 GuzzleHttp\PrepareBodyMiddleware->__invoke() 7. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71 GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***") 8. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63 GuzzleHttp\RedirectMiddleware->__invoke() 9. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75 GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***") 10. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Client.php line 331 GuzzleHttp\HandlerStack->__invoke() 11. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Client.php line 168 GuzzleHttp\Client->transfer() 12. /var/www/nextcloud/iat/3rdparty/guzzlehttp/guzzle/src/Client.php line 187 GuzzleHttp\Client->requestAsync("*** sensitive parameters replaced ***") 13. /var/www/nextcloud/iat/lib/private/Http/Client/Client.php line 301 GuzzleHttp\Client->request() 14. /var/www/nextcloud/iat/apps/richdocuments/lib/Preview/Office.php line 94 OC\Http\Client\Client->post() 15. /var/www/nextcloud/iat/lib/private/Preview/ProviderV1Adapter.php line 53 OCA\Richdocuments\Preview\Office->getThumbnail() 16. /var/www/nextcloud/iat/lib/private/Preview/GeneratorHelper.php line 64 OC\Preview\ProviderV1Adapter->getThumbnail() 17. /var/www/nextcloud/iat/lib/private/Preview/Generator.php line 367 OC\Preview\GeneratorHelper->getThumbnail() 18. /var/www/nextcloud/iat/lib/private/Preview/Generator.php line 343 OC\Preview\Generator->generateProviderPreview() 19. /var/www/nextcloud/iat/lib/private/Preview/Generator.php line 149 OC\Preview\Generator->getMaxPreview() 20. /var/www/nextcloud/iat/lib/private/Preview/Generator.php line 116 OC\Preview\Generator->generatePreviews() 21. /var/www/nextcloud/iat/lib/private/PreviewManager.php line 192 OC\Preview\Generator->getPreview() 22. /var/www/nextcloud/iat/apps/files_sharing/lib/Controller/PublicPreviewController.php line 125 OC\PreviewManager->getPreview() 23. /var/www/nextcloud/iat/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Files_Sharing\Controller\PublicPreviewController->getPreview() 24. /var/www/nextcloud/iat/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController() 25. /var/www/nextcloud/iat/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch() 26. /var/www/nextcloud/iat/lib/private/Route/Router.php line 315 OC\AppFramework\App::main() 27. /var/www/nextcloud/iat/lib/base.php line 1068 OC\Route\Router->match() 28. /var/www/nextcloud/iat/index.php line 36 OC::handleRequest() GET /index.php/apps/files_sharing/publicpreview/aqanyFbDXewaKGr?x=1920&y=542&a=true&file=%252FF%25C3%25B6rderdashboard.xlsm&scalingup=0 from 178.254.13.17 at 2023-12-01T10:26:52+00:00 ``` #### Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
juliushaertl commented 9 months ago

Thanks for reporting. Yes, we should probably do the following for public link shares: