rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.05k stars 412 forks source link

`rtorrent` (0.9.8-3) reports DHT as "`not enabled`" even though I am under the impression it should be. #1187

Closed CalinZBaenen closed 1 year ago

CalinZBaenen commented 1 year ago

This may be similar to #383, "DHT not enabled." even when it is but it is from twothousandsixteen (2016) and is still unresolved, so it could be a misunderstanding or a bug.

So I wanted to install the current latest version of Arch Linux, 5.19.12.
I needed a torrent client and I decided to use a CLI app since it'd be quick to pick up and use right away, this lead to me installing rtorrent via yay.
I ran the program, it told me it couldn't find ~/.rtorrent.rc, I fixed that, got a tracker issue, I fixed it using a solution from the Arch Linux Forms, then this message appeared:
(18:02:35) Scheduled command failed: dht_add_node: DHT not enabled.

This is my /home/calin/.rtorrent.rc file:

# Make sure DHT is enabled.
dht.mode.set = on

# Default tracker and DHT node.
method.insert = d.add_tracker, simple|private, "d.tracker.insert=\"10\", \"udp://tracker.opentrackr.org:1337/announce\""
method.insert = d.add_node, simple|private, "dht.add_node=dht.libtorrent.org:25401"

# Add default tracker to new torrents and schedule the DHT node created.
method.set_key = event.download.inserted_new, tracker_insert, ((d.add_tracker))
schedule2 = dht_add_node, 15, 0, ((d.add_node))

this is how yay (yay rtorrent*) displays the package:

1 community/rtorrent 0.9.8-3 (379.0 KiB 1.2 MiB) (Installed)
    Ncurses BitTorrent client based on libTorrent

Are there any instructions on how I can fix this?
I'm on Arch Linux, x86_64.

Thanks in advance.
Cheers.

kannibalox commented 1 year ago

DHT requires a session directory to work. Try adding something like this to your rtorrent.rc:

session.path.set = /home/calin/rtorrent-session
CalinZBaenen commented 1 year ago

Can I substitute /home/calin/ with $HOME or ~ or does it have to be an absolute path.

CalinZBaenen commented 1 year ago

@kannibalox, upon trying your solution I get a new error: rtorrent: Could not lock session directory: "/home/calin/rtorrent-session/", No such file or directory.
(There is no / at the end of the line. The program must have assumed it was a directory (for some reason).)

kannibalox commented 1 year ago

It's meant to be a directory, and rTorrent won't automatically create it. You'll need to run mkdir /home/calin/rtorrent-session/ to create it first.

CalinZBaenen commented 1 year ago

It works now except a new problem has been discovered, it did nothing.

I tried rtorrent then entered ~/Downloads/archlinux_20221001_x8664.torrent and it seemed like ti worked and wanted to do something.
I checked both Downloads and ~/rtorrent-session and no .iso file. (However, as stated, it does work, this is proven by rtorrent putting stuff in rtorrent-session/.)

Here is my terminal:

                   *** rTorrent 0.9.8/0.13.8 - CalinsDator:7266 ***
[View: main]                                                          [ none of 1    ]
   archlinux-2022.10.01-x86_64.iso
  [CLOSED]     0.0 /  798.3 MB Rate:   0.0 /   0.0 KB Uploaded:     0.0 MB
  Inactive:

[Throttle off/off KB] [Rate   0.2/  0.5 KB] [Port: 6965] [U 0/0] [D 0/0] [H 0/32] [S 
kannibalox commented 1 year ago

As the UI shows, the torrent is closed and inactive. https://github.com/rakshasa/rtorrent/wiki/User-Guide and https://github.com/rakshasa/rtorrent/wiki/CLI-Usage are good resources for getting started with the terminal interface. In this particular case, hitting the down arrow to select the torrent and then Ctrl-s start it will activate it.

CalinZBaenen commented 1 year ago

So I was confused as to where my .iso was at first and found out it was just chillin' in ~.
Is there any way to configure where torrents are downloaded to? I'd like them to appear in ~/Downloads.

kannibalox commented 1 year ago

There's a more complex config example here: https://github.com/rakshasa/rtorrent/wiki/CONFIG-Template The lines relevant to changing the default directory are:

method.insert = cfg.basedir,  private|const|string, (cat,"/home/USERNAME/rtorrent/")
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
# ...snip...
directory.default.set = (cat, (cfg.download))
CalinZBaenen commented 1 year ago

Do I have to set cfg.basedir?
I want to understand this while having only necessary stuff.
I would check the URL but I'm at school RN - does it explain everything necessary to my knowledge?

(Also, unrelated, what syntaxhighlighting did you use? I used rc and it did nothing.)