[SOLVED] "unspecified system error" on a specific tracker (Debian)

General support for problems installing or using Deluge
Post Reply
balatico
New User
New User
Posts: 5
Joined: Wed Feb 05, 2020 9:48 am

[SOLVED] "unspecified system error" on a specific tracker (Debian)

Post by balatico »

I recently started using Deluge on Debian (version 2.0.5, installed from pip), behind namespaced-openvpn (using info from this thread: viewtopic.php?f=7&t=49883, thanks for all of you who contributed to it ; I also used this technique with socat for port forwarding: https://unix.stackexchange.com/a/298409)

I now have a problem with one specific tracker. On the WebUI, the torrents I have on this tracker all display the same error in the Tracker Status field: Error: unspecified system error. On the other hand, through deluge-console, the status is Tracker: ****.*** says "OK"

Do you know how I could diagnose this error?
Thanks!

Code: Select all

compy9000:~$ deluge --version
deluge 2.0.5
libtorrent: 1.2.15.0
Python: 3.9.9
OS: Linux Debian GNU/Linux oldstable-updates sid
Last edited by balatico on Fri Jan 07, 2022 9:44 pm, edited 1 time in total.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: "unspecified system error" on a specific tracker (Debian)

Post by mhertz »

balatico
New User
New User
Posts: 5
Joined: Wed Feb 05, 2020 9:48 am

Re: "unspecified system error" on a specific tracker (Debian)

Post by balatico »

Thank you! This precise certificate didn't solve my problem, but I'll check out the HTTPS certificates for my problem tracker.

Do you know if certificates installed through sudo update-ca-certificates will be taken into account by deluged/deluge-web?
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: "unspecified system error" on a specific tracker (Debian)

Post by mhertz »

You're very welcome :)

Presumably libtorrent itself handles this for trackers through openssl, which then update-ca-certificates should work i'd guess, but regardless I had a slight hunch I wanted to check out first before letting you down a goose-chase, and it was correct actually, my speculation I mean.

So, in short, the libtorrent on pypi unfortunetly forgot, or decided against for whatever reason, to use crypto=openssl b2 building flag, which isn't default, or miss/wrongly-set the openssl-include option pointing to correct openssl lib path. This means that https trackers will never be announced to sadly. I tested by loading a linux iso and adding manually a known working https tracker to it, and it states 'unspecified system error' just like yours. Why deluge-console states otherwise i'm not sure, but regardless, this is the issue unfortuently, as otherwise pretty nice getting latest libtorrent from pypi, i'll see if I can report it to author if he has a github or something, as I know e.g. the awesome footleg job doadin making currently for providing a windows installer in feature, also uses this libtorrent from pypi also. Thanks for letting us know btw, from this, as pretty important info :)

I tested it worked through apt's regular python3-libtorrent package(libtorrent-rasterbar10), which was 1.2.9 on this ubuntu 20.10 VM I tested this in. I don't know if you have access to this from your repos, as old-stable seemingly is buster, so probably not there, though you also list sid, so dunno if you can get it through regular 'apt install', and otherwise as you cannot use libtorrent develop PPA on debian, then I guess your only bet is download the debian libtorrent deb packages and install, though you probably need several deps to go also, boost and whatnot, or lastly build yourself.

Sorry for initial wrong info given. Good luck.

Edit: I knew it was from a nice contributor alleesingeye or something along that, but I saw on pypi it was co-maintained by him and arvid himself, so I checked the official libtorrent git-repo, and it seems there is openssl-support, would also be strange otherwise coming from lead-dev, not knowing to do this. I'm looking through reports there, before making redundant one myself, and quickly found related one, though latest 2.x libtorrent but regardless, and with same error as us, and arvid stated to check root-certificates was available. Also was stated it worked on qbittorrent, and I believe deluge uses certifi python package to include a root-cert pem, or something, which probably is other solution on c++ vs python(qvittorrent vs deluge). I just don't understand why the 1.2.9 from apt works in deluge, but just not the 1.2.15 from pypi. I also remember same scenario, with libtorrent 1.1.13 or something, 2 years ago when I started the unofficial windows installer, and had to change to build libtorrent myself, because the 1.1.13 on pypi, from Cas I believe, had same issue(though error there was "unsupported protocol", but still https failing issue, I checked), despite I remember now seeing log on appvoyer or whatever called, from his build, where he clearly did define b2 cryprto-openssl etc, so don't really get what's this about. Sorry for long windedness, and will try to look more into it, when having time, as seemingly it's not just about a forgotten build-switch.

Edit2: Just wanted to add that untill finding out how fix this, hopefully, then can as a little bad workaround, disable https validation in libtorrent through ltconfig deluge plugin here: https://github.com/ratanakvlun/deluge-ltconfig/releases. The option to disable is 'validate_https_trackers'. Here's the ltconfig.conf content, which you can copy/paste if wanted, into new 'ltconfig.conf' file in deluge profile dir,, and copy plugin into deluge's config dir into 'plugins' subfolder and enable through 'deluge-console plugin -e ltconfig'.

Code: Select all

{
    "file": 1,
    "format": 1
}{
    "apply_on_start": true,
    "settings": {
        "validate_https_trackers": false
    }
}
balatico
New User
New User
Posts: 5
Joined: Wed Feb 05, 2020 9:48 am

Re: "unspecified system error" on a specific tracker (Debian)

Post by balatico »

Thank you so much for your answer!

To answer your question, I had used libtorrent 1.2 from https://launchpad.net/~libtorrent.org/+ ... /1.2-daily (which wasn't working).

Thanks to the info you provided, I compiled libtorrent from source, with the Python bindings, following the infos from https://libtorrent.org/python_binding.html, part "building with setup.py", and here's the command I used sudo python setup.py build_ext --b2-args="crypto=openssl cxxstd=14" install.

I also deleted all the other competing libtorrent bindings in /usr/local/lib/python3.9/dist-packages/ until I had the right version number when typing python3 -c "import libtorrent; print (libtorrent.version)", then I reinstalled deluge (from pip) and it works! Thank you once again :)
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [SOLVED] "unspecified system error" on a specific tracker (Debian)

