jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Deluge is stopping after a while

Thu Sep 25, 2014 3:56 am

Hi,

As i mentioned in an another thread, I am trying to setup deluge on my PI. I am using this article as a reference:

http://www.howtogeek.com/142044/how-to- ... rrent-box/

The last (hopefully) problem I am facing is that the Deluged service seems to be stopping after a few minutes (my guess is after 20-30 minutes). The deluge-web process is still running after the deluged service disappears from the Task Manager. If anyone could point me into the right direction that would be awesome. I am not even sure how to start debugging the issue.

I've tried to find an answer online, but I couldn't find anything helpful so far. Thanks for reading!

EDIT: The issue seems to occur only after reboot, when the service is started as a daemon. I've started deluge manually and it's working for an hour or two without issues.

EDIT2: I've posted the same question in the deluge forum: http://forum.deluge-torrent.org/viewtop ... =7&t=48509

jokob
Last edited by jokob on Sat Sep 27, 2014 2:38 am, edited 1 time in total.

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Thu Sep 25, 2014 10:03 am

I'm facing exactly the same issue.

I've installed Deluge since a few days, and this issue keeps cropping up.

The Deluge daemon just stops randomly... sometimes after a few hours, sometimes after a few minutes.

I have to be constantly checking via the web UI, and manually start the daemon each time I find it stopped.

There is no clear solution available online for this issue. I already have the latest deluge version.

Can some expert on this forum help please ? Thanks.

User avatar
RaTTuS
Posts: 10378
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Deluge is stopping after a while

Thu Sep 25, 2014 10:14 am

depends if it crashes or hangs or whatever
does it report errors in the logs ?

http://stackoverflow.com/questions/2987 ... g-on-linux <- may help if you want to restart it
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Thu Sep 25, 2014 11:22 am

RaTTuS wrote:depends if it crashes or hangs or whatever
does it report errors in the logs ?
Thank you.

Where can one find the said logs?

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Thu Sep 25, 2014 12:13 pm

It has become impossible to download anything.

The deluge daemon keeps stopping every few minutes.

I don't want to return to my windows PC and uTorrent (which worked for years flawlessly).

I'm not a Linux person, but I wanted to give Raspberry Pi/Deluge combo a shot. So far it has been utterly frustrating. .

Maybe I should try 'transmission' or other options ?

Sorry for this un-constructive post ... needed to let off steam...

User avatar
RaTTuS
Posts: 10378
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Deluge is stopping after a while

Thu Sep 25, 2014 1:14 pm

I dunno I've never used it
does
cat /var/log/syslog say anything useful

start it via
deluged -d [-L <loglevel>] [-l <logfile>]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Re: Deluge is stopping after a while

Fri Sep 26, 2014 1:02 am

Hi RaTTuS,

Thanks for taking the time to reply. I checked the syslog and this is the output if I grep "deluge" entries:

Code: Select all

[email protected] ~ $ grep -r "deluge" /var/log/syslog 
Sep 24 11:31:43 raspberrypi /USR/SBIN/CRON[1982]: (root) CMD (/home/pi/commands/deluged)
Sep 24 11:34:43 raspberrypi /USR/SBIN/CRON[1990]: (root) CMD (deluged)
Sep 24 11:34:43 raspberrypi /USR/SBIN/CRON[1991]: (root) CMD (deluge-web)
Sep 24 11:42:19 raspberrypi /USR/SBIN/CRON[1978]: (root) CMD (/home/pi/commands/deluged)
Sep 24 11:48:13 raspberrypi /USR/SBIN/CRON[1979]: (root) CMD (/usr/bin/deluged)
Sep 24 11:54:47 raspberrypi /USR/SBIN/CRON[1976]: (root) CMD (/usr/bin/deluged)
Sep 24 12:05:21 raspberrypi /USR/SBIN/CRON[1976]: (root) CMD (/usr/bin/deluged)
Sep 25 01:09:04 raspberrypi /USR/SBIN/CRON[1988]: (root) CMD (/usr/bin/deluged)
Sep 25 01:40:36 raspberrypi /USR/SBIN/CRON[1973]: (root) CMD (/usr/bin/deluged)
Sep 25 01:40:37 raspberrypi /USR/SBIN/CRON[1964]: (root) CMD (/usr/bin/deluged)
Sep 25 03:00:30 raspberrypi /USR/SBIN/CRON[1977]: (root) CMD (/usr/bin/deluged)
Sep 25 03:09:15 raspberrypi /USR/SBIN/CRON[1983]: (root) CMD (/usr/bin/deluged)
Sep 25 05:40:26 raspberrypi /USR/SBIN/CRON[1979]: (root) CMD (/usr/bin/deluged)
Which I don't think is useful :) I am not too experienced with linux so altering the daemon to run in debug mode seems a bit over my head right now. I'll give the restart approach a try. Thanks for linking it!

@roycejp: Yeah, it gets a bit frustrating to setup, but it's a hacking platform for a few bucks, so you have to invest some time to get things running. In general, I think the issues are more deluge oriented than raspberry PI, so maybe we are posting in the incorrect forum too and should be posting to the deluge developer forum :)

