[Bug]: Timeouts due to large number of synchronous requests by OnlyOffice
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Nextcloud server ending up in timeouts (Error 504 Gateway Time-out) when OnlyOffice is requesting thumbnails. Already contacted OnlyOffice support who came to the following conclusion:
While working on the bug, we came to the conclusion that the solution needs to be deployed on the Nextcloud side and here is why:
The mechanism for converting thumbnails is implemented on the Nextcloud side and ONLYOFFICE works here as a tool by converting the thumbnail of the defined size from the exact file. Conversion requests are synchronised, Nextcloud triggers the method and waits for the result as a response.
The conversion request has a timeout of 2 minutes https://github.com/ONLYOFFICE/onlyoffice-nextcloud/blob/9da6d31f7d3b0610474890bbf89a5b65360fb8a6/lib/DocumentService.php#L172 The queue can be loaded and with a large number of requests the response time can reach the timeout time. Changing the timeout time will not solve the problem, so we cannot change the behaviour on our side.
It looks like handling a large number of synchronous requests should be implemented in the core of Nextcloud, as errors occur there due to overload.
Please contact the Nextcloud support team and describe the problem. If necessary, you can ask them to get in touch with us directly.
Steps to reproduce
- Install OnlyOffice app and connect OnlyOffice server
- Activate the document previews option under /settings/admin/onlyoffice
Expected behavior
OnlyOffice should properly generate document previews while Nextcloud is up and running.
Nextcloud Server version
30
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
Running a managed Nextcloud server hosted by Hetzner.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the timeout with OnlyOffice document previews enabled under /settings/admin/onlyoffice, then review the linked OnlyOffice lib/DocumentService.php timeout behavior and the corresponding Nextcloud request path. The issue provides no Nextcloud file, test, logs, or configuration report, so the affected entry point and an appropriate regression test still need to be identified. Done means previews continue to generate without 504 timeouts under a large request load.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100