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

This is the error from qbittorrent log:

2022-01-23T15:35:55 - WebUI: Invalid Host header, port mismatch. Request source IP: ‘::ffff:127.0.0.1’. Server port: ‘8080’. Received Host header: ‘192.168.0.111:8123’

I tried changing the port from the plugin configuration from 8081 to 8080 and now i can access it from browser and its working ok but it doesn work from home assistant ( i can see the interface but the torrent list is empty and nothing works).
If you need additional info let me know which logs and from what location do you need. By the way , its a debian with supervisor installation .

Hi, thanks. Could you please add a full log of when it is starting? The addon should work i reinstalled it yesterday and ingress works. Thanks!

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 00-aaa_dockerfile_backup.sh: executing…
[cont-init.d] 00-aaa_dockerfile_backup.sh: exited 0.
[cont-init.d] 00-banner.sh: executing…
hello

Add-on: Qbittorrent
qBittorrent is a bittorrent client

Add-on version: 14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls166-6
You are running the latest version of this add-on.
System: Debian GNU/Linux 10 (buster) (amd64 / qemux86-64)
Home Assistant Core: 2021.12.10
Home Assistant Supervisor: 2021.12.2

Please, share the above information when looking for help
or support in, e.g., GitHub, forums
GitHub - alexbelgium/hassio-addons: My home assistant addons

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-envfile: executing…
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing…
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing…

      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io

To support LSIO projects visit:
Donate | LinuxServer.io

GID/UID

User uid: 0
User gid: 0

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing…
[cont-init.d] 30-config: exited 0.
[cont-init.d] 30-nginx.sh: executing…
[cont-init.d] 30-nginx.sh: exited 0.
[cont-init.d] 90-custom-folders: executing…
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 90-dns_set.sh: executing…
[16:02:35] INFO: DNS SERVERS set to 1.1.1.1 8.8.8.8
[cont-init.d] 90-dns_set.sh: exited 0.
[cont-init.d] 91-qbittorrent_configuration.sh: executing…
[16:02:36] INFO: Downloads can be found in /share/Seagate_Expansion_Drive
[16:02:37] INFO: Whitelisted subsets will not require a password : 192.168.0.111, 192.168.0.1/24,localhost,127.0.0.1,172.30.0.0/16
[16:02:37] INFO: WEBUI username set to admin
[16:02:37] INFO: Alternate UI enabled : vuetorrent. If webui don’t work, disable this option
[16:02:39] INFO: Default username/password : admin/adminadmin
[16:02:39] INFO: Configuration can be found in /config/qBittorrent
[cont-init.d] 91-qbittorrent_configuration.sh: exited 0.
[cont-init.d] 92-local_mounts.sh: executing…
[cont-init.d] 92-local_mounts.sh: exited 0.
[cont-init.d] 92-smb_mounts.sh: executing…
[cont-init.d] 92-smb_mounts.sh: exited 0.
[cont-init.d] 93-openvpn.sh: executing…
[16:02:40] INFO: Direct connection without VPN enabled
[cont-init.d] 93-openvpn.sh: exited 0.
[cont-init.d] 99-custom-scripts: executing…
[custom-init] no custom files found exiting…
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:02:41] INFO: Starting NGinx…
[23/Jan/2022:16:02:55 +0100] 401 192.168.0.151, 172.30.32.1(172.30.32.2) GET /api/v2/sync/maindata HTTP/1.1 (HomeAssistant/Android Mi 9T Pro beta-1916-8a8772d5-full)
[23/Jan/2022:16:02:55 +0100] 401 192.168.0.151, 172.30.32.1(172.30.32.2) GET /api/v2/app/version HTTP/1.1 (HomeAssistant/Android Mi 9T Pro beta-1916-8a8772d5-full)
[23/Jan/2022:16:02:55 +0100] 401 192.168.0.151, 172.30.32.1(172.30.32.2) POST /api/v2/auth/login HTTP/1.1 (HomeAssistant/Android Mi 9T Pro beta-1916-8a8772d5-full)
[23/Jan/2022:16:02:55 +0100] 401 192.168.0.151, 172.30.32.1(172.30.32.2) GET /api/v2/torrents/categories HTTP/1.1 (HomeAssistant/Android Mi 9T Pro beta-1916-8a8772d5-full)
[23/Jan/2022:16:02:57 +0100] 401 192.168.0.151, 172.30.32.1(172.30.32.2) GET /api/v2/sync/maindata HTTP/1.1 (HomeAssistant/Android Mi 9T Pro beta-1916-8a8772d5-full)

