{"record":{"id":"db36c993a35371f3","repo":"tonhowtf/omniget","slug":"torrent-was-added-in-list-only-mode-mod","errorCode":null,"errorMessage":"Torrent was added in list-only mode","messagePattern":"Torrent was added in list-only mode","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/magnet/mod.rs","lineNumber":213,"sourceCode":"            Some(list)\n        } else {\n            None\n        };\n        let torrent_opts = AddTorrentOptions {\n            overwrite: true,\n            only_files,\n            trackers,\n            ..Default::default()\n        };\n\n        tracing::info!(\"[magnet] adding torrent, output: {}\", output_dir.display());\n        let (torrent_id, managed_torrent) =\n            match session.add_torrent(add_torrent, Some(torrent_opts)).await {\n                Ok(resp) => match resp {\n                    librqbit::AddTorrentResponse::Added(id, handle) => (id, handle),\n                    librqbit::AddTorrentResponse::AlreadyManaged(id, handle) => (id, handle),\n                    librqbit::AddTorrentResponse::ListOnly(_) => {\n                        anyhow::bail!(\"Torrent was added in list-only mode\");\n                    }\n                },\n                Err(e) => anyhow::bail!(\"Failed to add torrent: {}\", e),\n            };\n\n        tracing::info!(\n            \"[magnet] torrent added (id={}), waiting for download...\",\n            torrent_id\n        );\n\n        if let Some(slot) = &opts.torrent_id_slot {\n            *slot.lock().await = Some(torrent_id);\n        }\n\n        let completion = managed_torrent.wait_until_completed();\n        tokio::pin!(completion);\n\n        let cancel_rx = opts.cancel_token.clone();","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/magnet/mod.rs#L195-L231","documentation":"librqbit's add_torrent can return AddTorrentResponse::ListOnly when the torrent was added with list_only mode, meaning only metadata listing was requested — no download handle is produced. This downloader requires a real added/managed torrent, so a ListOnly response is treated as an invariant violation and bails.","triggerScenarios":"The AddTorrentOptions passed to session.add_torrent has list_only=true (or equivalent), causing librqbit to parse the magnet/metadata but not start the torrent.","commonSituations":"Reusing torrent options intended for a metadata-probing step (fetching file lists) in the actual download path; a code refactor copying options from a 'list files' flow.","solutions":["Ensure the AddTorrentOptions used in download() has list_only set to false/0","If you need metadata listing, use a separate add_torrent call with list_only and a different session/options for downloading","Audit shared option-constructing helpers for a hardcoded list_only flag"],"exampleFix":"// before\nlet mut add_torrent = AddTorrentOptions { list_only: true, ..Default::default() };\n// after\nlet add_torrent = AddTorrentOptions { list_only: false, ..Default::default() };","handlingStrategy":"validation","validationCode":"assert!(!add_torrent.list_only, \"download path must not use list_only options\");","typeGuard":null,"tryCatchPattern":"match session.add_torrent(at, opts).await? {\n    librqbit::AddTorrentResponse::ListOnly(_) => bail!(\"misconfigured options: list_only\"),\n    resp => ok(resp),\n}","preventionTips":["Keep metadata-probing and download option builders separate","Add a debug assertion that list_only is false in the download path"],"tags":["torrent","librqbit","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}