Ivan Starkov
Ivan Starkov
CDCloudflare Developers
Created by Ivan Starkov on 5/16/2024 in #r2
Issue: net::ERR_CONTENT_DECODING_FAILED
4 replies
CDCloudflare Developers
Created by Ivan Starkov on 5/16/2024 in #r2
Issue: net::ERR_CONTENT_DECODING_FAILED
Probably this flag https://developers.cloudflare.com/workers/platform/changelog/#2024-04-03 brotli_content_encoding is now default
4 replies
CDCloudflare Developers
Created by Ivan Starkov on 5/16/2024 in #r2
Issue: net::ERR_CONTENT_DECODING_FAILED
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)
4 replies
CDCloudflare Developers
Created by Ivan Starkov on 5/16/2024 in #r2
Issue: net::ERR_CONTENT_DECODING_FAILED
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
4 replies
CDCloudflare Developers
Created by SUPENOI on 5/16/2024 in #general-help
Get net::ERR_CONTENT_DECODING_FAILED 200 (OK), start from yesterday our JS sometimes got this error
But we have sooo many files that I'm not sure we can do that
8 replies
CDCloudflare Developers
Created by SUPENOI on 5/16/2024 in #general-help
Get net::ERR_CONTENT_DECODING_FAILED 200 (OK), start from yesterday our JS sometimes got this error
The fix is to replace metadata
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
8 replies
CDCloudflare Developers
Created by SUPENOI on 5/16/2024 in #general-help
Get net::ERR_CONTENT_DECODING_FAILED 200 (OK), start from yesterday our JS sometimes got this error
Also seems like all broken files has following metadata on r2
"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"
}
And all non broken has just Filename in the metadata
8 replies
CDCloudflare Developers
Created by SUPENOI on 5/16/2024 in #general-help
Get net::ERR_CONTENT_DECODING_FAILED 200 (OK), start from yesterday our JS sometimes got this error
8 replies
CDCloudflare Developers
Created by SUPENOI on 5/16/2024 in #general-help
Get net::ERR_CONTENT_DECODING_FAILED 200 (OK), start from yesterday our JS sometimes got this error
And in our case it's also somehow related to r2 as original content is on r2
8 replies
CDCloudflare Developers
Created by SUPENOI on 5/16/2024 in #general-help
Get net::ERR_CONTENT_DECODING_FAILED 200 (OK), start from yesterday our JS sometimes got this error
Same here. The error is random. From what I see this error is always for cached content. Cf-Cache-Status: HIT And Content-Encoding: gzip in response headers.
8 replies