`cf r2 objects get` ignores `--cf-r2-jurisdiction` (10006 for buckets in the eu jurisdiction)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 50/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start in generator/plugin/emit/handler.ts, in the bodyless raw-output branch of handler() where emitRawTail is called with an empty list, and compare it with the body-sending branches that pass headers when ctx.hasHeaders is set. The generated output is r2/objects/get.ts, so regenerate after the change. Done means cf r2 objects get sends cf-r2-jurisdiction and the generator output for that command includes the header. The issue says the earlier fix PR was closed under the beta contribution policy, so confirm with maintainers before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary of the issue
cf r2 objects get accepts --cf-r2-jurisdiction, --if-none-match and --if-modified-since, but never sends them. The generated handler builds a headers map from these flags and then calls fetchRawBytes without it. As a result, objects in a bucket in the eu jurisdiction cannot be read: the API answers 10006 "The specified bucket does not exist".
r2 objects list, put and delete send the header, so only get fails.
The cause is in the generator. In generator/plugin/emit/handler.ts, the bodyless raw-output branch of handler() calls emitRawTail(ctx, " ", url, []), which leaves out the headers option. The raw branches that send a body add headers: ${HEADERS_GUARDED} when ctx.hasHeaders is set. r2/objects/get.ts is the only generated command affected.
A fix with a generator test and an MSW command test is in #302, which was closed automatically under the beta contribution policy. It passes headers on that branch and regenerates r2/objects/get.ts. Nothing else changes.
Expected behaviour
cf r2 objects get <key> --bucket-name <bucket> --cf-r2-jurisdiction eu sends cf-r2-jurisdiction: eu and writes the object body to stdout, like the other r2 objects commands.
Version of cf used
1.0.0-beta.5. The same handler code is in 1.0.0-beta.16 and on main (d72b8554).
System information and package versions
System:
OS: macOS 26.6.2
CPU: (16) arm64 Apple M4 Max
Memory: 217.30 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.20.0
npm: 11.19.0
pnpm: 12.11.1
bun: 1.4.2
cf installed globally with bun.
Reproduction (optional)
- Create a bucket in the
eujurisdiction and put an object in it. - Run
cf r2 objects list --bucket-name <bucket> --cf-r2-jurisdiction eu. This works. - Run
cf r2 objects get <key> --bucket-name <bucket> --cf-r2-jurisdiction eu > out. This fails with the error below, andoutis empty.
Logging globalThis.fetch shows the get request is sent with only user-agent and x-cf-cli-mode (plus Authorization), and no cf-r2-jurisdiction. With the one-line change from #302 applied to 1.0.0-beta.5, the same command returns the object.
Relevant error logs (optional)
┌ APIError
│ [10006] The specified bucket does not exist.
│ 404 Not Found · HTTP /accounts/<account-id>/r2/buckets/<bucket>/objects/<key>
└
- Lenguaje dominante
- TypeScript
- Estrellas
- 993
- Forks
- 65
- Merge medio
- 18 h 28 min
- PR fusionados (30 d)
- 207
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudflare/cf
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cf#344 ·
Los mantenedores suelen responder en 1 día
-
upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cloudflare/cf#262 ·
Los mantenedores suelen responder en 1 día
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templatePosiblemente ocupada @jamesopstad la tomó hace 23 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cloudflare/cf#223 · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/cf#179 ·
Los mantenedores suelen responder en 1 día
-
`cf migrate` fails with `ERR_PNPM_IGNORED_BUILDS` in a pnpm workspace that has not approved workerdAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
cloudflare/cf#511 ·
Los mantenedores suelen responder en 1 día
Todos los issues de cloudflare/cf
Issues similares
-
Report: &TV InternationalAbiertocheck:passed streams:remove
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug priority-p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
beginner blocked
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
hiero-ledger/hiero-sdk-js#4670 ·
Los mantenedores suelen responder en 1 día
-
[Exploratory] Expense - 2 selected drop-down is shown twice when selecting hold from more option.AbiertoMonthly Not a priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Expensify/App#106080 · 1 comentario ·
Los mantenedores suelen responder en 1 día