1 Like

Thanks indeed no error at all… The port 8080 is internal, and exposed as whatever is the value fixed to in the addon options, so setting the addon option port to 8080 vs 8081 shouldn’t affect it’s inner working…

Could you please try stopping the addon, rename the /config/qBittorrent folder to something else (as backup) and restart the addon? Normally this should be avoided by the following configs that should be set by default. Thanks!

WebUI\CSRFProtection=false
WebUI\ClickjackingProtection=false
WebUI\HostHeaderValidation=false

The lines you posted were missing from the .conf . I saw you released a new version , updated it and now its ok. Thank you.
I didn’t see anyone complaining about a similar problem as me so I’m confused why did this happen.
Thank you again for fixing .

1 Like

Hi, I don’t want to point but the most probable cause is that you saw those safety measures and enabled them in the webui :yum: or another probable cause is that the linuxserver team on which my addon is based modified the default settings :wink: anyway it’s good that you raised this issue as now it is embedded in the code so it helps make the code more robust for everyone.

Thanks!

Hi, is there a way to save torrent files to another device? I have my Homeassistant run on Intel NUC and want to save files to RaspberryPi with OpenMediaVault. The path to the file is 192.168.0.91/export/Filmy. I have share set up via SMB and NFS and can read/write to the disk without authentication on my local network.

When the qbittorrent starts I see this in logs:

[18:48:37] INFO: DNS SERVERS set to 192.168.0.91
[cont-init.d] 90-dns_set.sh: exited 0.
[cont-init.d] 91-qbittorrent_configuration.sh: executing…
[18:48:37] INFO: Downloads can be found in /mnt/Filmy/qbittorrent
[18:48:37] INFO: Whitelisted subsets will not require a password : localhost,127.0.0.1,172.30.0.0/16,192.168.0.0/16
[18:48:37] INFO: WEBUI username set to admin
[18:48:37] INFO: Alternate UI enabled : vuetorrent. If webui don’t work, disable this option
[18:48:38] INFO: Default username/password : admin/adminadmin
[18:48:38] INFO: Configuration can be found in /config/qBittorrent
[cont-init.d] 91-qbittorrent_configuration.sh: exited 0.
[cont-init.d] 92-local_mounts.sh: executing…
[cont-init.d] 92-local_mounts.sh: exited 0.
[cont-init.d] 92-smb_mounts.sh: executing…
Mounting smb share(s)…
[18:48:39] INFO: … //192.168.0.91/Filmy/qbittorrent successfully mounted to /mnt/qbittorrent with options
[cont-init.d] 92-smb_mounts.sh: exited 0.
[cont-init.d] 93-openvpn.sh: executing…
[18:48:39] INFO: Direct connection without VPN enabled

But when I try to start a torrent file nothing happens, and in filebrowser I don’t see my folder in mnt/qbittorrent

Hi,

//192.168.0.91/Filmy/qbittorrent successfully mounted to /mnt/qbittorrent

You need to specify /mnt/qbittorrent in the Downloads options to be able to find the files in //192.168.0.91/Filmy/qbittorrent

I’ve tried that and still nothing happens. I get this massage in logs:

“Web UI: Unable to bind to IP: 192.168.0.92, port: 8080. Reason: The address is not available”

Maybe this is the problem, I run my HA via duckdns

And can you access qbittorrent with ingress, from the app?

Could you try stopping the app, and adding WebUI\Address=* to the qbittorrent.conf file in /config/qbittorrent? Thanks

Yes I can reach qbittorrent via ingress… I’ve changed the WebUI\Address= from my ip adress to * and it worked! Thank you!

1 Like

Thanks for this amazing addon, I find it very useful. Got one question though. When selecting the download directory, would it be possible to make it a bit more interactive so that your current folders pop up and that you can click and navigate through the folders? Right now it is very easy to mistype and if you have nested folders it can take some typing to get to the correct folder.

Hi,

I’m having trouble with the vpn config. I am using expressvpn if that helps, but I get some errors in the logs and then no connectivity when the vpn is enabled. It works fine without vpn.

I have fumbled my way through tweaking various options to no avail, and have discussed with expressvpn support (they tried but outside their typical setup).

Here’s the log from qbittorrent, let me know if there’s anything else I can provide.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-aaa_dockerfile_backup.sh: executing... 
[cont-init.d] 00-aaa_dockerfile_backup.sh: exited 0.
[cont-init.d] 00-banner.sh: executing... 
hello
-----------------------------------------------------------
 Add-on: Qbittorrent
 qBittorrent is a bittorrent client
