deluge-console Error

General support for problems installing or using Deluge
Post Reply
Doctor.Corndog
Member
Member
Posts: 11
Joined: Wed Jul 06, 2022 10:42 pm

deluge-console Error

Post by Doctor.Corndog »

After having some issues with my old box, build a new server and starting fresh. Deluged works great from both a remote connection and from the web-ui. Deluge-Console (Which I will rely on due to the VPN) seems to be having some issues tho:

deluged 2.0.3
libtorrent: 2.0.5.0
Python: 3.10.4
OS: Linux Ubuntu 22.04 Jammy Jellyfish

Code: Select all

deluge-console

Traceback (most recent call last):
  File "/usr/bin/deluge-console", line 33, in <module>
    sys.exit(load_entry_point('deluge==2.0.3', 'console_scripts', 'deluge-console')())
  File "/usr/lib/python3/dist-packages/deluge/ui/console/__init__.py", line 19, in start
    Console().start()
  File "/usr/lib/python3/dist-packages/deluge/ui/console/console.py", line 164, in start
    return deluge.common.run_profiled(
  File "/usr/lib/python3/dist-packages/deluge/common.py", line 1344, in run_profiled
    return func(*args)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/console.py", line 159, in run
    return c.start_ui()
  File "/usr/lib/python3/dist-packages/deluge/ui/console/main.py", line 159, in start_ui
    wrapper(self.run)
  File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/main.py", line 247, in run
    colors.init_colors()
  File "/usr/lib/python3/dist-packages/deluge/ui/console/utils/colors.py", line 110, in init_colors
    counter = define_pair(counter, 'white', 'grey', curses.COLOR_WHITE, 241)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/utils/colors.py", line 91, in define_pair
    curses.init_pair(counter, fg, bg)
ValueError: Color number is greater than COLORS-1 (7).
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge-console Error

Post by mhertz »

Seemingly py3.10 introduced some curses changes that can trigger said value-error upon invalid perceived colors detected at the time.

In some other projects the solution simply was e.g. 'export TERM=xterm-256color'. You can test if this works firstly through e.g. 'TERM=xterm-256color deluge-console'. Some terminals and color-schemes seemingly wasen't affected.

I don't really remember how good libtorrent 2.x support deluge 2.0.3 had, I believe was little "too early", though could be wrong. You can though install latest deluge from this PPA if wanted(or from pip):

https://launchpad.net/~deluge-team/+arc ... ntu/stable

Hope helps.
pjlbyrne
Leecher
Leecher
Posts: 68
Joined: Thu May 22, 2014 9:28 am

Re: deluge-console Error

Post by pjlbyrne »

Yes that works. It fails otherwise.

Also, if I run inside a 'screen' session the lines render correctly too. I forget how I found that out.

It still won't connect to the server though! I worked out a way round this some months ago but I forget why right now.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge-console Error

Post by mhertz »

If server on same computer as client, then quick way is 'sudo -u deluge deluge-console', or whatever user deluged run from. Also can copy Auth and probably hostlist.conf from e.g /var/lib/deluge/.config/deluge to ~/.config/deluge, and maybe work, but not sure.

For other server, then I don't know sorry, except standard of enable remote connection and add user/pass into e.g var/lib/deluge/.config/deluge/Auth and input/save when logging in from deluge-console from own user.
pjlbyrne
Leecher
Leecher
Posts: 68
Joined: Thu May 22, 2014 9:28 am

Re: deluge-console Error

Post by pjlbyrne »

Oh that's right I can connect AS deluge - but not via auth from my other normal user id.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: deluge-console Error

Post by mhertz »

Yeah I found a couple issues, e.g. the port is saved in 'result' dict as string not int - i'll make a bug-ticket later, but meanwhile here's my quick code-hacks incase anyone interessted.

Edit line 107 of connectionmanager.py e.g. in '/usr/lib/python3.19/site-packages/deluge/ui/console/modes/connectionmanager.py' from/to:

Code: Select all

                result['port']['value'],

Code: Select all

                int(result['port']['value']),
Then currently when having input new host data and pressed return then need also press escape to get out of connection-manager, which if wanted also fixed: Edit line 135 of connectionmanager.py e.g. in '/usr/lib/python3.19/site-packages/deluge/ui/console/modes/connectionmanager.py' from/to:

Code: Select all

            self.update_select_host_popup()

Code: Select all

            self.pop_popup()
Btw, if using same PC for server/client, and running deluged from deluge user and run deluge-console from own user, then besides using 'sudo -u deluge deluge-console', then can also just copy over auth from deluge user profile e.g. /var/lib/deluge/.config/deluge and into ~/.config/deluge for using deluge-console non-interactively(with commands) without needing connecting/auto-login. For same but interactively(without commands, curses TUI) then instead need copy hostlist.conf and then can press return to log-in after starting deluge-console. For both functionalities, then copy both over, obviously.

Last, can omit the code-hacks if just editing own user's hostlist.conf to match host, port, user, pass of wanted host.

Edit: https://dev.deluge-torrent.org/ticket/3538#ticket
Post Reply