Skip to content

TorBox: /api/v2/torrents/add blocks HTTP response causing *arr timeout (cached and uncached) #302

Description

@rsantamaria01

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Related: #204, #89, #270

Current Behavior

All *arrs (Sonarr, Radarr, etc.) timeout when submitting any torrent to
decypharr backed by TorBox. The /api/v2/torrents/add endpoint makes
synchronous TorBox API calls while holding the HTTP connection open.
The *arr's HTTP client fires its timeout before decypharr responds.

This happens regardless of the download_uncached setting:

  • download_uncached=true: blocks while TorBox downloads the torrent
  • download_uncached=false: blocks while TorBox checks cache status, then returns 400 — but the 400 itself arrives after a timeout-length delay

Error seen in Sonarr and Radarr:

NzbDrone.Core.Download.Clients.DownloadClientException:
Failed to connect to qBittorrent, please check your settings.
 ---> System.Net.WebException: Http request timed out
 ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
 ---> System.Net.Sockets.SocketException (125): Operation canceled

Confirmed by timing the endpoint directly from inside the Sonarr container:

curl -m 5 -X POST http://decypharr:8282/api/v2/torrents/add \
  -d 'urls=magnet:?xt=urn:btih:<hash>&category=tv-sonarr'
# → HTTP 000 — no response within 5s; hangs indefinitely without -m

The qBittorrent WebAPI spec requires /api/v2/torrents/add to return Ok. immediately and process asynchronously. Blocking the response violates this contract and breaks all *arr download workflows.

PR #270 fixed an equivalent block for RealDebrid (infinite loop in CheckStatus). That PR notes TorBox was "unaffected" — but TorBox exhibits the same symptom via a different code path.

Expected Behavior

/api/v2/torrents/add returns Ok. immediately. TorBox submission and status polling happens asynchronously in the background.

Environment

- OS: Debian (Docker)
- Decypharr version: 2.3-stable (latest 2026-05-20)
- Debrid provider: TorBox
- *Arrs affected: Sonarr v4.0.17.2952, Radarr
- Docker Compose: v5.1.3

Trace Logs

2026-05-20 06:21:42 | INFO  | [torbox] Processing torrent Action=symlink Arr=tv-sonarr-anime Hash=c794... Name="[Tsundere-Raws] Aoashi - 03 VOSTFR" Provider=torbox
2026-05-20 06:23:24 | INFO  | [torbox] Processing torrent Action=symlink Arr=tv-sonarr-anime Hash=dda6... Name="[Tsundere-Raws] Aoashi - 03 VOSTFR" Provider=torbox
# ↑ decypharr loops polling torbox while Sonarr's connection is held open

Trace Logs have been provided as applicable

  • I have read and followed the steps in the documentation link and provided the required trace logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions