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

Hi ! Exactly, VueTorrent is hard-coded in ingress as it was much easier at one time to make it work, and it seemed to me like a nicer option for smaller screen devices such as phones. However the webui option that can be defined from the addon options only impact when going to the direct url.

If you’d prefer it otherway I can check but at the time it allowed ingress to work :wink:

Hi @piotr ! To change the username you need to go in the addon options. To change the password, I’ve just seen that there is no possibility in VueTorrent webui (the default one). So you need to disable the optional webui in the addons options, go to http://URL:port, go in the tab “tools”, “options”, “webui” and change your password there.

The reason to do that is that password can’t be changed through manual modification of the qbittorrent.conf, but username can. So lazy people can use a strong username and keep the default password and still be safe… Or you can disable ui port and do everything with ingress, which is perfectly safe

what am I doing wrong?
The command '/bin/sh -c apt-get update && apt-get install -y jq curl cifs-utils keyutils nginx coreutils openvpn && curl -L -f -s -o /usr/bin/tempio "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" && chmod a+x /usr/bin/tempio && curl -L -f -s -o /tmp/tmp "https://github.com/alexbelgium/downloads-tracker/archive/refs/tags/Qbittorrent.zip" && mkdir -p /tmp/bashio && curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio && mv /tmp/bashio/lib /usr/lib/bashio && ln -s /usr/lib/bashio/bashio /usr/bin/bashio && rm -rf /tmp/bashio && sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser && sed -i 's|/config|-R /config/qBittorrent|g' /etc/cont-init.d/10-adduser && sed -i 's= /config=/config/qBittorrent || true=g' /etc/cont-init.d/30-config && sed -i 's|/downloads/|/share/qBittorrent/|g' /defaults/qBittorrent.conf && sed '11,13d' /defaults/qBittorrent.conf && echo 'WebUI\HostHeaderValidation=false' >> /defaults/qBittorrent.conf && echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf' returned a non-zero code: 100

@lordzid Hi, I suppose it is in supervisor log during installation ? Is that the whole error message? I would have expected that the error message would be a bit longer to provide the cause for the return 100 ?

yes this is all bug report

21-06-28 14:40:28 INFO (SyncWorker_3) [supervisor.docker.addon] Starting build for db21ed7f/armv7-addon-qbittorrent:14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141
21-06-28 14:40:35 ERROR (SyncWorker_3) [supervisor.docker.addon] Can't build db21ed7f/armv7-addon-qbittorrent:14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141: The command '/bin/sh -c apt-get update     && apt-get install -y         jq         curl         cifs-utils         keyutils         nginx         coreutils         openvpn         && curl -L -f -s -o /usr/bin/tempio     "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}"     && chmod a+x /usr/bin/tempio         && curl -L -f -s -o /tmp/tmp     "https://github.com/alexbelgium/downloads-tracker/archive/refs/tags/Qbittorrent.zip"         && mkdir -p /tmp/bashio     && curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz"     | tar -xzf - --strip 1 -C /tmp/bashio     && mv /tmp/bashio/lib /usr/lib/bashio     && ln -s /usr/lib/bashio/bashio /usr/bin/bashio     && rm -rf /tmp/bashio             && sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser     && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser     && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser         && sed -i 's|/config|-R /config/qBittorrent|g' /etc/cont-init.d/10-adduser     && sed -i 's=	/config=/config/qBittorrent || true=g' /etc/cont-init.d/30-config         && sed -i 's|/downloads/|/share/qBittorrent/|g' /defaults/qBittorrent.conf         && sed '11,13d' /defaults/qBittorrent.conf     && echo 'WebUI\HostHeaderValidation=false' >> /defaults/qBittorrent.conf     && echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf' returned a non-zero code: 100
21-06-28 14:40:35 ERROR (SyncWorker_3) [supervisor.docker.addon] Build log: 
Step 1/24 : ARG BUILD_FROM
Step 2/24 : ARG BUILD_VERSION
Step 3/24 : ARG BUILD_UPSTREAM="14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141"
Step 4/24 : FROM ${BUILD_FROM}${BUILD_UPSTREAM}
 ---> ead58ec0f356
Step 5/24 : ARG BASHIO_VERSION=0.13.0
 ---> Using cache
 ---> fa4b82053ff4
Step 6/24 : ARG TEMPIO_VERSION=2021.01.0
 ---> Using cache
 ---> c1d5694d5368
Step 7/24 : ARG BUILD_ARCH
 ---> Using cache
 ---> d3ddd7ed3489
Step 8/24 : RUN     apt-get update     && apt-get install -y         jq         curl         cifs-utils         keyutils         nginx         coreutils         openvpn         && curl -L -f -s -o /usr/bin/tempio     "https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}"     && chmod a+x /usr/bin/tempio         && curl -L -f -s -o /tmp/tmp     "https://github.com/alexbelgium/downloads-tracker/archive/refs/tags/Qbittorrent.zip"         && mkdir -p /tmp/bashio     && curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz"     | tar -xzf - --strip 1 -C /tmp/bashio     && mv /tmp/bashio/lib /usr/lib/bashio     && ln -s /usr/lib/bashio/bashio /usr/bin/bashio     && rm -rf /tmp/bashio             && sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser     && sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser     && sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser         && sed -i 's|/config|-R /config/qBittorrent|g' /etc/cont-init.d/10-adduser     && sed -i 's=	/config=/config/qBittorrent || true=g' /etc/cont-init.d/30-config         && sed -i 's|/downloads/|/share/qBittorrent/|g' /defaults/qBittorrent.conf         && sed '11,13d' /defaults/qBittorrent.conf     && echo 'WebUI\HostHeaderValidation=false' >> /defaults/qBittorrent.conf     && echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf
 ---> Running in 25211d937ca6
Get:1 http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu focal InRelease [18.1 kB]
Ign:2 https://dl.cloudsmith.io/public/qbittorrent-cli/qbittorrent-cli/deb/ubuntu focal InRelease
Get:3 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Err:4 https://dl.cloudsmith.io/public/qbittorrent-cli/qbittorrent-cli/deb/ubuntu focal Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses not yet valid certificate.  Could not handshake: Error in the certificate verification. [IP: 52.84.174.8 443]
Err:1 http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu focal InRelease
  At least one invalid signature was encountered.
Get:5 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [101 kB]
Err:3 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Get:7 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Err:5 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:6 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:7 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists...
E: The repository 'https://dl.cloudsmith.io/public/qbittorrent-cli/qbittorrent-cli/deb/ubuntu focal Release' does not have a Release file.
W: GPG error: http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu focal InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: 
The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: 
The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.

Removing intermediate container 25211d937ca6

1 Like

Thanks! mmh… not easy… from what I read with this message on google it could mainly a desynchronized clock, a lack of space, or an issue with the sources… I’ll try to look again a bit later. If anyone has an idea don’t hesitate to chime in :wink:

I want to note that the same error occurs with your other addons. transmission and nextcloud I also could not install

1 Like

Thanks for the clarification, I thought i did something wrong. Thanks for the add-ons. it s a great one. I been using docker for many different torrent client, finally this one works with ha.

1 Like

@tyjtyj hanks very much for the feedback!

@For people who have the error “returned a non-zero code: 100” with in the log “The certificate chain uses not yet valid certificate.” that prevents to build locally, it seems to be linked to a desynchronization of the internal clock. It seem to happen rather frequently on some versions of docker or virtual machines when looking at those error codes in Google.

I got everything else working but mounting smb/cifs share not. Creds and paths are correct, also smb1 is checked.

Edit: I have samba backup addon also and it works fine with my nas, zyxel nsa320.

addon log:

[14:51:35] FATAL: Unable to mount //192.168.1.7/share to /mnt/share with username xxx, xxx. Please check your remote share path, username, password, domain, try putting 0 in UID and GID
[14:51:35] FATAL: Error read : mount error: Server abruptly closed the connection.
This can happen if the server does not support the SMB version you are trying to use.
The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

dmesg:

[17020.940682] CIFS: Attempting to mount //192.168.1.7/share
[17020.943556] CIFS: VFS: CIFS mount error: iocharset utf8 not found
1 Like

Hi! Thanks for testing the addon. I pushed a version ls145-v2 could you please test it?

You have perfectly reported the issue and it seems related to me having added utf8 requirement as a default in the mount sequence.

Thanks!

Edit : BTW thanks for pointing to the samba backup addon! It is very well coded. It uses an alternative connection method, smbclient instead of cifs mount. I’ll look at implementing that if you confirm that it still can’t mount.

Thanks :slight_smile: it mounts and works now, even if there’s something failed

addon:

[06:56:11] INFO: Mounting smb share(s)...
[06:56:12] INFO: ... //192.168.1.7/share successfully mounted to /mnt/share with options ,vers=1.0,iocharset=utf8

dmesg:

[248242.054676] CIFS: VFS: cifs_mount failed w/return code = -112
[248242.108128] CIFS: Attempting to mount //192.168.1.7/share
[248242.108181] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
1 Like

Perfect, thanks! Actually it tries iteratively every options for cifs until it works, and switches to the mount protocol used in the samba backup addon if nothing works. That’s why some errors appear even though it works in the end.

Glad it works!

Hey, is it possible to configure it so that torrents are deleted when Complete? Not that big of an issue just allows me to automate that extra step haha

1 Like

Mmh honestly that’s seems too much a specific need for me to introduce it as a default option. However, I do believe that the bittorrent default ui (when connecting with url: port and Disabling custom ui) you can specify a script to execute after completion. If you add the script in the /config/qBittorrent folder, which is exposed, you could have it execute. Not sure exactly what the script would need to be that that seems to me the easiest way to do it… Actually looking around on Google it seems that people have requested this to be added to qbittorrent but it was not accepted.

Thanks for using the addon!