-----------------------------------------------------------
 Add-on version: 14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls166-8
 You are running the latest version of this add-on.
 System: Home Assistant OS 7.2  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.12.10
 Home Assistant Supervisor: 2022.01.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
 https://github.com/alexbelgium/hassio-addons
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 01-migrations: executing... 
[migrations] started
[migrations] no migrations found
[cont-init.d] 01-migrations: exited 0.
[cont-init.d] 10-adduser: executing... 
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    0
User gid:    0
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
[cont-init.d] 30-nginx.sh: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 90-dns_set.sh: executing... 
[12:08:02] INFO: DNS SERVERS set to 1.1.1.1 8.8.8.8 
[cont-init.d] 90-dns_set.sh: exited 0.
[cont-init.d] 91-qbittorrent_configuration.sh: executing... 
[12:08:02] INFO: Downloads can be found in /mnt/media
[12:08:03] INFO: Whitelisted subsets will not require a password : localhost,127.0.0.1,172.30.0.0/16,192.168.178.0/24
[12:08:03] INFO: WEBUI username set to admin
[12:08:04] INFO: Alternate UI enabled : vuetorrent. If webui don't work, disable this option
[12:08:07] INFO: Default username/password : admin/adminadmin
[12:08:07] INFO: Configuration can be found in /config/qBittorrent
[cont-init.d] 91-qbittorrent_configuration.sh: exited 0.
[cont-init.d] 92-local_mounts.sh: executing... 
[cont-init.d] 92-local_mounts.sh: exited 0.
[cont-init.d] 92-smb_mounts.sh: executing... 
Mounting smb share(s)...
[12:08:08] INFO: ... //192.168.178.68/media successfully mounted to /mnt/media with options 
[cont-init.d] 92-smb_mounts.sh: exited 0.
[cont-init.d] 93-openvpn.sh: executing... 
[12:08:08] INFO: Configuring openvpn
[12:08:09] INFO: openvpn correctly set, qbittorrent will run tunnelled through openvpn
[cont-init.d] 93-openvpn.sh: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[12:08:09] WARNING: The run_duration option is set. The addon will stop after 12h
Sun Jan 30 12:08:09 2022 WARNING: --keysize is DEPRECATED and will be removed in OpenVPN 2.6
Sun Jan 30 12:08:09 2022 OpenVPN 2.4.7 aarch64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 19 2021
Sun Jan 30 12:08:09 2022 library versions: OpenSSL 1.1.1f  31 Mar 2020, LZO 2.10
Sun Jan 30 12:08:09 2022 WARNING: --ns-cert-type is DEPRECATED.  Use --remote-cert-tls instead.
Sun Jan 30 12:08:09 2022 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Sun Jan 30 12:08:09 2022 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sun Jan 30 12:08:09 2022 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sun Jan 30 12:08:09 2022 TCP/UDP: Preserving recently used remote address: [AF_INET]45.134.20.168:1195
Sun Jan 30 12:08:09 2022 Socket Buffers: R=[212992->425984] S=[212992->425984]
Sun Jan 30 12:08:09 2022 UDP link local: (not bound)
Sun Jan 30 12:08:09 2022 UDP link remote: [AF_INET]45.134.20.168:1195
Sun Jan 30 12:08:10 2022 TLS: Initial packet from [AF_INET]45.134.20.168:1195, sid=ccd64116 010e639c
Sun Jan 30 12:08:10 2022 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sun Jan 30 12:08:10 2022 VERIFY OK: depth=1, C=VG, ST=BVI, O=ExpressVPN, OU=ExpressVPN, CN=ExpressVPN CA, [email protected]
Sun Jan 30 12:08:10 2022 VERIFY OK: nsCertType=SERVER
Sun Jan 30 12:08:10 2022 VERIFY X509NAME OK: C=VG, ST=BVI, O=ExpressVPN, OU=ExpressVPN, CN=Server-3590-0a, [email protected]
Sun Jan 30 12:08:10 2022 VERIFY OK: depth=0, C=VG, ST=BVI, O=ExpressVPN, OU=ExpressVPN, CN=Server-3590-0a, [email protected]
Sun Jan 30 12:08:10 2022 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1602', remote='link-mtu 1606'
Sun Jan 30 12:08:10 2022 WARNING: 'mtu-dynamic' is present in remote config but missing in local config, remote='mtu-dynamic'
Sun Jan 30 12:08:10 2022 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Sun Jan 30 12:08:10 2022 [Server-3590-0a] Peer Connection Initiated with [AF_INET]45.134.20.168:1195
Sun Jan 30 12:08:11 2022 SENT CONTROL [Server-3590-0a]: 'PUSH_REQUEST' (status=1)
Sun Jan 30 12:08:12 2022 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 10.146.0.1,comp-lzo no,route 10.146.0.1,topology net30,ping 10,ping-restart 60,ifconfig 10.146.0.58 10.146.0.57,peer-id 13,cipher AES-256-GCM'
Sun Jan 30 12:08:12 2022 Options error: option 'redirect-gateway' cannot be used in this context ([PUSH-OPTIONS])
Sun Jan 30 12:08:12 2022 Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS])
Sun Jan 30 12:08:12 2022 Options error: option 'route' cannot be used in this context ([PUSH-OPTIONS])
Sun Jan 30 12:08:12 2022 OPTIONS IMPORT: timers and/or timeouts modified
Sun Jan 30 12:08:12 2022 OPTIONS IMPORT: compression parms modified
Sun Jan 30 12:08:12 2022 OPTIONS IMPORT: --ifconfig/up options modified
Sun Jan 30 12:08:12 2022 OPTIONS IMPORT: peer-id set
Sun Jan 30 12:08:12 2022 OPTIONS IMPORT: adjusting link_mtu to 1625
Sun Jan 30 12:08:12 2022 OPTIONS IMPORT: data channel crypto options modified
Sun Jan 30 12:08:12 2022 Data Channel: using negotiated cipher 'AES-256-GCM'
Sun Jan 30 12:08:12 2022 NCP: overriding user-set keysize with default
Sun Jan 30 12:08:12 2022 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sun Jan 30 12:08:12 2022 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Sun Jan 30 12:08:12 2022 TUN/TAP device tun0 opened
Sun Jan 30 12:08:12 2022 TUN/TAP TX queue length set to 100
Sun Jan 30 12:08:12 2022 /sbin/ip link set dev tun0 up mtu 1500
Sun Jan 30 12:08:12 2022 /sbin/ip addr add dev tun0 local 10.146.0.58 peer 10.146.0.57
Sun Jan 30 12:08:12 2022 /etc/openvpn/up.sh tun0 1500 1553 10.146.0.58 10.146.0.57 init
[12:08:12] INFO: Starting NGinx...
Sun Jan 30 12:08:13 2022 Bad compression stub decompression header byte: 0
Sun Jan 30 12:08:14 2022 Initialization Sequence Completed
Sun Jan 30 12:08:24 2022 Bad compression stub decompression header byte: 0

