Intermittent HTTP 500 in proxy.php on document close: /cool/ request reaches EOF before response headers
还没有人认领这个 Issue。
评估
调研方向
Start by reading richdocumentscode/proxy.php, especially the response-reading logic where fread() returns EOF before response headers arrive. Then identify which /cool/ operation runs during document close and compare its connection lifecycle with CODE-side events; the payload does not identify a specific operation or test. Done means establishing whether the close is expected and, if so, defining appropriate proxy handling, with a reproducible check for the HTTP 500.
由索引模型根据 Issue 内容生成。
描述
Description
When using the built-in Collabora CODE server with Nextcloud 34, intermittent HTTP 500 responses occur in richdocumentscode/proxy.php, typically immediately after closing an Office document.
The editor remains functional: documents can be opened, edited, saved, and reopened successfully. The HTTP 500 errors have only been observed in server logs, without a corresponding visible browser error.
Temporary, error-triggered PHP instrumentation confirmed that the proxy encounters EOF while still waiting for HTTP response headers from the local CODE server.
The affected request belongs to the /cool/ endpoint category. The exact operation and the reason for the connection termination remain unknown.
Environment
| Component | Version / configuration |
|---|---|
| Operating system | Debian 12 |
| Virtualization | Xen guest |
| Nextcloud | 34.0.5.1 |
Nextcloud Office (richdocuments) |
11.1.2 |
Built-in CODE (richdocumentscode) |
26.4.502 |
| PHP | 8.2, PHP-FPM |
| Web server | Apache, event MPM |
| Reverse proxy | nginx |
| CODE connection | Local TCP loopback, port 9983 |
| CODE local SSL | Disabled |
The local CODE connection uses plain HTTP. This is intentional and does not establish an SSL configuration problem.
Steps to reproduce
- Open an existing DOCX or ODS document using Nextcloud Office with built-in CODE.
- Edit the document and save the changes.
- Close the document editor.
- Inspect the Apache access and error logs for requests to
richdocumentscode/proxy.php. - Repeat if necessary, as the issue is intermittent.
Actual behavior
Occasionally, a POST request to richdocumentscode/proxy.php returns HTTP 500 immediately after the document is closed.
The Apache error log reports:
No content in reply from coolwsd. Is SSL enabled in error ?
The error originates from the PHP proxy's response-reading logic when fread() returns an empty string while response headers are still expected.
Instrumentation results
Two separate reproductions were captured using temporary, error-triggered instrumentation.
First reproduction:
rest_bytes=0
eof=1
timed_out=0
unread_bytes=0
A single HTTP 500 POST to richdocumentscode/proxy.php was recorded during the same reproduction window.
Second reproduction:
endpoint=cool
rest_bytes=0
eof=1
timed_out=0
unread_bytes=0
The endpoint classification was derived from the normalized request path without logging document identifiers, tokens, or complete URLs.
An independently correlated HTTP 500 access-log entry was not established for the second reproduction.
Interpretation
The observations indicate that:
- The PHP proxy encounters EOF before receiving any HTTP response-header bytes.
- PHP does not report a stream timeout.
- No unread buffered bytes were reported.
- At least one affected request belongs to the
/cool/endpoint category. - The exact
/cool/operation remains unidentified. - The initiator and reason for the connection termination have not been established.
These observations do not prove that CODE crashed, that SSL is misconfigured, or that the connection termination itself was abnormal.
Expected behavior
Closing a document should not produce an unexplained HTTP 500 response.
If a connection is intentionally terminated during a normal document-close operation, the proxy should handle that condition appropriately rather than reporting an unexpected upstream failure.
Additional observations (causal relationship not established)
During the investigation, several other potentially relevant symptoms were observed:
- HTTP 404: Repeated GET requests returned HTTP 404. During one approximately two-minute reproduction window, ten such responses were recorded. The affected endpoints have not yet been classified.
- EPIPE / Broken pipe: Broken-pipe errors have also been reported during the broader investigation. Their exact source, frequency, and temporal relationship to the HTTP 500 events have not yet been verified.
- Normal document functionality: Editing, saving, and reopening documents continued to work.
- Increasing the PHP-FPM worker limit did not eliminate the observed problem.
It is currently unknown whether these observations share a common cause or represent independent issues.
Diagnostic limitations
A separate system-call trace was performed with socket and I/O events, without capturing application payloads.
The trace did not establish a definitive request-to-socket correlation or identify the specific CODE operation responsible for the HTTP 500.
Therefore, the evidence is insufficient to determine whether the EOF results from an expected document-close sequence, a CODE-side error, or another connection-lifecycle condition.
Temporary instrumentation and rollback
The diagnostic instrumentation was applied only temporarily to the PHP proxy and has been completely removed.
The restored production file was verified to be byte-identical to the saved original. PHP syntax validation succeeded, and PHP-FPM remained active after rollback.
Questions for maintainers
- Are there known
/cool/operations during document closure that may intentionally close the upstream connection without sending an HTTP response? - Could this behavior be related to the connection lifecycle of the built-in CODE proxy?
- Should
proxy.phpdistinguish between an expected connection closure and an unexpected upstream EOF? - Is there a recommended privacy-preserving way to identify the specific
/cool/operation and correlate the PHP request with CODE-side events? - Is this a known issue in
richdocumentscode26.4.502?
Related issue
- CollaboraOnline/richdocumentscode#358 concerns a different observed proxy response-handling problem. No shared root cause is established.
Impact
Low observed operational impact.
The issue generates intermittent HTTP 500 entries in server logs, but document editing and saving remain functional. No confirmed data loss or user-visible failure has been observed.
- 主要语言
- PHP
- 星标
- 156
- 派生
- 37
- 平均合并
- 23 小时 51 分钟
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CollaboraOnline/richdocumentscode 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
CollaboraOnline/richdocumentscode#355 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 48/100
CollaboraOnline/richdocumentscode#339 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 43/100
CollaboraOnline/richdocumentscode#338 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
CollaboraOnline/richdocumentscode#337 · 5 个 reaction ·
查看 CollaboraOnline/richdocumentscode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复
-
sync-en
难度 1/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
wpvc
难度 1/5 1-3 小时 新手友好度 67/100
10up/simple-local-avatars#386 ·
-
not confirmed
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 1 天内回复
-
Bug (unconfirmed) Documentation :books:
难度 1/5 1 小时以内 新手友好度 88/100
FreshRSS/FreshRSS#9577 · 4 条评论 ·
维护者通常 1 天内回复