fix: route V1 ListObjects to the list handler instead of raw-forwarding#93
Merged
Merged
Conversation
_dispatch_bucket raw-forwarded any bucket GET whose query lacked list-type/delete/uploads/location to the backend. A V1 ListObjects (GET /bucket?prefix&delimiter&max-keys&encoding-type, no list-type=2) matched that catch-all, so it was sent verbatim to the backend as V1 — which Hetzner rejects with HTTP 400. handle_list_objects_v1 (which now serves V1 via the backend's V2 API, #92) was only ever reached for a bare 'GET /bucket' with no query, so the fix didn't apply to the requests scylla-manager's rclone and barman-cloud-backup-delete actually send. Treat a GET whose query is only listing params (prefix, delimiter, marker, max-keys, encoding-type, fetch-owner, start-after, continuation-token, list-type) as a listing and fall through to the list handler; still raw-forward genuine sub-resource GETs (acl, versioning, cors, ...).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Even after #92 (serve V1 ListObjects via the backend's V2 API), Scylla backups and Postgres retention still got HTTP 400 from Hetzner. Reason: the request never reached the fixed handler.
_dispatch_bucketraw-forwards any bucket GET whose query lackslist-type/delete/uploads/location:A V1
ListObjectsisGET /bucket?prefix&delimiter&max-keys&encoding-typewith nolist-type=2→ it matched this catch-all and was forwarded verbatim to the backend as V1 → Hetzner 400.handle_list_objects_v1was only reached for a bareGET /bucket(empty query), so #92's translation never applied to what rclone / barman actually send.Confirmed on 2026.6.9: backend request logged as
GET https://hel1.your-objectstorage.com/…-scylladb-backups-v3?delimiter=%2F&encoding-type=url&max-keys=1000&prefix=… → HTTP/2 400(nolist-type=2→ still V1).Fix
Treat a bucket GET whose query is only listing params (
prefix,delimiter,marker,max-keys,encoding-type,fetch-owner,start-after,continuation-token,list-type) as a listing → fall through to the list handler (which serves V1 via the backend's V2 API). Genuine sub-resource GETs (acl,versioning,cors,location, …) still raw-forward unchanged.Test
tests/unit/test_dispatch_v1_list.py: V1-with-params and bareGET /bucketroute tohandle_list_objects_v1;list-type=2→ V2 handler;?acl/?versioningstill forward;?location→ bucket-location. Pre-fix the V1-with-params case routes toforward(asserted). Full unit suite green (546 passed); ruff check + format clean.Completes the chain: #91 (V2 token) → #92 (V1→V2 in handler) → this (route V1 to the handler).