Hey, just letting you know that it turns out that it’s a feature I can access in the default UI so that worked out perfectly. For those wanting to do it there’s an option to remove torrent and files under (When Torrent is Completed). Also sorry, didn’t mean for it to be configured as a default option, just a setting that could be changed.

1 Like

That’s great! And thanks for coming back with the solution for other people that have the same need :slight_smile:
Have a nice day

I’m trying to get this Add-on running but I continue to encounter the same errors below running version 14.3.6.99202107121017-7389-3ac8c97e6ubuntu20.04.1-ls145 (13-07-2021). Port “8080” is not in use on my system.

curl: (7) Couldn't connect to server
[14:55:14] ERROR: Something went wrong contacting the API
2021/07/30 14:55:14 invalid character ',' looking for beginning of value
[cont-init.d] 30-nginx.sh: exited 1.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 90-dns_set_1.1.sh: executing... 
[14:55:14] INFO: DNS SERVERS set to 10.7.1.123 
[cont-init.d] 90-dns_set_1.1.sh: exited 0.
[cont-init.d] 91-qbittorrent_configuration.sh: executing... 
[14:55:14] INFO: Downloads can be found in /share/qBittorrent
[14:55:14] INFO: Whitelisted subsets will not require a password : localhost,127.0.0.1,172.30.0.0/16,192.168.0.0/16
[14:55:14] INFO: WEBUI username set to admin
[14:55:14] INFO: Alternate UI enabled : vuetorrent. If webui don't work, disable this option
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
[cont-init.d] 91-qbittorrent_configuration.sh: exited 2.
[cont-init.d] 92-smb_mounts_v1.4.sh: executing... 
[cont-init.d] 92-smb_mounts_v1.4.sh: exited 0.
[cont-init.d] 93-openvpn.sh: executing... 
[14:55:14] 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.
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
"Web UI: Unable to bind to IP: *, port: 8080. Reason: Permission denied"

Any idea why I’m getting this error, or how to fix it? I’ve tried changing the WebUI port configuration to a variety of different ports that are not in use, but when I start the add-on it always complains about port 8080, regardless of what port I’ve configured the web interface to use. I’ve even removed the port number in the configuration to disable it, understanding that means I can only access the webUI via ingress. However, even that doesn’t work and the log still states permission denied opening port 8080.

Potentially related, but despite what DNS settings I’ve defined for the add-on (Google 8.8.8.8, 8.8.4.4, my ISP’s DNS, my internal pi-hole, router, none) the container is unable to resolve any names. This is the only container that seems to have this issue.

Any help is greatly appreciated.

1 Like

Indeed I see several errors in the script execution that prevents the addon from being correctly configured… All scripts seem to fail at some point. I’ll look at it tomorrow and contact you by pm it might be easier to troubleshoot.

Could you add the full log please so I can see where the first script failure appears? Thanks!

Also it is unlikely to work but I’ve pushed a new version v4 that removed a line impacting certificates.

1 Like

Updated to 14.3.6.99202107121017-7389-3ac8c97e6ubuntu20.04.1-ls145-v4 but still unable to bind port 8080 though. Any ideals?

[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-banner.sh: executing... 
curl: (7) Couldn't connect to server
[20:07:19] ERROR: Something went wrong contacting the API
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
Cannot open audit interface - aborting.
[cont-init.d] 10-adduser: exited 1.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
curl: (7) Couldn't connect to server
[20:07:19] ERROR: Something went wrong contacting the API
2021/07/30 20:07:19 invalid character ',' looking for beginning of value
[cont-init.d] 30-nginx.sh: exited 1.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 90-dns_set_1.1.sh: executing... 
[20:07:20] INFO: DNS SERVERS set to 10.7.1.123 
[cont-init.d] 90-dns_set_1.1.sh: exited 0.
[cont-init.d] 91-qbittorrent_configuration.sh: executing... 
[20:07:20] INFO: Downloads can be found in /share/qBittorrent
[20:07:21] INFO: Whitelisted subsets will not require a password : localhost,127.0.0.1,172.30.0.0/16,10.7.0.0/16
[20:07:22] INFO: WEBUI username set to admin
[20:07:23] INFO: Alternate UI enabled : qb-web. If webui don't work, disable this option
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
[cont-init.d] 91-qbittorrent_configuration.sh: exited 2.
[cont-init.d] 92-smb_mounts_v1.4.sh: executing... 
[cont-init.d] 92-smb_mounts_v1.4.sh: exited 0.
[cont-init.d] 93-openvpn.sh: executing... 
[20:07:23] 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.
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
Could not create AF_NETLINK socket (Permission denied)
"Web UI: Unable to bind to IP: *, port: 8080. Reason: Permission denied"

hello i have this and not starting :

-------------------------------------
GID/UID
-------------------------------------
User uid:    0
User gid:    0
-------------------------------------
chown: cannot access '/config/qBittorrent': No such file or directory
[cont-init.d] 10-adduser: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
1 Like