Deluge not working after update

  • DietPi version | 8.20.1
  • Distro version | bookworm
  • Kernel version | Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | arm64
  • SBC model | RP4b
  • Power supply used | offical raspberry pi power
  • SD card used | using m.2 sata

After upating to 8.20.1 deluge no longer works properly. I ran deluge-console and got this error:

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'
12:16:53 [ERROR   ][deluge.i18n.util                                      :146 ] Unable to initialize gettext/locale!
12:16:53 [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).

I came across this topic from someone having similar issues: https://bugs.launchpad.net/ubuntu/+source/deluge/+bug/2018159/comments/4 Which says that we should be using version 2.0.4. Any ideas here on how to fix?

Did you tried to update your version?

dietpi-software reinstall 45

Yup, I tried the reinstall option as well. It installs version 2.0.3. I believe I read another post on here that said the latest version from debian is 2.0.3. So not sure how we would update to 2.0.4.

ahh you are right. It is installed from Debian package repository. Indeed 2.0.3 is latest version on Debian Bookworm Debian -- Package Search Results -- deluged

Other versions must be created from the source itself.

You could try to reinstall packages manually

apt install --reinstall deluged deluge-web deluge-console

Just tried to do the manual install and still get the same errors. This was definitely working on 8.19 so not sure what has changed since then tha would cause it to break.

I don’t think it is related to DietPi version. Looks like the Deluge package on Debian Bookworm has some challenges. Tested Deluge on Debian Bullseye without issue. DietPi version doesn’t matter, tested on both DietPi v8.19.1 and v8.20.1.

So my options are waiting for a fix from deluge team or possibly downgrading or uninstalling and installing an older version? Would that potentially fix it for the time being?

Not sure if there is a way to downgrade the apt package