Post by mhertz »

Good job and thanks for posting steps for users finding this from google search e.g., and also you're very welcome mate :)

I'll have to digg little, when have time/motivation - I thought was a general issue, so also would be on windows, but tested that isn't the case, with same pip libtorrent and deluge 2.0.5 - very strange. Anyway, glad you figured it out, and if finding anything later, then will make an edit here, just for others interrested as you have fixed the situation yourself now. Thanks for feedback again.

Edit: Okay here's the situation for anyone interrested. The pypi libtorrent is built with a static openssl not hardcoded to a cert-store, atleast for linux. Why it worked on windows, is that either it was setup to load certs there, or regardless it would work anyway because I remember from deluge code that it sets a SSL_CERT_FILE env-var to the value of certifi.where(), so is setup for https verification automatically there. Anyway, for linux, then you either need to define an env-var yourself, or disable https-verification in libtorrent alternatively. You can test on linux that it begins working again if starting deluge(d) through:

Code: Select all

SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt deluge
You don't have to do that every time though, and just need to export said env-var from one of your startup files in your system's .zshrc/.zprofile/.bashrc/.bash_profile etc. - Alternatively can also use SSL_CERT_DIR, instead of SSL_CERT_FILE env-var, just give dir and not file of-course then. - So just pick one of these to add:

Code: Select all

export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

Code: Select all

export SSL_CERT_DIR=/etc/ssl/certs
I tested this working with libtorrent 1.2.15 and deluge 2.0.5 both installed through pip, on a ubuntu test VM.

Hope helps :)
balatico
New User
New User
Posts: 5
Joined: Wed Feb 05, 2020 9:48 am

Re: [SOLVED] "unspecified system error" on a specific tracker (Debian)

Post by balatico »

This solution with the env-var is way simpler, I'll use it when it's time to update libtorrent or deluge!
Post Reply