Results 1 to 7 of 7

Thread: [RESOLVED] Attachment downloads broken

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,654

    Resolved [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.

  2. #2
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,345

    Re: Attachment downloads broken

    Test
    Attached Files Attached Files

  3. #3
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,345

    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.

  4. #4
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,345

    Re: Attachment downloads broken

    Inserting Images is broken too. It was reported yesterday.
    Attached Images Attached Images  

  5. #5
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,345

    Re: [RESOLVED] Attachment downloads broken

    Resolved.

  6. #6
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,345

    Re: [RESOLVED] Attachment downloads broken

    I thought that some of you would like to see this:

    Quote Originally Posted by ta_devops View Post
    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.

  7. #7
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Clearwater, FL.
    Posts
    2,345

    Re: [RESOLVED] Attachment downloads broken

    AND.... The "Reply With Quote" button is back to working with One Click.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width