I broke my deluge-web :(

General support for problems installing or using Deluge
Post Reply
Sahasrahla
New User
New User
Posts: 3
Joined: Tue Feb 21, 2017 9:06 pm

I broke my deluge-web :(

Post by Sahasrahla »

Ubuntu 16.10 Server (headless)
Deluge 1.3.13

Installed using the repository listed here: http://dev.deluge-torrent.org/wiki/Inst ... nux/Ubuntu
Configured with Systemd as listed here: http://dev.deluge-torrent.org/wiki/User ... ce/systemd
Running as a Thin Client as listed here: http://dev.deluge-torrent.org/wiki/UserGuide/ThinClient

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/web.py", line 138, in start
    web.start()
  File "/usr/lib/python2.7/dist-packages/deluge/ui/web/web.py", line 107, in start
    import server
  File "/usr/lib/python2.7/dist-packages/deluge/ui/web/server.py", line 54, in <module>
    from twisted.web import http, resource, server, static
  File "/usr/lib/python2.7/dist-packages/twisted/web/server.py", line 37, in <module>
    from twisted.web import iweb, http, util
  File "/usr/lib/python2.7/dist-packages/twisted/web/util.py", line 303, in <module>
    class FailureElement(Element):
  File "/usr/lib/python2.7/dist-packages/twisted/web/util.py", line 386, in FailureElement
    """)
  File "/usr/lib/python2.7/dist-packages/twisted/web/template.py", line 401, in __init__
    self._loadedTemplate = _flatsaxParse(NativeStringIO(s))
  File "/usr/lib/python2.7/dist-packages/twisted/web/template.py", line 344, in _flatsaxParse
    parser = make_parser()
  File "/usr/lib/python2.7/xml/sax/__init__.py", 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 http://dev.deluge-torrent.org/wiki/User ... ce/systemd
6. more things certainly that I can't remember...

Please help. Thank you in advance.
Sahasrahla
New User
New User
Posts: 3
Joined: Tue Feb 21, 2017 9:06 pm

Re: I broke my deluge-web :(

Post 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/pyexpat.x86_64-linux-gnu.so: 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/pyexpat.so
and the poster specifically references his "libexpat.so.1" being out of place... He renamed the misplaced libexpat.so.1 to libexpat.so.1.backup causing the library dependency to check the next PATH location for libexpat.so.1...

I found that I do not have a "pyexpat.so", but I do have a "pyexpat.x86_64-linux-gnu.so" which seemed similar enough, so I ran:

Code: Select all

ldd /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
and for me, it returned:

Code: Select all

linux-vdso.so.1 =>  (0x00007fff417fb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4cc5817000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4cc5450000)
libexpat.so.1 => /usr/lib/plexmediaserver/libexpat.so.1 (0x00007f4cc521d000)
/lib64/ld-linux-x86-64.so.2 (0x0000559b8d587000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4cc5006000)
As you can see, one of those things is not like the others... I renamed /usr/lib/plexmediaserver/libexpat.so.1 to libexpat.so.1.backup, and now my "ldd /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so" reports:

Code: Select all

libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (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...
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: I broke my deluge-web :(

Post by Cas »

Nice investigative work! :-)
Post Reply