[Support] binhex - qBittorrentVPN


Recommended Posts

On 8/23/2023 at 12:01 AM, THF13 said:

The qBittorrent.conf file is being written to constantly even when there are no changes being made, at least once a minute.  These frequent writes make it much more likely there will be a corruption issue when the system or container crashes unexpectedly. 

This is 100% repeatable for me. I get approximately 4 or 5, less than 10 second power failures per month (joys of regional beach living). Every time the power goes out the qbittorrent.conf file is left with 0bytes. I have to manually restore a backup before I restart the docker or all torrent files get moved into the docker. every 12 months or so I forget. :( 

 

I have verified what THF13 pointed out, the qbittorrent.conf file gets written to every minute. No idea if the constant writes are required, but I do not recall binhexs' deluge docker ever doing this. 

 

Anyway, I have a work around, but manually restoring the .conf file 4 or 5 times a month is getting old.

Link to comment
On 8/29/2023 at 12:31 PM, Rhodius said:

Alternative WebUI issue

 

I have two qbit dockers running fine until I noticed my Unraid OS is 18 months old since last update (6.9.3). I know I shouldn't be updating unless there is issue, as issues usually show up right after upgrade. This time is really painful. My USB is corrupted thus I lost some of the dockers config and had to re-do the settings. 

Anywhoo, one of qbit docker is still getting error. The issue is every time I turned on Alternative Web UI to use the dark theme, I'd lost Web UI access with the error "Unacceptable file type, only regular file is allowed.". 

To be honest the other Qbit docker is running fine with dark theme. What is the problem? Is this Unraid 6.12.3 issue?  

Every time I tried to enable Alternative WebUI, it gives the error above, what I have to do is to go into qbit config and change that flag to false, save, reboot the qbit docker, and I can then access the Web UI, but otherwise it's a pain. 

 

Adding that this is Unraid 6.12.3 and Binhex-QbitVPN 4.5.4.

Thanks.

 

I just want to report back that I solved my own issue. 

The problem is I couldn't enable dark theme using the Alternate Web UI setting since I upgraded to 4.5.XXX. Not sure if this is a change on Qbit part. The error I had was "Unacceptable file type, only regular file is allowed". 

After checking on a few forums, I came across posting that the docker may not have access to folder. Since I have added many paths already to the two docker setups, I decided to just duplicate the theme inside the appdata folder. Specifically since my docker /config path already pointed to /appdata/binhex-qbittorrentvpn, I just copied the theme inside that folder. Then I set my alternate Web UI to the following:

/config/WebUI/theme (the theme files are inside /WebUI/theme).

 

In case anyone coming across the same issue, that's the solution. It is possible I don't have to dupe the folders by adding yet another path which both dockers can access, but less headache means more to me. Also not sure why this wasn't an issue in the previous release, I've been running this theme folder setup for 18 months until recent upgrade. 

 

 

 

Link to comment

UpdateContainer.htmlHi, 

 

Trying and failing to install this docker (I've used it via PTS and Dockstarter fine with no issues in past and with unRAID appx 2 years ago so not totally ignorant of it)

 

I've installed with defaults from template, changed the 8080 port to 8088 (why is 8080 default when SABnzbd uses that???) and changed the WEBUI_PORT variable ;-) to 8088 also.

 

I changed the /data path to my /mnt/user/pool (root data location so I can point downloads to one dir and incomplete to another ONCE I have it running). I made sure I disabled VPN and Privoxy to start (to eliminate them from troubleshooting to start) and click on WebUI which opens http://my.ip.add.ress:8088 which browser says refuses to connect (ERR_Connection_Refused)

 

Log attached. HTML screen with settings also. Unraid v6.12.4

 

I'm sure it's something dumb I've missed but brain is much and need some help.I need QBit running alongside SAB so I can tell Prowlarr to sync settings to then allow Sonarr and Radarr to refill all the files I had to delete from previous storage server

 

Thanks for your time ^_^

 

 

supervisord.log

Edited by methanoid
oops forgot attachments!
Link to comment
1 hour ago, methanoid said:

I'm sure it's something dumb I've missed but brain is much and need some help

Maybe you've already done this but didn't see it mentioned, did you also map host port 8088 to container port 8088?

 

1744321346_Screenshot2023-09-08at6_20_01PM.thumb.png.3332d8916b5dd4c2da0de991ae8f7496.png

 

IIRC you'll have to delete the current 8080 mapping because you can't edit it and create a new port mapping.

  • Like 1
Link to comment
11 hours ago, wgstarks said:

Maybe you've already done this but didn't see it mentioned, did you also map host port 8088 to container port 8088?

 

1744321346_Screenshot2023-09-08at6_20_01PM.thumb.png.3332d8916b5dd4c2da0de991ae8f7496.png

 

IIRC you'll have to delete the current 8080 mapping because you can't edit it and create a new port mapping.

 

I came up with another option lastnight (move SAB from 8080 to 8081) and then QB works with no VPN enabled. Add my VPN and enable Privoxy and log seems to show no issues but cannot access WebUI - ERR_CONNECTION_TIMED_OUT

 

I'm out now but when home will try disabling Privoxy and see if that helps

 

Link to comment

I see to be having huge issues with speed, dropping to a couple of KB/s. I used to have 25 MB/s. Furthermore, I've gone ahead and set qBit to TCP connections only. Yet, it seems that my speeds are very bad on the PIA network. Not sure what is going on. Maybe it would be interesting to see if you have recommended settings for qBit to use together with PIA.

Edited by vast
Link to comment
On 9/9/2023 at 10:55 AM, methanoid said:

 

I came up with another option lastnight (move SAB from 8080 to 8081) and then QB works with no VPN enabled. Add my VPN and enable Privoxy and log seems to show no issues but cannot access WebUI - ERR_CONNECTION_TIMED_OUT

 

I'm out now but when home will try disabling Privoxy and see if that helps

 

 

Nope, disabling Privoxy didnt help....  do I need to do the modprobe stuff in my Supervisord.log attached???

supervisord.log

Link to comment
On 6/23/2023 at 7:05 PM, eske said:

I just finished migrating over my torrents from the depreciated binhex rutorrent container. I did have to pip install qbittorrent-api to simplify using the qbittorrent api. I am not a programmer and so my process is super clunky but I was able to migrate about 3.4k torrents successfully. I am not running unraid but I am using the same containers.

 

Rather than downloading the torrent files via "get .torrent" in rutorrent, I downloaded the torrents in the session directory of rtorrent which are named with the hash.  I had a bunch of torrents with custom directories set and without the torrent name added to the path so I could not import all of my torrents and point them at a certain directory.

 

I had manually moved some torrents over so I ended up making a python script to compare the torrents loaded in qbittorrent to those in rtorrent and for those missing, output the torrent name, hash, and save path to a .csv.  Using the csv list of torrents and the torrent files from the rtorrent session directory I made another script to go through the .csv of torrents not in qbittorrent to add them using the save path from rtorrent for each torrent without creating subfolders.

 

To generate the .csv of missing torrents:

import csv
import xmlrpc.client
from qbittorrentapi import Client

# qBittorrent API Configuration
QB_USERNAME = 'USERNAME' #change
QB_PASSWORD = 'PASSWORD' #change
QB_HOST = '192.168.1.123'  # Modify with qbittorrent ip address
QB_PORT = 9081  # Modify qbittorrent iport

# ruTorrent Configuration
RUTORRENT_RPC_URL = 'http://USERNAME:[email protected]:9080/RPC2'  # Modify with your rutorrent credentials

# Connect to qBittorrent
qb_client = Client(host=QB_HOST, port=QB_PORT)
qb_client.auth_log_in(QB_USERNAME, QB_PASSWORD)

# Connect to ruTorrent
ru_client = xmlrpc.client.Server(RUTORRENT_RPC_URL)

# Get list of torrents in qBittorrent
qb_torrents = qb_client.torrents_info()

# Get list of torrents in ruTorrent
ru_torrents = ru_client.download_list("","main")

# Compare the torrents and find missing ones
missing_torrents = []
for ru_torrent in ru_torrents:
    ru_torrent_hash = ru_client.d.get_hash(ru_torrent).lower()
    found = False
    for qb_torrent in qb_torrents:
        if ru_torrent_hash.lower() == qb_torrent['hash'].lower():
            found = True
            break
    if not found:
        ru_torrent_name = ru_client.d.get_name(ru_torrent)
        print("Missing Torrent found! " + ru_torrent_name)
        ru_torrent_path = ru_client.d.get_directory(ru_torrent)
        missing_torrents.append({
            'name': ru_torrent_name,
            'path': ru_torrent_path,
            'hash': ru_torrent_hash
        })

# Export missing torrents to a CSV file
csv_file = 'missing_torrents.csv'
with open(csv_file, 'w', encoding="utf-8", newline='') as file:
    writer = csv.writer(file)
    writer.writerow(['Torrent Name', 'Path', 'Torrent Hash'])
    for torrent in missing_torrents:
        writer.writerow([torrent['name'], torrent['path'], torrent['hash']])

print(f"List of missing torrents exported to {csv_file}")

 

Take the csv and add the torrents to qbittorrent using the downloaded torrent files from the session directory

import qbittorrentapi
import os
import csv

def add_torrent(username, password, url, torrent_file_path, save_path):
    # Connect to the qBittorrent client
    client = qbittorrentapi.Client(host=url, username=username, password=password)
    client.auth_log_in()

    try:
        # Read the .torrent file as binary
        with open(torrent_file_path, 'rb') as file:
            torrent_data = file.read()

        # Set the request parameters
        parameters = {
            'savepath': save_path,
            'paused': True,  # Set all torrents to be added as paused
            'autoTMM': False  # Disable subfolder creation
        }

        # Add the .torrent file
        client.torrents_add(torrent_files=torrent_data, savepath=save_path, category='', parameters=parameters)
        print("Torrent added successfully!")

    except qbittorrentapi.LoginFailed as e:
        print("Authentication failed. Please check your credentials.")
    except Exception as e:
        print(f"Error: {e}")

# Provide your qBittorrent's API URL, username, and password
api_url = 'http://192.168.1.123:9081'  # Replace with your qBittorrent's API URL and port
api_username = 'USERNAME'  # Replace with your qBittorrent's API username
api_password = 'PASSWORD'  # Replace with your qBittorrent's API password

# Provide the path to the CSV file
csv_file_path = 'C:\\Users\\user\\Desktop\\rtorrent\\missing_torrents.csv'  # Replace with the path to your CSV file of missing torrents generated by the previous script

# Read the CSV file and add the torrents
with open(csv_file_path, 'r') as file:
    csv_reader = csv.DictReader(file)
    for row in csv_reader:
        try:
            torrent_file_path = 'C:\\Users\\user\\Desktop\\rtorrent\\session_torrent_files\\' + row['Torrent Hash'].upper() + '.torrent'
            save_path = row['Path']
            add_torrent(api_username, api_password, api_url, torrent_file_path, save_path)
        except Exception as e:
            print(row)
            continue

 

All torrents will be added in as paused. I did a force recheck and once that was done everything was migrated over.  You could modify this to do it all on the server and in a single script with less code but this is what I got to work.

Hello, thanks for the scripts! 

 

I have two problems though. 

For some reason the torrents are not added in a paused state. I have copied your code exactly and only changed file paths, auth info and client ip/port. 

 

The other problem is that some torrents are added as a subfolder inside the main folder. (example: series/seriesname/season2/season2/episode1.mkv or movies/moviename1/moviename1/moviename1.mkv). I can live with that if I can load them as paused

Link to comment
14 hours ago, kakmoster said:

Hello, thanks for the scripts! 

 

I have two problems though. 

For some reason the torrents are not added in a paused state. I have copied your code exactly and only changed file paths, auth info and client ip/port. 

 

The other problem is that some torrents are added as a subfolder inside the main folder. (example: series/seriesname/season2/season2/episode1.mkv or movies/moviename1/moviename1/moviename1.mkv). I can live with that if I can load them as paused

I will try 

 

is_paused=True,

use_auto_torrent_management=False, 

 

Instead of paused and autoTTM tonight. 

Edited by kakmoster
Link to comment
On 9/7/2023 at 1:35 PM, curtdwar said:

This is 100% repeatable for me. I get approximately 4 or 5, less than 10 second power failures per month (joys of regional beach living). Every time the power goes out the qbittorrent.conf file is left with 0bytes. I have to manually restore a backup before I restart the docker or all torrent files get moved into the docker. every 12 months or so I forget. :( 

 

I have verified what THF13 pointed out, the qbittorrent.conf file gets written to every minute. No idea if the constant writes are required, but I do not recall binhexs' deluge docker ever doing this. 

 

Anyway, I have a work around, but manually restoring the .conf file 4 or 5 times a month is getting old.

 

On 8/22/2023 at 3:01 PM, THF13 said:

As someone who spent about a month dealing with their server being unreliable, I ran into this issue a lot, and wanted to share why I think it comes up for this container more than others.  

The qBittorrent.conf file is being written to constantly even when there are no changes being made, at least once a minute.  These frequent writes make it much more likely there will be a corruption issue when the system or container crashes unexpectedly.  I doubt you're doing anything intentionally to cause this, but I spun up the linuxserver Qbit container (without vpn, proxy, any of the extra things you've added obviously) and it hasn't made any writes to the qBittorrent.conf file in 20 minutes.  

 

The other reason I think this issue keeps coming up here is that it's more than an inconvenience.  I use categories to place different files at different locations.  When the .conf file reset happens, it doesn't just return the instance to a blank slate.  It still remembers the active torrents, but none of my category configurations for them.  So as soon as the container starts it uses qBit's automatic torrent management mode and the default location and starts moving every single file I have seeding into the default download directory.  

 

I've solved my unrelated server instability issues and haven't run into this issue in a while, but even so I still make sure to only have the container start manually so I can check it.  

This has now been improved upon, you should see significantly less writes to the config and thus less chance of corruption on unexpected shutdown, please pull latest and let me know how you get on.

  • Like 1
Link to comment
On 9/3/2023 at 3:55 AM, binhex said:

Just be careful out there guys and don't use default creds and for the love of God turn off upnp.
https://torrentfreak.com/qbittorrent-web-ui-exploited-to-mine-cryptocurrency-heres-how-to-fix-230902/

Sent from my 22021211RG using Tapatalk
 

 

After the latest update today, it seems the credentials were set back to default. If I look at the settings, it looks like the new password is stored there based on the number of characters, but I can only login to qBt using the default password. I've also noticed that the option to use secure connections (SSL) is not enabled or selectable, and the authentication tickbox is greyed out. I did still have to login using the default credentials. I do have uPNP disabled in qBt. Was looking in the wrong section of options as stated below... DOH!

 

Also noted this in the logs, and I don't recall seeing those errors previously. qBt seems to have started up properly otherwise, with Wireguard configured.

 

Quote

2023-09-20 09:29:49,921 DEBG 'start-script' stderr output:
Error: argument "8080_qbittorrent" is wrong: invalid table ID


2023-09-20 09:29:49,924 DEBG 'start-script' stderr output:
Error: argument "8080_qbittorrent" is wrong: "table" value is invalid

 

Thoughts?

Edited by AgentXXL
Added errors from logs
Link to comment
24 minutes ago, AgentXXL said:

After the latest update today, it seems the credentials were set back to default. If I look at the settings, it looks like the new password is stored there based on the number of characters, but I can only login to qBt using the default password. I've also noticed that the option to use secure connections (SSL) is not enabled or selectable, and the authentication tickbox is greyed out.

none of these problems for me, im running latest, auth disabled for me as i use vpn to connect:-

image.png.e722afdcd4600d8b4d2361672f4bbb56.png
can you post a screenshot showing your issue with unselectable ' use secure connections (SSL)' and authentication tickbox greyed out.

Link to comment
3 minutes ago, binhex said:

none of these problems for me, im running latest, auth disabled for me as i use vpn to connect:-

y
can you post a screenshot showing your issue with unselectable ' use secure connections (SSL)' and authentication tickbox greyed out.

 

Let's just say I'm a dumbass... I shouldn't try to make changes until my brain has woken up fully. I have this habit of checking all containers and plugins every day, usually one of my first tasks of the day. I was looking at the authentication in the email notifications section, not on the web UI page... DOH!! Thanks for the quick response!

 

  • Haha 1
Link to comment

Updated to latest version released today, and can no longer connect to webui. 

 

Always popped the log open and watched for this:

 

2023-09-20 15:21:15,604 DEBG 'watchdog-script' stdout output:
[info] qBittorrent process listening on port 8080

 

Once that appeared in the log I could connect, but not after this latest update.

 

Unsure on how to proceed to troubleshoot it.

Link to comment
27 minutes ago, Arteekay said:

Updated to latest version released today, and can no longer connect to webui. 

 

Always popped the log open and watched for this:

 

2023-09-20 15:21:15,604 DEBG 'watchdog-script' stdout output:
[info] qBittorrent process listening on port 8080

 

Once that appeared in the log I could connect, but not after this latest update.

 

Unsure on how to proceed to troubleshoot it.

 

I am getting the same error as well.

 

Happening on the binhex-sabnzbdvpn as well.  Config still looks good, and I know everyone says it but truly I have changed nothing on my end 🥲, just happened to update my dockers today and poof.

  • Like 1
Link to comment

Thanks wgstarks, that appears to be all the hint I needed, resolved. But I'll post what happened in case it helps Smonrad or anyone else.

 

Apparently, since I installed this docker a few months ago, I was using the wrong value in "Container Variable: LAN_NETWORK". My IP is 192168.0.200, but I had 192.168.1.0/24 entered here. I've got hundreds of this entry in my supervisord.log. This has "worked" up until today's update. 

 

Changing to the proper 192.168.0.0/24 resolves the issue.

 

I find the following interesting entries in my supervisord.log from before and after:

 

  • 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. 

 

  • file 'credentials.conf' is group or others accessible

 

  • NOTE: the current --script-security setting may allow this configuration to call user-defined scripts

 

Assumed they were nothing to worry about. 

 

New since today's update is the following entry:

 

  • Error: argument "8080_qbittorrent" is wrong: invalid table ID

 

Doesn't appear in my archived log.

 

I've attached my supervisord.log for completeness. Hopefully I caught everything I should delete prior.

 

 

supervisord.log

Edited by Arteekay
Formatting
  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.