Issue: net::ERR_CONTENT_DECODING_FAILED

Issue: net::ERR_CONTENT_DECODING_FAILED 200 (OK) started yesterday Observation: This error occurs randomly and only for cached content (Cf-Cache-Status: HIT). The response headers show Content-Encoding: gzip. Cause: The issue seems related to R2 storage, as it can be reproduced directly on R2. Examples: • Error: https://pub-f0eceff175764d6daad6785b769f727b.r2.dev/stars_zoWSu63q603uN2jJgPjzJ.svg • No Error: https://pub-f0eceff175764d6daad6785b769f727b.r2.dev/WS-logo-white_YEQ0Xbj7_5v5mHD2F_nt4.svg Metadata Difference: Using aws s3api head-object --bucket assets-production --key {objectKey}: Problematic Metadata:
"Metadata": {
"atime": "2023-05-05T03:22:29.049615243+04:00",
"btime": "2023-03-25T03:30:05.129+04:00",
"filename": "blabla.svg",
"gid": "20",
"mode": "100644",
"mtime": "1679700605.129",
"uid": "501"
}
"Metadata": {
"atime": "2023-05-05T03:22:29.049615243+04:00",
"btime": "2023-03-25T03:30:05.129+04:00",
"filename": "blabla.svg",
"gid": "20",
"mode": "100644",
"mtime": "1679700605.129",
"uid": "501"
}
Files without issues only have filename in the metadata.
2 Replies
Ivan Starkov
Ivan Starkov6mo ago
Using following
aws s3api copy-object \
--bucket assets-production \
--key check_DzyMpjZxBu1k6O8JoHeNK.svg \
--copy-source assets-production/check_DzyMpjZxBu1k6O8JoHeNK.svg \
--metadata-directive REPLACE \
--cache-control "public, max-age=31536004,immutable" \
--content-type "image/svg+xml" \
--metadata filename=check_DzyMpjZxBu1k6O8JoHeNK.svg
aws s3api copy-object \
--bucket assets-production \
--key check_DzyMpjZxBu1k6O8JoHeNK.svg \
--copy-source assets-production/check_DzyMpjZxBu1k6O8JoHeNK.svg \
--metadata-directive REPLACE \
--cache-control "public, max-age=31536004,immutable" \
--content-type "image/svg+xml" \
--metadata filename=check_DzyMpjZxBu1k6O8JoHeNK.svg
Seems like solves the issue BUUUT we have enormous amount of such files, we are saas service and solution above is hard for us to do fast Not sure 100% but seems like changing workers compatibility date "2023-05-01" => "2024-05-16" solved the proxying of such files. So worker with code
const imageRequest = new Request(
imageUrl.href,
new Request(request, {
headers,
})
);
return fetch(imageRequest);
const imageRequest = new Request(
imageUrl.href,
new Request(request, {
headers,
})
);
return fetch(imageRequest);
now has no issues At least I can't reproduce for a long time. (before this error after worker was also random enough so hard to say does compatibility flag solved anything) Probably this flag https://developers.cloudflare.com/workers/platform/changelog/#2024-04-03 brotli_content_encoding is now default
Want results from more Discord servers?
Add your server