r2 objects delete and bulk-delete exit 0 without deleting keys that contain '/'
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- cli
Direzione di ricerca
Start by locating the r2 objects delete and bulk-delete command implementations and their request-path construction; compare that behavior with the issue's reference to #113 and the CLI help text about literal slashes. Reproduce with a key containing / and inspect the generated request path. Done when both commands delete the exact key and a missing key is not reported as a successful deletion without notice.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary of the issue
cf r2 objects delete and cf r2 objects bulk-delete report success but delete nothing when the object key contains /.
The CLI percent-encodes / in the key as %2F in the request path, the same root cause as #113 for put. R2 answers a DELETE for a key that does not exist with success, so the command exits 0, prints no error, and the real object stays in place. Nothing tells the user that the delete missed.
cf r2 objects get builds the path the same way (--dry-run shows %2F), but it returned the correct object body in our tests, so only deletes failed silently.
This is easy to miss in cleanup scripts. Ours reported 2,220 objects deleted with zero errors, and a re-listing showed that all of them were still in the bucket.
Expected behaviour
The CLI follows its own help text: "Slashes (/) within the key MUST be sent literally and MUST NOT be percent-encoded". The delete removes the object at the given key.
If the request does not match an existing key, the CLI should at least say so instead of exiting 0 silently.
Version of cf used
1.0.0-beta.12
System information and package versions
- macOS 26.6.2 (arm64)
- Node.js v22.22.2
cfinstalled globally with npm- wrangler 4.77.0, used as the working comparison
Reproduction (optional)
export CLOUDFLARE_ACCOUNT_ID=<account>
echo hi > /tmp/a.txt
cf r2 objects put folder/a.txt --bucket-name <bucket> --file /tmp/a.txt --content-type text/plain
cf r2 objects delete folder/a.txt --bucket-name <bucket> --dry-run
# url ends with .../objects/folder%2Fa.txt
cf r2 objects delete folder/a.txt --bucket-name <bucket> # exit 0, no error
cf r2 objects list --bucket-name <bucket> --prefix folder/ # object is still listed
wrangler r2 object delete <bucket>/folder/a.txt --remote # actually deletes it
The bulk-delete delete-by-list mode (--body '["folder/a.txt"]') also exits 0 and leaves the object in place.
Relevant error logs (optional)
There are no errors, which is the problem.
- Lingua principale
- TypeScript
- Stelle
- 916
- Fork
- 53
- Merge medio
- 18h 26m
- PR unite (30g)
- 177
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/cf
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/cf#344 ·
I maintainer di solito rispondono entro 1 giorno
-
upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/cf#262 ·
I maintainer di solito rispondono entro 1 giorno
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templateForse già presa @jamesopstad l’ha presa 8 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/cf#223 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cloudflare/cf#179 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
cloudflare/cf#380 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudflare/cf
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
zts212653/clowder-ai#1678 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Progressive-Victory/the-website#680 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100