jokob

jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Re: Deluge is stopping after a while

Fri Sep 26, 2014 7:30 am

Alright, getting closer hopefully, but I again need a bit help. I've created a script for checking if Deluge is running and if not, starting it up again:

Code: Select all

#!/bin/bash
#make-run.sh
#make sure a process is always running.

process="deluged"
makerun="/usr/bin/deluged -p 58846 -L debug -l /home/pi/deluge.log"

date > /home/pi/deluge_sh.log

if ps ax | grep -vw grep | grep -w $process > /dev/null
        then
		echo "exiting" >> /home/pi/deluge_sh.log
                exit
        else
		echo "trying to run:" $makerun >> /home/pi/deluge_sh.log
        $makerun &
        fi
exit
I placed this script into a file called deluged_job.sh under /home/pi/commands and registered it as a cron job:

Code: Select all

*/10 * * * * /home/pi/commands/deluged_job.sh
So it will be executed every 10 minutes. I made the job file executable .

This script checks if deluged is running and if not, it is starting it up again. It is also starting deluged in debug mode and creating 2 log files under /home/pi, one for the script and one for deluge. This is all working.Now the issue is that the deluge process runs on Local address 127.0.0.0:<port> instead of 0.0.0.0:<port>. At least this seems to be the issue. Does anyone know how to force it to run on 0.0.0.0:<port>?

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Fri Sep 26, 2014 8:44 am

Hi,
As advised, I started deluged with logging to console as well as file (see below) .
After a while, as expected, deluged crashed with a segmentation fault.

Code: Select all

~ $ deluged -d -L critical -l ~/dlgLog.txt
Segmentation fault
Also, the log file has the lone following line:

Code: Select all

[ERROR   ] 14:01:33 authmanager:140 Your auth file is malformed: Incorrect number of fields!
@raTTus, Does this information help?
@jokob, could you do this and check ?
The cron solution is helpful, but we really need to find the root of this crash

Edit: After a brief search, I came upon this thread:
http://www.raspberrypi.org/forums/viewt ... 63&t=50459
.

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Fri Sep 26, 2014 11:26 am

I also found this blog, which deals with the exact same symptoms.
http://blog.backslasher.net/raspberry-p ... fault.html

I've made the configuration changes as suggested therein, so I'll report after a while if it worked ... ;)

jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Re: Deluge is stopping after a while

Fri Sep 26, 2014 3:27 pm

Hi,

