Home Assistant addon : qbittorrent (supports openvpn & smb mounts)

Hi, so as I understand you are using openvpn and have specified your ovpn file? Are you sure that the ovpn file works and that it’s content is the most recent from the provider? Thanks!

I was using the same ovpn file earlier this week with no issue, and before I pulled the latest update it was displaying the VPN connection confirmation in the logs.

Not sure if this helps, but i found this logged as the client is loading up:

[custom-init] No custom files found, skipping...
crond: crond (busybox 1.36.1) started, log level 8
2024-04-20 17:46:28 DEPRECATED OPTION: --cipher set to 'aes-128-cbc' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations. 
2024-04-20 17:46:28 OpenVPN 2.6.10 x86_64-alpine-linux-musl [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
2024-04-20 17:46:28 library versions: OpenSSL 3.3.0 9 Apr 2024, LZO 2.10
2024-04-20 17:46:28 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2024-04-20 17:46:28 OpenSSL: error:068000E9:asn1 encoding routines::utctime is too short:
2024-04-20 17:46:28 OpenSSL: error:0688010A:asn1 encoding routines::nested asn1 error:Field=revocationDate, Type=X509_REVOKED
2024-04-20 17:46:28 OpenSSL: error:0688010A:asn1 encoding routines::nested asn1 error:Field=revoked, Type=X509_CRL_INFO
2024-04-20 17:46:28 OpenSSL: error:0688010A:asn1 encoding routines::nested asn1 error:Field=crl, Type=X509_CRL
2024-04-20 17:46:28 OpenSSL: error:0488000D:PEM routines::ASN1 lib:
2024-04-20 17:46:28 CRL: cannot read CRL from file [[INLINE]]
2024-04-20 17:46:28 CRL: loaded 0 CRLs from file -----BEGIN X509 CRL-----

I have now also tried 4 different ovpn files freshly downloaded from the provider and all have the same impact on the addon. If I remove the VPN config, the addon starts fine.

Thanks I’ve checked on Google and it seems a kind of bug in the latest version of openvpn. I’ll try to pin an older version

Any luck with this?

hi, for some strange reason I don’t get notifications from this forum - however I do hope you are one of those that got it solved on github :slight_smile:

There is a bug with a latest version of openvpn and the solution is to remove the CRL check : :bug: [qbittorrent] Since last update no longer starts up Β· Issue #1351 Β· alexbelgium/hassio-addons (github.com)

1 Like

Hey @alexbelgium, I do have a question for you.

I’ve installed qBittorrent and it works perfectly for some time.
Movies are downloaded and they even are moved to my drive.

But aparently there is problem with utilization of the resources on the machine. When qbittorrent is runnig and downloading (not on idle) the utilization of procesor and memory is huge:

In the places where you see the drops - HA decides to restart at that moments.

My setup:
Raspberry Pi 4
2GB RAM
Router: TUF GAMING AX6000
Router connected to raspberry with cable connection
On Raspberry I have AdGuard
To Router I have connected hard drive (WD Elements 25A2).
Qbittorrent is downloading straight to harddrive, and then copying files to another folder when they are done.

What I already did is I’ve cut all numbers in Advanced settings of qBittorrent by half, but still got the same problem today at night.
I didn’t enable any specific ports on my router.
Sadly there is nothing I could find in logs that might be helpful… :confused:

Do you have any ideas on how to improve this?

I fear that’s just due to how qbittorrent is coded… It is not known to be easy on resources. On the other hand, transmission is and it has ui just as nice!

1 Like

Just a note for anyone who may get the following error, when mounting SMB:

pcap_activate(eth0) FAILED: socket: Permission denied.

It is just the username and password are wrong. re-verify them! It is not a AppArmour or permissions issue.

1 Like

Hi,

I have a strange issue with this addon.
I can’t change any settings from ingress interface.
For example I want to β€œDelete .torrent file afterwards”, I thick the box and after I save the settings it resets to default.
The same thing happens for all the other settings.
Any possible solution?

Thanks!

Hi sorry I can’t replicate do you have puid 0 and PGID 0 in the add-on settings? It would likely be a permission issues

Hi Alex,

Both PUID and PGUID are 0. Should I change the to 1?

Thanks!

Hi, mmh I can’t replicate. I’m using vuetorrent as ui in ingress but it shouldn’t matter as anyway qbittorrent modifies the qBittorrent.conf file. Some settings that can be managed through the add-on options are overwritten at add-on start (such as the save path) but it shouldn’t prevent saving options from ingress.
Could you please try :

  • to replicate this behavior using direct access with Ip:port
  • look in the log if there is an error message
  • delete your qBittorrent.conf file using filebrowser in /homeassistant/addons_config/qBittorrent to restart the config from scratch?

Hi Alex,

Things I did so far:

  • Used IP:Port to update the values - same result as from Ingress interface
  • I don’t see any errors in the log file
  • Deleted qBittorrent.conf and checked the logs afterwards.
|                                            Starting Run                                            |
|====================================================================================================|
| Locating config...                                                                                 |
| Using /config/qbit_manage/qbit_manage.yml as config                                                |
| Commands found in /config/qbit_manage/qbit_manage.yml, ignoring env variables and using config commands instead. |
| Connecting to Apprise...                                                                           |
| Config Error: apprise sub-attribute notify_url not found                                           |
| apprise sub-attribute notify_url added to config                                                   |
| Apprise Connection Failed                                                                          |
| Webhook attribute set to notifiarr but notifiarr attribute is not configured.                      |
| Config Warning: Path /mnt/user/data/torrents does not exist, using /media/Filme/ as default        |
| Config Error: Path /qbittorrent/data/BT_backup does not exist                                      |
| Exiting scheduled Run.                                                                             |
|     Scheduled Mode: Running every 1 day.                                                           |
|====================================================================================================|
|                                            Finished Run                                            |
|                                         Run Time: 0:00:00                                          |
|              Current Time: 07:15 AM | 1 day until the next run at 2024-09-07 07:15 AM 

After performing all these steps the issue persists.
I can download files without any issues but I can’t update any changes in the settings menu.
VueTorrent interface

Thanks can you please post your full add-on startup log either on the github repo open issue or here? I’m looking to see if anything has gone wrong in files permissions

Edit : correction, I can change options (such as pre-allocate disk space) but NOT delete .torrent files :wink: but basically it is one of the only setting that doesn’t seem to stick for me! Is it the same for you?

Hi Alex,

Please see the start-up log. I only edited the username and password with XXXX:

Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
 Defining permissions for main user : 
User UID: 0
User GID : 0
-----------------------------------------------------------
/etc/cont-init.d/00-folders.sh: executing
/etc/cont-init.d/00-global_var.sh: executing
DNS_server='8.8.8.8,1.1.1.1'
PGID='0'
PUID='0'
SavePath='/media/Filme'
Username='XXXXX'
certfile='fullchain.pem'
customUI='vuetorrent'
keyfile='privkey.pem'
qbit_manage='true'
ssl='false'
whitelist='localhost,127.0.0.1,172.30.0.0/16,192.168.0.0/16'
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory

Load environment variables from /config/config.yaml if existing
If accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f-qbittorrent/config.yaml

---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f-qbittorrent/qbittorrent.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/30-nginx.sh: executing
/etc/cont-init.d/90-dns_set.sh: executing
[17:52:37] INFO: DNS SERVERS set to 1.1.1.1 8.8.8.8 
/etc/cont-init.d/91-qbittorrent_configuration.sh: executing
[17:52:38] INFO: Downloads can be found in /media/Filme
[17:52:38] INFO: Whitelisted subsets will not require a password : localhost, 127.0.0.1, 172.30.0.0/16, 192.168.0.0/16
[17:52:38] INFO: WEBUI username set to XXXXX
[17:52:38] WARNING: Configuration changed, rebooting
s6-rc: fatal: unable to take locks: No such file or directory
s6-linux-init-shutdownd: warning: /run/s6/basedir/scripts/rc.shutdown exited 111
Starting...
/etc/cont-init.d/00-banner.sh: executing

-----------------------------------------------------------
 Add-on: qBittorrent
 Bittorrent client with optional vpn
-----------------------------------------------------------
 Add-on version: 4.6.6
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.9.0
 Home Assistant Supervisor: 2024.08.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
 Defining permissions for main user : 
User UID: 0
User GID : 0
-----------------------------------------------------------
/etc/cont-init.d/00-folders.sh: executing
/etc/cont-init.d/00-global_var.sh: executing
DNS_server='8.8.8.8,1.1.1.1'
PGID='0'
PUID='0'
SavePath='/media/Filme'
Username='XXXXX'
certfile='fullchain.pem'
customUI='vuetorrent'
keyfile='privkey.pem'
qbit_manage='true'
ssl='false'
whitelist='localhost,127.0.0.1,172.30.0.0/16,192.168.0.0/16'
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory
Load environment variables from /config/config.yaml if existing

If accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f-qbittorrent/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables

... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f-qbittorrent/qbittorrent.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/30-nginx.sh: executing
/etc/cont-init.d/90-dns_set.sh: executing
[17:52:48] INFO: DNS SERVERS set to 1.1.1.1 8.8.8.8 
/etc/cont-init.d/91-qbittorrent_configuration.sh: executing
[17:52:48] INFO: Downloads can be found in /media/Filme
[17:52:48] INFO: Whitelisted subsets will not require a password : localhost, 127.0.0.1, 172.30.0.0/16, 192.168.0.0/16
[17:52:48] INFO: WEBUI username set to XXXXX
etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f-qbittorrent/qbittorrent.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/30-nginx.sh: executing
/etc/cont-init.d/90-dns_set.sh: executing
[17:52:48] INFO: DNS SERVERS set to 1.1.1.1 8.8.8.8 
/etc/cont-init.d/91-qbittorrent_configuration.sh: executing
[17:52:48] INFO: Downloads can be found in /media/Filme
[17:52:48] INFO: Whitelisted subsets will not require a password : localhost, 127.0.0.1, 172.30.0.0/16, 192.168.0.0/16
[17:52:48] INFO: WEBUI username set to XXXXX
[17:52:48] INFO: Alternate UI enabled : vuetorrent. If webui don't work, disable this option
[17:52:50] INFO: Default username/password : XXXXX/XXXXX
[17:52:50] INFO: Configuration can be found in /config/qBittorrent
/etc/cont-init.d/92-qbit_manage.sh: executing
... setting folder
[17:52:50] INFO: qbit_manage activated, setting system
... align QBT username and password
... default url set to 127.0.0.1, change manually if you have an external qbt system
... setting username to the addon options one
... default password set to XXXXXX, change manually in the file if not
... downloads directory set to /media/Filme
[17:52:50] INFO: qbit_manage started with config in /addon_configs/db21ed7f-qbittorrent/qbit_manage/qbit_manage.yaml accessible with the Filebrowser addon
/etc/cont-init.d/93-openvpn.sh: executing
[17:52:50] INFO: Direct connection without VPN enabled
/etc/cont-init.d/93-wg_test.sh: executing
 
Starting the upstream container
 
[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ•‘     β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
      β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    0
User GID:    0
───────────────────────────────────────
Linuxserver.io version: 4.6.6-r0-ls347
Build-date: 2024-08-20T13:50:27+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
crond: crond (busybox 1.36.1) started, log level 8
WebUI will be started shortly after internal preparations. Please wait...

******** Information ********
To control qBittorrent, access the WebUI at: http://localhost:8080

|====================================================================================================|
|                           _     _ _                                                                |
|                          | |   (_) |                                                               |
|                      __ _| |__  _| |_   _ __ ___   __ _ _ __   __ _  __ _  ___                     |
|                     / _` | '_ \| | __| | '_ ` _ \ / _` | '_ \ / _` |/ _` |/ _ \                    |
|                    | (_| | |_) | | |_  | | | | | | (_| | | | | (_| | (_| |  __/                    |
|                     \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|                    |
|                        | |         ______                            __/ |                         |
|                        |_|        |______|                          |___/                          |
|     Version: 4.1.8-develop1 (Docker)                                                               |
|     Newest Version: 4.1.9                                                                          |
|     Platform: Linux-6.6.46-haos-x86_64-with                                                        |
|     Scheduled Mode: Running every 1 day.                                                           |
|     Startup Delay: Initial Run will start after 30 seconds                                         |
Connection to localhost (::1) 8080 port [tcp/http-alt] succeeded!
[17:52:51] INFO: Starting NGinx...
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in /etc/nginx/servers/ingress.conf:17
[ls.io-init] done.
|====================================================================================================|
|                                            Starting Run                                            |
|====================================================================================================|
| Locating config...                                                                                 |
| Using /config/qbit_manage/qbit_manage.yml as config                                                |
| Commands found in /config/qbit_manage/qbit_manage.yml, ignoring env variables and using config commands instead. |
| Connecting to Apprise...                                                                           |
| Config Error: apprise sub-attribute notify_url not found                                           |
| apprise sub-attribute notify_url added to config                                                   |
| Apprise Connection Failed                                                                          |
| Webhook attribute set to notifiarr but notifiarr attribute is not configured.                      |
| Config Warning: Path /mnt/user/data/torrents does not exist, using /media/Filme/ as default        |
| Config Error: Path /qbittorrent/data/BT_backup does not exist                                      |
| Exiting scheduled Run.                                                                             |
|     Scheduled Mode: Running every 1 day.                                                           |
|====================================================================================================|
|                                            Finished Run                                            |
|                                         Run Time: 0:00:00                                          |
|              Current Time: 05:53 PM | 1 day until the next run at 2024-09-07 05:53 PM              |
|====================================================================================================|

And yes, it seems that β€œDelete .torrent file” is the only option that can’t be saved.


All the other settings can be saved without any issues :laughing:

Actually as it is the only option that can’t be saved (Murphys law) the easiest way would be to stop the add-on and manually add the line for this option in the qBittorrent.conf found in /by addons_config/xxx-qbittorrent using filebrowser for example! I haven’t found however which line should be used :wink: the add-on should be stopped before modifying the file manually or it won’t stick

Edit : it is indeed a qbittorrent bug (ex : "Also when addition is cancelled" is broken Β· Issue #5451 Β· qbittorrent/qBittorrent Β· GitHub) and the solution could be to add in the qBittorrent.conf

[Core]
AutoDeleteAddedTorrentFile=IfAdded

Edit2 : looks like the flag does get saved, the missing link is in qBittorrent ui

It looks like I already have this line in the qBittorrent.conf file
image
I think we should consider this as solved because I thought I might be doing something wrong, without knowing that this is a known bug of qBittorrent.
Thank you for you help!

1 Like

I tried this many different waya but in the end the config.ovpn is exactly where it should be…what am i doing wrong?

–
[20:59:27] INFO: Openvpn enabled, configuring
[20:59:27] INFO: ----------------------------
[20:59:27] FATAL: Configured ovpn file : mullvad_us_chi.ovpn not found! Are you sure you added it in /addon_configs/db21ed7f-qbittorrent/openvpn using the Filebrowser addon ?
Error : /etc/cont-init.d/93-openvpn.sh exiting 1
/etc/cont-init.d/93-wg_test.sh: executing

Hi, your log states mullvad_us_chi.ovpn is not found and indeed your screenshot shows there is none. Shouldn’t your file .conf be renamed to .ovpn?

Is there a way to specify a version to downgrade from 5.0?