Skip to content

Torrent grab fails with "fetch failed" error when adding torrent to client #8

@seannymurrs

Description

@seannymurrs

BookGrab successfully completes the grab process up to the point where it attempts to send the torrent to the download client, but the operation fails with a fetch failed error and the torrent is never added.

Environment

  • BookGrab version: latest from repository (as of Feb 2026)
  • Install method: Docker
  • Host OS: macOS

Expected Behavior
After selecting/grabbing an item, BookGrab should add the torrent to the configured download client.

Actual Behavior
The grab attempt fails and BookGrab reports:

{
  result: {
    success: false,
    message: 'Failed to add torrent',
    error: 'fetch failed'
  }
}

{
  body: {
    torrentUrl: 'https://www.myanonamouse.net/tor/download.php/...',
    category: 'audiobook'
  }
}

Error adding torrent: TypeError: fetch failed
    at async d (.next/server/app/api/grab/route.js:1:1272)
    at async p (.next/server/app/api/grab/route.js:1:2327) {

  [cause]: [Error [RequestContentLengthMismatchError]:
  Request body length does not match content-length header] {
    code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  }
}

{
  result: {
    success: false,
    message: 'Failed to add torrent',
    error: 'fetch failed'
  }
}

No torrent is added to the download client.

Relevant Logs

{
  result: {
    success: false,
    message: 'Failed to add torrent',
    error: 'fetch failed'
  }
}

{
  body: {
    torrentUrl: 'https://www.myanonamouse.net/tor/download.php/...',
    category: 'audiobook'
  }
}

Error adding torrent: TypeError: fetch failed
    at async d (.next/server/app/api/grab/route.js:1:1272)
    at async p (.next/server/app/api/grab/route.js:1:2327) {

  [cause]: [Error [RequestContentLengthMismatchError]:
  Request body length does not match content-length header] {
    code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  }
}

{
  result: {
    success: false,
    message: 'Failed to add torrent',
    error: 'fetch failed'
  }
}

Additional Notes

  • BookGrab appears able to retrieve the torrent URL successfully.
  • The failure occurs specifically during the step where the torrent is added to the download client.
  • This happens consistently for every grab attempt.

Reproducibility
Occurs every time a grab is attempted.

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