Thanks for the follow up! I think we are now facing different issues :( I am not getting any seg faults in my debug output.

jokob

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Sat Sep 27, 2014 8:53 am

Jakob,
Did you log to console (-d) ?

I got the segmentation fault message on the console only.

It was not there in my log file!

jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Re: Deluge is stopping after a while

Sat Sep 27, 2014 9:07 am

I am only logging to the file, but I'll give it a try, thanks!

jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Re: Deluge is stopping after a while

Sat Sep 27, 2014 9:36 am

yep, you are right, it shows me a segmentation fault this way :(

I'll try your suggestion, as mentioned by the linked article to see if it helps:

Code: Select all

After editing the file ~/.config/deluge/core.conf and changing these settings:

"enc_level" from 2 to 0
"enc_prefer_rc4" from true to false
Everything seems to be normal now
Lets see if this helps... did you encounter a crash after you've applied this workaround?

roycejp
Posts: 19
Joined: Sun Oct 27, 2013 7:48 am

Re: Deluge is stopping after a while

Sat Sep 27, 2014 1:27 pm

The changes to the configuration file seem to have helped.

Deluge is running today for nearly 6 hrs without a crash. :D

jokob
Posts: 10
Joined: Wed Sep 24, 2014 11:59 am

Re: Deluge is stopping after a while

Thu Oct 02, 2014 5:44 am

Yes, you were right, running for 24+ hours without issues. Thank you all for your help! ;)

crusador
Posts: 1
Joined: Sat Dec 06, 2014 2:09 pm

Re: Deluge is stopping after a while

Sat Dec 06, 2014 2:28 pm

Eventually, I gave up trying to fix this problem and applied the following workaround:

Disabled deluge-daemon service

Code: Select all

sudo update-rc.d -f deluge-daemon remove
Created a shell file - deluge.sh

Code: Select all

#!/bin/bash
while [ 1 ]; do deluged -d; echo "Failure at $(date)" >> ~/deluge.errors; done
# NOTE: Make sure you aren't running deluged as a daemon(without "-d"), 
# else this loop will keep on spawning deluged processes until oblivion ;)
Added crontab entries:

Code: Select all

@reboot /path/to/deluge.sh
@reboot deluge-web
This sweetly spawns the deluged process immediately after it crashes.

PS: Actually, my cron just executes one shell file which creates a tmux session with deluged and deluge-web running in different windows.

oobtim
Posts: 15
Joined: Sun Jul 01, 2012 10:52 am
Location: Chippenham, UK

Re: Deluge is stopping after a while

Sun Dec 28, 2014 7:17 pm

For my penny's worth I was beating my head against the wall with Deluge not downloading anything. Edited the core.conf file as suggested above and Deluge was up and running within seconds of restart! Thank you! :D

ekimyar
Posts: 5
Joined: Fri Feb 06, 2015 1:11 am

Re: Deluge is stopping after a while

Mon Mar 02, 2015 12:20 am

It looks like this:

- "enc_level" from 2 to 0
- "enc_prefer_rc4" from true to false

would disable encryption? Not all of my downloads are strictly legal or approved of by my ISP, so I'd prefer to keep the traffic encrypted.

I just use a cronjob to keep it running. Unfortunately none of the ones I've seen online actually worked with my setup, so I used [[ and regex to see if deluge-console "info" shows an error. If so, run deluged again. Working so far.

Code: Select all

  #!/bin/bash
   ## the idea is to use deluge-console to check deluged status and restart
   deluge_status=$(deluge-console "info")
   ## try to figure out if deluged is refusing connections,if so run deluged
   if [[ $deluge_status =~ ^Failed\ to\ connect ]]; then
       deluged && "$(date)" > /home/pi/log.txt; else
       echo "it's working"
   fi

User avatar
Gravesy
Posts: 78
Joined: Sat Feb 07, 2015 7:12 am
Location: The Netherlands

Re: Deluge is stopping after a while

Wed Mar 04, 2015 5:27 am

I'd suggest simply building Deluge from source, and trying the latest build.
I've had it running for a few hours now, so far, no segfaults...
So fingers crossed that it'll keep on working, and that it will work for others as well.

As to how, it's really rather easy.
Hell, i must admit i was so utterly lazy about it i just googled a guide...
This is the guide i used : http://www.onepitwopi.com/raspberry-pi/ ... pberry-pi/
All you need to do is change the download adress to that of the tarbal for 3.1.11 and change the numbers for the version where appropriate.
Don't use his install script though, you'll be running 3.1.6 if you do.

User avatar
Gravesy
Posts: 78
Joined: Sat Feb 07, 2015 7:12 am
Location: The Netherlands

Re: Deluge is stopping after a while

Wed Mar 04, 2015 7:51 pm

Quick update, it worked for a total of 23 hours...
Then i got a segfault and the system decided to refuse to even halt or reboot.
Oh well, it was worth a try.

jtamaska
Posts: 1
Joined: Fri Mar 27, 2015 7:53 am

Re: Deluge is stopping after a while

Fri Mar 27, 2015 7:56 am

Hi,

is there any update on the issue? I tried turning the encryption off but did not solve the problem for me. It is getting really annoying :(

DanielJF
Posts: 6
Joined: Sat May 16, 2015 3:00 pm
Location: Juiz de Fora - Brazil

Re: Deluge is stopping after a while

Sat May 16, 2015 3:18 pm

Hi everyone was having the same problem and solved installing the latest version of the Deluge, the easiest way to install the latest version was as follows:
I changed the sources.list including the following repositories:
deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
It includes key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
Install Deluge, the libtorrent continues the old but solved problems.

Zack117
Posts: 1
Joined: Sun May 17, 2015 7:34 pm

Re: Deluge is stopping after a while

Sun May 17, 2015 7:41 pm

DanielJF wrote:Hi everyone was having the same problem and solved installing the latest version of the Deluge, the easiest way to install the latest version was as follows:
I changed the sources.list including the following repositories:
deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
It includes key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
Install Deluge, the libtorrent continues the old but solved problems.
Thanks for your effort man!

I'm still a linux beginner so my question will be rather simplistic: Are those alle the commands I need in order to update deluge and hopefully get rid of this crashing issue? And after doing that, will my deluge work seemlessly like it did before? Not having to reconfigure, re-adding the torrents from before etc. all over again?

Thanks in advance for the response.

DanielJF
Posts: 6
Joined: Sat May 16, 2015 3:00 pm
Location: Juiz de Fora - Brazil

Re: Deluge is stopping after a while

Sun May 17, 2015 8:53 pm

Zack117 wrote:
DanielJF wrote:Hi everyone was having the same problem and solved installing the latest version of the Deluge, the easiest way to install the latest version was as follows:
I changed the sources.list including the following repositories:
deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
It includes key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
Install Deluge, the libtorrent continues the old but solved problems.
Thanks for your effort man!

I'm still a linux beginner so my question will be rather simplistic: Are those alle the commands I need in order to update deluge and hopefully get rid of this crashing issue? And after doing that, will my deluge work seemlessly like it did before? Not having to reconfigure, re-adding the torrents from before etc. all over again?

Thanks in advance for the response.
Hello Zack, the commands to upgrade are as follows:

sudo nano /etc/apt/sources.list

At the end of the file we include the lines:

deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu precise main

To save "ctrl + o" and to close "ctrl + x"

To include the server key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C

Now update repositories:

sudo apt-get update

We updated the Deluge:

sudo apt-get install deluged

I made this way and has more than 48 hours have not crash Deluge and can update you do not need remake the settings and not include the torrents again.

Return to “Troubleshooting”