Self-hosted + Cloudflare R2: camera-only Instant recordings fail with "InvalidPart: All non-trailing parts must have the same length"
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- cloud
Direzione di ricerca
Inizia da packages/recorder-core/src/instant-mp4-uploader.ts e traccia il percorso di upload di Instant Mode solo fotocamera, confrontandolo con il percorso funzionante per schermo o finestra. Riproduci il problema con Cloudflare R2 usando i passaggi nell’issue e analizza come vengono svuotate le parti multipart memorizzate nel buffer. Il lavoro è completato quando le registrazioni solo fotocamera vengono completate correttamente con R2, preservando gli upload esistenti funzionanti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On a self-hosted instance that uses Cloudflare R2 as the S3 bucket, camera-only Instant Mode recordings from Cap Desktop (Windows) never finish uploading. Screen, window and area Instant recordings upload and play fine against the same bucket.
cap-web logs this on each camera-only attempt:
Multipart upload failed: eS [StorageError]: { "cause": S3Error: { "cause": InvalidPart: All non-trailing parts must have the same length. } (cause: InvalidPart: All non-trailing parts must have the same length.) }
The video row is created with source: {"type": "desktopMP4"}, but no outputKey, previewKey or thumbnailKey is ever set.
Likely cause
Cloudflare R2's multipart API has a rule AWS S3 doesn't: every part except the last must be exactly the same size (R2 docs: "All parts except the last one must be the same size"). The progressive uploader appears to send variable-size parts: flushes of at least MIN_PART_SIZE_BYTES (5 MiB), sized by whatever was buffered, as in packages/recorder-core/src/instant-mp4-uploader.ts. AWS and MinIO accept that; R2 rejects it at CompleteMultipartUpload. Camera-only seems to take a different upload path from screen recordings, so only that mode hits it.
Environment
- Self-hosted via Docker Compose,
ghcr.io/capsoftware/cap-web@sha256:8ee4cbd3fd87...(latest as of 2026-09-07) andcap-media-server@sha256:886ecc9b5684... - Storage: Cloudflare R2,
CAP_AWS_REGION=auto, path-style, private bucket - Cap Desktop for Windows (current download as of 2026-09-11; bundled CLI 0.1.0)
Steps to reproduce
- Point Cap Desktop at a self-hosted server whose bucket is Cloudflare R2.
- Instant Mode, choose camera only (no screen), record about 30 s, stop.
- The upload never completes;
cap-weblogs theInvalidParterror above. - Repeat with a screen or window target: it works.
Possible fixes
- Use fixed-size parts for all non-final parts (re-chunk the buffer to a constant size, e.g. 5 or 8 MiB, carrying the remainder forward), or
- Detect R2 endpoints (or add a
S3_FIXED_PART_SIZEoption) and switch to constant part sizes there.
Workaround for now: record camera-only videos in Studio Mode.
- Lingua principale
- Rust
- Stelle
- 22.5k
- Fork
- 1.9k
- Merge medio
- 7h 43m
- PR unite (30g)
- 80
Guida per i contributori
Apri 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 CapSoftware/Cap
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
CapSoftware/Cap#2305 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CapSoftware/Cap#1714 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
CapSoftware/Cap#2340 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
CapSoftware/Cap#2339 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
CapSoftware/Cap#2329 · 2 commenti ·
Tutte le issue di CapSoftware/Cap
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
todo:ticket
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
taikoxyz/taiko-mono#22168 · 1 commento ·