What is the name of the domain?
none
What is the issue you’re encountering
[R2] response to range request has headers, no content
What steps have you taken to resolve the issue?
We migrated our files to another object storage provider using Flexify.
What are the steps to reproduce the issue?
We’re using GDAL to read small sections of Cloud-optimised GeoTIFFs directly from object storage. The code in question might look something like:
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "gdal",
# "numpy",
# ]
# ///
import os
from osgeo import gdal
from osgeo.gdal import Open
gdal.SetConfigOption("AWS_S3_ENDPOINT", os.environ.get("S3_ENDPOINT_URL"))
gdal.SetConfigOption("AWS_ACCESS_KEY_ID", os.environ.get("S3_ACCESS_KEY_ID"))
gdal.SetConfigOption("AWS_SECRET_ACCESS_KEY", os.environ.get("S3_SECRET_ACCESS_KEY"))
gdal.SetConfigOption("CPL_CURL_VERBOSE", "YES")
raster = Open("/vsis3/<redacted>/<redacted>/<redacted>/20.tif")
print(raster)
band = raster.GetRasterBand(1)
print(band)
value = band.ReadAsArray(327600, 149162, 1, 1)
print(value)
This has worked fine on Cloudflare R2 for about 2 years, but yesterday requests started timing out or dropping before the content was sent. That is, the headers are sent, but the body is not. For example:
* Connected to <redacted>.<redacted>.r2.cloudflarestorage.com (162.159.141.50) port 443
* ALPN: curl offers h2,http/1.1
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted http/1.1
* Server certificate:
* subject: CN=r2.cloudflarestorage.com
* start date: May 22 05:44:13 2025 GMT
* expire date: Aug 20 06:44:08 2025 GMT
* subjectAltName: host "<redacted>.<redacted>.r2.cloudflarestorage.com" matched cert's "*.<redacted>.r2.cloudflarestorage.com"
* issuer: C=US; O=Google Trust Services; CN=WE1
* SSL certificate verify ok.
* using HTTP/1.x
> GET /<redacted>/<redacted>/20.tif HTTP/1.1
Host: <redacted>.<redacted>.r2.cloudflarestorage.com
User-Agent: GDAL/3.11.0
Accept: */*
Range: bytes=12075008-12091391
x-amz-date: 20250611T015750Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Authorization: AWS4-HMAC-SHA256 Credential=<redacted>/20250611/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=<redacted>
* Request completely sent off
< HTTP/1.1 206 Partial Content
< Date: Wed, 11 Jun 2025 01:57:51 GMT
< Content-Type: image/tiff
< Content-Length: 16384
< Connection: keep-alive
< Content-Range: bytes 12075008-12091391/2147686551
< Accept-Ranges: bytes
< ETag: "ebabf88597fd90f5ae8d8944537dff4d-410"
< Last-Modified: Wed, 16 Aug 2023 12:50:00 GMT
< x-amz-meta-md5chksum: Tk/fDltRV7OQo8G318xkbg==
< x-amz-meta-mtime: 1692190039.839
< x-amz-mp-parts-count: 410
< Server: cloudflare
< CF-RAY: 94dd800309da414b-HAM
<
* transfer closed with 16384 bytes remaining to read
* Closing connection
We’ve contacted support, provided the above information, but not heard anything back. Given this is a major production outage for us, we migrated our ~4 TB to another object storage provider and pointed our application at that. Only took an hour to migrate - less time than I spent chatting with support.
I’m providing this for anyone else experiencing similar R2 read timeouts on Range requests. The errors emitted from GDAL are like this:
ERROR 1: _TIFFPartialReadStripArray:Cannot read offset/size for strile around ~853909
ERROR 1: 20.tif, band 1: IReadBlock failed at X offset 1279, Y offset 582: _TIFFPartialReadStripArray:Cannot read offset/size for strile around ~853909
Best of luck!