broken config - python etc errors

General support for problems installing or using Deluge
Post Reply
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

broken config - python etc errors

Post by cbrace »

Hi all,

I am brand new to deluge. Yesterday I decided to switch from transmission to deluged on my seedbox. I migrated some torrents and got everything working fine, but just now I broke something.

Part of the problem is that there seems to be a small bug in the FreeBSD port. The init script looks for the
PID in the standard location under FreeBSD (/var/run), but the default deluged location appears to be the config dir. In any case, the standard service stop/restart commands don't work.

To get around this I was manually killing the process and this seems to have corrupted my setup. Maybe this issue? Terminating deluge leaves it in an inconsistent state.

Now when I start deluged I get a several screens of the same Python error in terminal and several error lines in the log. The process dies within 30s or so.

Can anyone suggest a way forward here? Thanks in advance

Code: Select all

Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line 103, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line 86, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 205, in doRead
    return self._dataReceived(data)
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 211, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/local/lib/python2.7/site-packages/twisted/protocols/basic.py", line 571, in dataReceived
    why = self.lineReceived(line)
  File "/usr/local/lib/python2.7/site-packages/twisted/web/http.py", line 567, in lineReceived
    self.handleEndHeaders()
  File "/usr/local/lib/python2.7/site-packages/twisted/web/client.py", line 145, in handleEndHeaders
    self.factory.gotHeaders(self.headers)
  File "/usr/local/lib/python2.7/site-packages/deluge/httpdownloader.py", line 89, in gotHeaders
    new_file_name = str(headers["content-disposition"][0]).split(";")[1].split("=")[1]
exceptions.IndexError: list index out of range

Code: Select all

$ tail -50 /var/tmp/deluged.log 
[ERROR   ] 14:08:09 torrentmanager:1147 on_alert_fastresume_rejected: ***************** fast resume rejected. stat(/mnt/disk1/***********): mismatching file timestamp

Code: Select all

$ freebsd-version
12.0-RELEASE-p2

Code: Select all

$ deluged -v
deluged: 1.3.15
libtorrent: 1.1.10.0
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: broken config - python etc errors

Post by cbrace »

(As an aside: I discovered the init bug in the course of trying to get a torrent completion script working with the Execute plugin. I created simple bash script, tested it, and it worked fine. But it wasn't being triggered. I had read that the daemon needed to be restarted for the plugin to take effect, so of course I did that, or at least I thought I did. After poking around a bit, I realized that the init file restart command wasn't working. Once I actually killed the process and restarted it, deluged started executing my script. But in the course of trying to come up with a workaround for the init problem, I managed to break something.)
Shryp
Moderator
Moderator
Posts: 521
Joined: Mon Apr 20, 2015 10:20 pm

Re: broken config - python etc errors

Post by Shryp »

Can you just try moving your config files to a backup folder and seeing if it works with a clean config?
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: broken config - python etc errors

Post by cbrace »

Sure, I could do that, but that is for my taste way too much the windows way of doing things. Reboot, reinstall, etc. It might well work, but then no one is any way the wiser. Not the devs, not me. What's to prevent it from happening again? Thanks, but I prefer a slightly more analytical, more diagnostic approach.

Anyone?
Shryp
Moderator
Moderator
Posts: 521
Joined: Mon Apr 20, 2015 10:20 pm

Re: broken config - python etc errors

Post by Shryp »

Have you tried looking at the various config files in a text editor and looking to see if any of them are cut off?

If you copy the current ones to a backup folder then you could create fresh ones and compare the two.
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: broken config - python etc errors

Post by cbrace »

Thanks for your suggestions. There are quite a few files in the config directory, as I'm sure you know Creating a new config dir may be my only option, but would rather not go that route as I have already imported some 200 torrents.
Shryp
Moderator
Moderator
Posts: 521
Joined: Mon Apr 20, 2015 10:20 pm

Re: broken config - python etc errors

Post by Shryp »

If you delete everything, but the state folder in the config folder you will reset all settings, but keep the torrents. Copy a backup of the folder before messing with it just in case though.
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: broken config - python etc errors

Post by cbrace »

I tried several attempts at a new config, also using the existing state dir but that didn't work.

In the end I ended up starting again completely from scratch with a fresh config dir and default settings. I then copied all 200 or so torrent files from the old state dir to a temporary dir, set that for autoadd in pause state.

After they were sucked in, I selected all and did a forced recheck on every one of them. It took a quite few hours for deluge to verify them all, but once that was done I could resume seeding them again.

I'm sure this was a one-time hiccup due to my lack of experience, and I will not be doing any wild experiments with deluge any time soon :)

Will also be making daily backups of the deluge config dir just to be on the safe side
Post Reply