Page 1 of 1

I broke my deluge-web :(

Posted: Tue Feb 21, 2017 10:31 pm
by Sahasrahla
Ubuntu 16.10 Server (headless)
Deluge 1.3.13

Installed using the repository listed here: ... nux/Ubuntu
Configured with Systemd as listed here: ... ce/systemd
Running as a Thin Client as listed here:

deluged and deluge-web both worked as intended for many moons. One day (about a week ago) I rebooted the server and came to find out deluged still works as intended, but deluge-web will no longer start. Blah blah blah, fast forward a week of me troubleshooting and fumbling around and I've come to this error:

Code: Select all

andy@brainiac-ubuntu:~$ sudo -u deluge /usr/bin/deluge-web
Traceback (most recent call last):
  File "/usr/bin/deluge-web", line 9, in <module>
    load_entry_point('deluge==1.3.13', 'console_scripts', 'deluge-web')()
  File "/usr/lib/python2.7/dist-packages/deluge/ui/web/", line 138, in start
  File "/usr/lib/python2.7/dist-packages/deluge/ui/web/", line 107, in start
    import server
  File "/usr/lib/python2.7/dist-packages/deluge/ui/web/", line 54, in <module>
    from twisted.web import http, resource, server, static
  File "/usr/lib/python2.7/dist-packages/twisted/web/", line 37, in <module>
    from twisted.web import iweb, http, util
  File "/usr/lib/python2.7/dist-packages/twisted/web/", line 303, in <module>
    class FailureElement(Element):
  File "/usr/lib/python2.7/dist-packages/twisted/web/", line 386, in FailureElement
  File "/usr/lib/python2.7/dist-packages/twisted/web/", line 401, in __init__
    self._loadedTemplate = _flatsaxParse(NativeStringIO(s))
  File "/usr/lib/python2.7/dist-packages/twisted/web/", line 344, in _flatsaxParse
    parser = make_parser()
  File "/usr/lib/python2.7/xml/sax/", line 93, in make_parser
    raise SAXReaderNotAvailable("No parsers found", None)
xml.sax._exceptions.SAXReaderNotAvailable: No parsers found

I'm mostly certain the problem was caused by me updating things all willy-nilly, and probably updated some part of Python or something which didn't take effect until the reboot. May have also been caused by apt-get autoremove when apt-get suggested it... I have banged my head against this problem for a week, but I am quite new to Linux in general and now I am here, at your mercy and kindness, asking for assistance.

Here's some general things I've tried, but am willing to try anything again with guidance:
1. uninstalled and reinstalled deluge-web
2. reinstalled python2.7 (though it said it was already installed and up-to-date)
3. fiddled with environment variables (LD_LIBRARY_PATH and PYTHONPATH)
4. installed python-lxml, also considered pyxml but never got around to it
5. tried unsuccessfully to enable logging on deluge-web by following the Logging section of ... ce/systemd
6. more things certainly that I can't remember...

Please help. Thank you in advance.

Re: I broke my deluge-web :(

Posted: Wed Mar 08, 2017 6:37 pm
by Sahasrahla
I fixed it!

Here's how for future reference:
More Google-Fu lead me to manually run

Code: Select all

andy@brainiac-ubuntu:~$ python
Python 2.7.12+ (default, Sep 17 2016, 12:08:02)
[GCC 6.2.0 20160914] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexpat
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python2.7/lib-dynload/ undefined symbol: XML_SetHashSalt

Googling that error lead me to here which lead to here which suggested I check the Python expat dependencies with the command:

Code: Select all

ldd /usr/lib/python2.7/lib-dynload/

and the poster specifically references his "" being out of place... He renamed the misplaced to causing the library dependency to check the next PATH location for

I found that I do not have a "", but I do have a "" which seemed similar enough, so I ran:

Code: Select all

ldd /usr/lib/python2.7/lib-dynload/

and for me, it returned:

Code: Select all =>  (0x00007fff417fb000) => /lib/x86_64-linux-gnu/ (0x00007f4cc5817000) => /lib/x86_64-linux-gnu/ (0x00007f4cc5450000) => /usr/lib/plexmediaserver/ (0x00007f4cc521d000)
/lib64/ (0x0000559b8d587000) => /lib/x86_64-linux-gnu/ (0x00007f4cc5006000)

As you can see, one of those things is not like the others... I renamed /usr/lib/plexmediaserver/ to, and now my "ldd /usr/lib/python2.7/lib-dynload/" reports:

Code: Select all => /lib/x86_64-linux-gnu/ (0x00007f8cfa067000)

and the deluge-web service stays running and functions as intended.

As an added bonus, renaming that file also didn't break PlexMediaServer as far as I can tell...

Re: I broke my deluge-web :(

Posted: Thu Mar 09, 2017 1:19 am
by Cas
Nice investigative work! :-)