Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Self-hosted + Cloudflare R2: camera-only Instant recordings fail with "InvalidPart: All non-trailing parts must have the same length"

Đã đóng
#2,275 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cloud

Hướng nghiên cứu

Bắt đầu với packages/recorder-core/src/instant-mp4-uploader.ts và lần theo đường dẫn upload của Instant Mode chỉ dành cho camera, so sánh với đường dẫn đang hoạt động cho màn hình hoặc cửa sổ. Tái hiện vấn đề với Cloudflare R2 bằng các bước trong issue và kiểm tra cách các phần multipart được đệm được flush. Hoàn thành có nghĩa là các bản ghi chỉ từ camera hoàn tất thành công với R2 trong khi vẫn giữ nguyên các upload hiện có đang hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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) and cap-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

  1. Point Cap Desktop at a self-hosted server whose bucket is Cloudflare R2.
  2. Instant Mode, choose camera only (no screen), record about 30 s, stop.
  3. The upload never completes; cap-web logs the InvalidPart error above.
  4. 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_SIZE option) and switch to constant part sizes there.

Workaround for now: record camera-only videos in Studio Mode.

Ngôn ngữ chính
Rust
Star
23k
Fork
2k
Merge trung bình
13 giờ 2 phút
Pull request đã merge (30 ngày)
70

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CapSoftware/Cap

Tất cả issue của CapSoftware/Cap

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.