Intermittent HTTP 500 in proxy.php on document close: /cool/ request reaches EOF before response headers
まだ誰も着手していません。
評価
調査の方向性
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分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
-
Server audit alertsオープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
CollaboraOnline/richdocumentscode#337 · リアクション 5 件 ·
CollaboraOnline/richdocumentscode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
vimeo/psalm#14139 · コメント 1 件 ·
メンテナーはふだん 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 日以内に返信