Hi @Maximus97 , thanks for the feedback and the suggestion. It would however be very complex to implement. Either you mean the selection of the download directory in the addon options, which would not be possible : it is not supported by the HA system, and even if it was the addons options are selected while the container is not running which means the inner file system is not accessible. If you mean within qBittorrent, this is a suggestion that should be made at the qBittorrent team here : GitHub - qbittorrent/qBittorrent: qBittorrent BitTorrent client

Indeed though you are right it is easy to mistype… The only solution I’ve found so far is an error message if the folder is not accessible but it is not a foolproof system

Hi, I don’t use openvpn, but based on searching on google for this error message

Bad compression stub decompression header byte: 0

it seems based on this openvpn community thread to occur when you are trying to access a server running openvpn 2.3 from a system running openvpn 2.4 (this addon). Perhaps expressvpn would provide ovpn config files for openvpn 2.4 ?

Yeah, I meant inside qBittorent when you add a torrent for downloading. Thanks for the explanation.

1 Like

I just installed this add-on and have seen my CPU temp go from 47C straight up to 100C as soon as I start the add-on. If I stop the add-on the temp goes back down again.

Anyone else seeing this or know of a fix?

tell me how can I add my search to the torrent search plugin

No idea… I don’t see that on my own system (either rpi3b or rpi4) - my resources usage are very low when qbittorrent is idle. Only the Temp goes up but not the CPU usage ? perhaps you could open an issue on github (https://github.com/alexbelgium/hassio-addons) and post your full addon log so I can check if something is wrong.

Another option is to set the run duration in the addon options, so for example the addon automatically closes after 2 hours. That way it won’t impact your system.

Hi, do you mean how to search ?
In Vuetorrent (the default UI), you click on the magnifying glass on top right.
Then, in the pop-up screen that opens, you can select “Plugin manager” and enable the potential search engines. If you need to add new search engines, you can follow this : Unofficial search plugins · qbittorrent/search-plugins Wiki (github.com)
Then you just search in the search box above, and it works!