Skip to content

[Bug] Video processing fails with "ArrayBuffer.prototype.slice on a detached ArrayBuffer" on self-hosted Docker #1651

@eumatheusmoura

Description

@eumatheusmoura

Description

Video uploads complete successfully (multipart upload to MinIO works), but processing always fails with a TypeError: fetch failed caused by ArrayBuffer.prototype.slice on a detached ArrayBuffer.

The media-server never receives any processing request — only health checks. The error occurs inside cap-web when it tries to send the video to the media-server.

Error

[local world] Queue operation failed: TypeError: fetch failed
at async (.next/server/chunks/385.js:30:10424) {
[cause]: TypeError: Cannot perform ArrayBuffer.prototype.slice on a detached ArrayBuffer
at ArrayBuffer.slice ()
}

Environment

  • Image: ghcr.io/capsoftware/cap-web:latest (v0.3.1, built 2026-02-16)
  • Node.js in image: v24.13.1
  • Host OS: Ubuntu, kernel 6.8.0-90-generic
  • RAM: 8GB + 4GB swap
  • Platform: Easypanel (Docker Compose)
  • Storage: MinIO (self-hosted, working correctly)
  • Media server: ghcr.io/capsoftware/cap-media-server:latest (healthy, FFmpeg 6.1.2)

What I tried (none resolved it)

  1. Custom image with Node.js 22 (v22.22.1) — same error
  2. UV_USE_IO_URING=0 — no effect
  3. UNDICI_NO_FETCH=1 — no effect
  4. NODE_OPTIONS="--max-old-space-size=4096" — no effect
  5. security_opt: seccomp:unconfined — no effect
  6. Added 4GB swap — no effect

Working on Railway

The same app deployed via the Railway template (https://railway.com/deploy/PwpGcf) works perfectly — video uploads and processing complete without issues.

Connectivity confirmed

  • docker exec cap-web wget -qO- http://media-server:3456/health{"status":"ok","ffmpeg":{"available":true,"version":"6.1.2"}}
  • docker exec cap-web wget -qO /dev/null http://minio:9000/cap/ → OK

Conclusion

The bug appears to be in the compiled Next.js bundle (.next/server/chunks/385.js) which uses an embedded fetch implementation (undici). The ArrayBuffer gets detached during the fetch to the media-server, regardless of Node.js version or system configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions