[RESOLVED] Attachment downloads broken
Not just me as I checked after someone else noticed.
All attachment downloads error with a 'source cannot be read' error.
1 Attachment(s)
Re: Attachment downloads broken
Re: Attachment downloads broken
I get -> 'source cannot be read' error on existing attachments....
I get -> 502 Bad Gateway -
cloudflare
On the file I just uploaded above.
1 Attachment(s)
Re: Attachment downloads broken
Inserting Images is broken too. It was reported yesterday.
Re: [RESOLVED] Attachment downloads broken
Re: [RESOLVED] Attachment downloads broken
I thought that some of you would like to see this:
Quote:
Originally Posted by
ta_devops
Root cause: A shared PHP include was sending output before vBulletin’s attachment.php could set headers. Specifically, the file ended with a closing PHP tag ?> and a trailing newline, which emits a byte.
Why it broke (especially via Cloudflare): With HTTP/2 to origin enabled, Cloudflare expects clean, correctly framed responses. That stray output forced default headers (text/html + chunked), so the binary attachment stream no longer matched expectations and Cloudflare returned 502 on GET requests.
The fix: Removed the trailing ?> (and any whitespace) at the end of the culprit PHP files so they can’t output early. Turned compression off for attachment.php at the origin (Apache + PHP) to ensure stable Content-Length for streamed files.
Result: Attachments download normally again, even with HTTP/2 to origin on.
Best practice going forward: we shouldn't use ?> at the end of PHP-only files, we should avoid any echo/print/whitespace in includes that run before file downloads, and we should exclude download endpoints from origin/edge compression.
Re: [RESOLVED] Attachment downloads broken
AND.... The "Reply With Quote" button is back to working with One Click.