[Bug]: Python snapshot reads accept unsuccessful binary HTTP responses

Aperta
#7,448 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@stefanielizeth73-art ci sta già lavorando.

Dal 11/11/2026.

  • #7451 di @stefanielizeth73-art — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Start at the Python SDK’s AsyncHTTPClient.git_show(..., path=...) response handling for /api/v1/snapshot/show, then check how the sync client and client.snapshot.show() use that path. Reproduce with an HTTP 503 response carrying Content-Type: application/octet-stream, and inspect the existing response/error handler. Done means failures raise the SDK error before snapshot metadata is parsed while successful binary responses retain their bytes and metadata. PR #7451 is already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue Origin

Reproduced through the public Python SDK against a local HTTP fixture. The fixture supplies an HTTP 503 response; no deployed OpenViking server or model was used.

Bug Description

AsyncHTTPClient.git_show(..., path=...) recognizes a snapshot blob solely by Content-Type: application/octet-stream, before checking the HTTP status. A 503 binary response therefore becomes a successful {oid, size, bytes} result. The same behavior reaches the sync client and client.snapshot.show().

Steps to Reproduce
  1. Serve HTTP 503 with Content-Type: application/octet-stream and body upstream unavailable at /api/v1/snapshot/show.
  2. Initialize AsyncHTTPClient or SyncHTTPClient against that endpoint.
  3. Call client.snapshot.show("HEAD", path="viking://resources/a.txt").
Expected Behavior

An unsuccessful HTTP response raises the existing SDK error. It cannot become snapshot file content. Successful binary responses retain their bytes and snapshot metadata.

Actual Behavior

Both clients return {"oid": "", "size": 0, "bytes": b"upstream unavailable"}. With a malformed X-Snapshot-Size on the failed response, header parsing can also mask the HTTP failure with ValueError.

Proposed Fix and Compatibility

Require a successful HTTP status before entering the existing binary branch. Route failures through the current response/error handler before reading snapshot metadata. Keep successful binary responses, missing-header defaults and JSON metadata requests unchanged. No server, storage or wire-format changes are needed.

OpenViking Version

Current main 32de68480d36593648563f749d9af7a4a817489f.

Python Version

Python 3.13.9, httpx 0.28.1.

Operating System

Windows 11.

Model Backend

Not involved.

Additional Context

This follows the SDK response-failure work in #7058 and #7358, at the separate snapshot-read entrypoint. The investigation and local reproduction were completed with Codex assistance.

Lingua principale
Python
Stelle
41.8k
Fork
3.4k
Merge medio
19h 29m
PR unite (30g)
500

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di volcengine/OpenViking

Tutte le issue di volcengine/OpenViking

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.