qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
25.96k stars 3.82k forks source link

Torrents lost after restarting qBittorrent #16420

Open intelfx opened 2 years ago

intelfx commented 2 years ago

qBittorrent & operating system versions

Operating system: Arch Linux x64 qBittorrent: 4.4.0-2 Qt: 6.2.3-4 libtorrent-rasterbar: 2.0.5-1

What is the problem?

qBittorrent was installed from qbittorrent-nox package to run in headless mode. After initial configuration, adding a torrent, downloading it and restarting the service via systemd (meaning a SIGTERM) the torrent is gone from the Web UI.

Steps to reproduce

No response

Additional context

No response

Log(s) & preferences file(s)

Log (.local/share/qBittorrent/logs/qbittorrent.log) excerpt:

(N) 2022-02-10T20:43:54 - qBittorrent v4.4.0 started
(N) 2022-02-10T20:43:54 - Using config directory: /home/operator/.config/qBittorrent
(I) 2022-02-10T20:43:54 - Trying to listen on: 0.0.0.0:40000,[::]:40000
(N) 2022-02-10T20:43:54 - Peer ID: -qB4400-
(N) 2022-02-10T20:43:54 - HTTP User-Agent is 'qBittorrent/4.4.0'
(I) 2022-02-10T20:43:54 - DHT support [ON]
(I) 2022-02-10T20:43:54 - Local Peer Discovery support [ON]
(I) 2022-02-10T20:43:54 - PeX support [ON]
(I) 2022-02-10T20:43:54 - Anonymous mode [OFF]
(I) 2022-02-10T20:43:54 - Encryption support [ON]
(I) 2022-02-10T20:43:55 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Tue Feb 1 01:11:03 2022.
(N) 2022-02-10T20:43:55 - Using built-in Web UI.
(N) 2022-02-10T20:43:55 - Web UI translation for selected locale (en) has been successfully loaded.
(N) 2022-02-10T20:43:55 - Web UI: Now listening on IP: *, port: 8080
(C) 2022-02-10T20:43:57 - Unable to resume torrent '3ced24db724bee9c9294e9907f5339cc03849921'.
(I) 2022-02-10T20:43:57 - Successfully listening on IP: 127.0.0.1, port: TCP/40000
(I) 2022-02-10T20:43:57 - Successfully listening on IP: 127.0.0.1, port: UTP/40000
<additional listening IPs redacted>
(I) 2022-02-10T20:43:57 - Detected external IP: [redacted]
<additional external IPs redacted>
(N) 2022-02-10T20:44:27 - WebAPI login success. IP: [redacted]

Contents of BT_backup directory:

$ find ~/.local/share/qBittorrent/BT_backup
/home/operator/.local/share/qBittorrent/BT_backup
/home/operator/.local/share/qBittorrent/BT_backup/3ced24db724bee9c9294e9907f5339cc03849921.torrent
/home/operator/.local/share/qBittorrent/BT_backup/3ced24db724bee9c9294e9907f5339cc03849921.fastresume
MarkMan0 commented 1 year ago

I have had the same issue, multiple times, on a raspberry pi. Not only torrents, but the configuration/settings were lost too. This is really frustrating, because I had several categories set up, and now I have to add the torrents one-by-one, by hand a redo the categories.

SundayBraid commented 1 month ago

Hello, Same issue mentioned by @MarkMan0 has been observed on my Freebsd server.

When sending SIGTERM the configuration is overwritten.

Workaround

My (dirty) Workaround : editing the /usr/local/etc/rc.d/qbittorrent to send another signal that is not handled by Qbittorrent.

#!/bin/sh

<...>
# custom stop since SIGTERM overwrite config file to default (BUG??)
sig_stop="SIGKILL"
stop_precmd="cp -v ${qbittorrent_conf_dir}/qBittorrent/config/qBittorrent.conf ${qbittorrent_conf_dir}/qBittorrent/config/qBittorrent.conf.bak "
stop_postcmd="echo Kill the process $name"
<...>

run_rc_command $1

Below my pkg and systeminfo

$ freebsd-version 
13.3-RELEASE

$pkg info qbittorrent-nox

qbittorrent-nox-4.6.4
Name           : qbittorrent-nox
Version        : 4.6.4
Installed on   : Sun Apr 14 15:33:24 2024 CEST
Origin         : net-p2p/qbittorrent
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : net-p2p
Licenses       : GPLv2+
Maintainer     : yuri@FreeBSD.org
WWW            : https://www.qbittorrent.org/
Comment        : Bittorrent client using Qt6 and libtorrent-rasterbar (web UI version)
Options        :
    DEBUG          : off
    LIBTORRENT1    : on
    LIBTORRENT2    : off
    PYTHON         : on
Shared Libs required:
    libtorrent-rasterbar.so.10
    libQt6Xml.so.6
    libQt6Sql.so.6
    libQt6Network.so.6
    libQt6Core.so.6
Annotations    :
    FreeBSD_version: 1302001
    build_timestamp: 2024-04-08T18:42:29+0000
    built_by       : poudriere-git-3.4.1-1-g1e9f97d6
    cpe            : cpe:2.3:a:qbittorrent:qbittorrent:4.6.4:::::freebsd13:x64
    flavor         : nox
    port_checkout_unclean: no
    port_git_hash  : 17691ed79fc
    ports_top_checkout_unclean: no
    ports_top_git_hash: 29620930d47
    repo_type      : binary
    repository     : FreeBSD