Skip to content

RemoteTransfer full-size download silently never completes and latches the whole subsystem into 0x8D03 #40

Description

@takusaito-ctrl

Environment: ILCE-7M5 · USB · Camera Remote SDK V2.02.00 · linux-arm64 (Raspberry Pi, kernel 6.8.0-1051-raspi) · server 3.0.0

Summary

POST /api/cameras/{id}/sd-card/slot/{slot}/files/{cid}/{fid}/download returns 202, creates a 0-byte file, and then nothing ever happens. There is no completion, no failure, no event, and no timeout. Worse, once one download is stuck, every RemoteTransfer operation for the rest of the session fails with 0x8D03 — including thumbnails and screennails that worked moments earlier.

Reproduction

  1. Connect in remote-transfer mode, priority key pc-remote.
  2. GET /sd-card/slot/1/files → 326 files, fine.
  3. POST /sd-card/slot/1/files/131198/1/download (DSC09989.JPG, 12,565,987 bytes)
{"message":"Download started (remote-transfer)","success":true}   HTTP 202
  1. A 0-byte DSC09989.JPG appears. Polled for 35s, still 0 bytes:
t= 5s  size=0
t=10s  size=0
...
t=35s  size=0
  1. Any subsequent content request now fails, including previously-working thumbnails:
POST .../131305/1/download   -> 400 {"message":"Failed to start file download: 0x00008D03"}
POST .../131305/1/thumbnail  -> 400 {"message":"Failed to start thumbnail download: 0x00008D03"}

0x8D03 = CrError_RemoteTransfer_GetContentsDataDisable (shared/sdk/include/CrError.h, base CrError_RemoteTransfer = 0x8D00 + offset 3).

Why this is hard to diagnose

The failure is invisible at every layer:

  • SDK::GetRemoteTransferContentsDataFile() returns CrError_None — we report 202 in good faith.
  • Nothing is written to the server log beyond the request line.
  • No SSE event is ever emitted, on any stream.
  • There is no timeout, so the pending transfer stays in m_pendingTransfers forever.

Server log for the whole episode is literally just:

Handling request: POST /api/cameras/CFCA6014E092/sd-card/slot/1/files/131198/1/download
⬇️  Download SD Card File: POST /api/cameras/.../131198/1/download

Notes on root cause

Two hypotheses were tested and one was ruled out:

  • usbfs buffer limit — ruled out. Sony's Linux docs require usbfs_memory_mb=150; this host defaulted to 16. Raising it to 150 changed nothing, the download still hung at 0 bytes. (Still worth fixing separately as a setup gap, filed on its own.)
  • Cross-camera content — untested, still open. Sony's docs for op_pull_out_content_stored_on_media_in_remote_transfer_mode state: "We cannot guarantee the transfer of content taken with other cameras. And large files may not be handled depending on the OS." The failing file's EXIF reads model=ILCE-7M4, software=ILCE-7M4 v5.01 while the connected body is an ILCE-7M5. There are native 7M5 files on the same card (e.g. content_id=131305, 4.17 MB) that would isolate this cleanly — but they cannot be tested in the same session, because step 4 has already latched 0x8D03.

CameraDeviceRest.cpp:526-528 already carries Sony's Linux-specific chunk size, matching their sample verbatim:

CrInt32u divisionSize = 0x5000000;  // 80MB
#if defined(__linux__)
    if (m_connType == cli::ConnectionType::USB) divisionSize = 0x1000000;  // 16MB
#endif

Expected

  • A stuck transfer should time out and surface an error to the caller and over SSE.
  • One failed transfer must not disable thumbnails/screennails and all later downloads for the session.
  • If the SDK genuinely cannot transfer a given file, the 202 is a lie — it should be a 4xx/5xx with the reason.

Knock-on effects

This is the trigger for several other failures, filed separately: the connection lifecycle breaks and ReleaseDevice() hangs at shutdown, ultimately requiring the camera to be physically unplugged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglinux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions