Deluge not working after an update

General support for problems installing or using Deluge
Post Reply
bookedirl
Member
Member
Posts: 17
Joined: Mon Nov 16, 2015 3:50 am

Deluge not working after an update

Post by bookedirl »

Hello, I'm currently running deluge on a RPi4B and recently I have been unable to connect. I believe it was after an update. Since I'm on rpi running on debian I can only update to whatever package they have which is 2.0.3.

deluged 2.0.3
libtorrent: 2.0.8.0
Python: 3.11.4
OS: Linux 6.1.21-v8+

This is the error I am getting when running deluge-console:

Code: Select all

root@DietPi:~# deluge-console
Unable to initialize gettext/locale!
module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
19:51:15 [ERROR   ][deluge.i18n.util                                      :146 ] Unable to initialize gettext/locale!
19:51:15 [ERROR   ][deluge.i18n.util                                      :147 ] module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
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.11/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).
Any idea how I would go about fixing this? I have tried a fresh install and that also did not work.
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Deluge not working after an update

Post by ambipro »

I would make a backup of your config folder, and then 'mv' the config directory to a different folder name, maybe reinstall deluge, and see if it starts, alternatively, there might be some missing package after the update...

if the regenerated "default" configs don't launch either, I'd look into missing dependencies (probably for GTK-UI) you may have opted not to install by accident when installing the deluge package.

My first guess, and it's just a guess, is that I think its a corrupted configuration file somewhere though...

Some search results on google both solved this same issue through these means.
bookedirl
Member
Member
Posts: 17
Joined: Mon Nov 16, 2015 3:50 am

Re: Deluge not working after an update

Post by bookedirl »

I just tried removing the config folder so it could rebuild and still it won't load (can't connecto on windows desktop/webui or headless with deluge console) I also just completely removed it and reinstalled it and still have the same issues. I believe this all happened switching from buster to bookworm so not sure if that has anything to do it with it or not. I did come across one search with a similar issue but they mentioned going to libtorrent 2.0.9. Is that possible?
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Deluge not working after an update

Post by ambipro »

It could be, it seems to be linked to a locale issue, I found this post, but not sure if is relevant or if you already tried this....

https://bbs.archlinux.org/viewtopic.php?id=252811

I don't think libtorrent is the issue, but you can install whatever version of libtorrent you want...

You can use pip to install from pypi (https://pypi.org/project/libtorrent/#history) and should get 2.0.9 I believe.

pip3 install libtorrent
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge not working after an update

Post by mhertz »

Try this: viewtopic.php?t=56235

Edit: Hmm, that was for the bottom ValueError, and later solution in my quote fixed such, but top AttributeError I didn't recognize, and seemingly was scheduled for removal in py3.10, so probably done by now. I will check later I.e a code-fix to apply, and will post back, probably later today if will get to it, sorry for premature noise evidently(though should still apply, just not fully presumably).

Btw, I much would recommend instead upgrading deluge through pip3, but your call.
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge not working after an update

Post by mhertz »

Delete line 111 and 142 of deluge/i18n/util.py to fix, as unneeded now. Was done in deluge itself between 2.0.3 and 2.0.4 in dev branch, as part of other bigger commit, additionally pruning some extra deprecations while at it, so I didn't need experiment and just saw from my phone :) You can search where is with e.g 'sudo find /usr -path *deluge/i18n/util.py'. (I'll refrain from posting cmd-line with complete unattended fix prepending e.g -exec/sed as used too, as bad security practise I feel in hindsight, so manual fix will sadly need do)

Also recently was reported to both Debian and ubuntu package maintainers I now see, where Debian maintainer stated was fixed in experimental then. Another posted it still worked non-interactively(CLI, not curses-TUI) and just showed error additionally, and that gtk-ui unaffected(probably just hidden for him then).

As said, for your ValueError if encountered, then check previous quote, and sorry think first solution not later, but all the issues there should apply to 2.0.3, so possibly affected by them all.

Still as said, upgrading preferred, as other issues still, and just in general.
bookedirl
Member
Member
Posts: 17
Joined: Mon Nov 16, 2015 3:50 am

Re: Deluge not working after an update

Post by bookedirl »

I tried to delete both lines in util.py as well as the previous post that had me changing code in connectionmanager.py. How can I upgrade deluge in debian is there another version that is stable or would It be upgrading to an unstable version? Either way if the issues are fixed how can I upgrade?
mhertz
Moderator
Moderator
Posts: 2331
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge not working after an update

Post by mhertz »

As ambipro said for libtorrent, you can do for deluge too(sudo pip3 install deluge, without sudo if preferred) and need package python3-pip. Also, if wanted can try the PPA method, which atleast in much older deluge versions were stated as viable for Debian too, just need experiment at times to match deps with ubuntu version etc.

Btw, if removing those two lines I said(with deluged closed), and then need run deluge-console too in special way, as I said in that link initially, or from screen or other terminal emulator, then should work, but side-point, and much better update agreed.

Didn't mean to but in on ambipro BTW, was just a quick link pointing, evolving.

Edit: About the needing to start deluge 2.0.3 with other $TERM var, or screen or other terminal-multiplexer etc, because color-scheme issues or alike, then should be fixed in deluge 2.1.0+. Issue was, I believe, some torrents with special chars in title breaks deluge parsing, because it strip color-codes firstly, and those color-codes start and end with '!{' and '!}', and so the error which already was to be ignored, had changed name/type, so missed then, and hence crashed.
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Deluge not working after an update

Post by ambipro »

mhertz wrote: Fri Aug 11, 2023 7:03 am As ambipro said for libtorrent, you can do for deluge too(sudo pip3 install deluge, without sudo if preferred) and need package python3-pip. Also, if wanted can try the PPA method, which atleast in much older deluge versions were stated as viable for Debian too, just need experiment at times to match deps with ubuntu version etc.

Btw, if removing those two lines I said(with deluged closed), and then need run deluge-console too in special way, as I said in that link initially, or from screen or other terminal emulator, then should work, but side-point, and much better update agreed.

Didn't mean to but in on ambipro BTW, was just a quick link pointing, evolving.

Edit: About the needing to start deluge 2.0.3 with other $TERM var, or screen or other terminal-multiplexer etc, because color-scheme issues or alike, then should be fixed in deluge 2.1.0+. Issue was, I believe, some torrents with special chars in title breaks deluge parsing, because it strip color-codes firstly, and those color-codes start and end with '!{' and '!}', and so the error which already was to be ignored, had changed name/type, so missed then, and hence crashed.
Always appreciate a second set of eyes :ugeek:
Post Reply