Deluge on Android

Suggestions and discussion of future versions
Post Reply
alllexx
Member
Member
Posts: 30
Joined: Sat May 23, 2015 1:30 pm

Deluge on Android

Post by alllexx »

Has anyone tried to run Deluge on Android? Deluge from develop branch (20150922) I installed on my Asus TF-101 using my Optware-ng project (look here to learn how) gives this error:

Code: Select all

root@tf101:/data/local # deluged
root@tf101:/data/local # 12:04:21 [ERROR   ][deluge.core.rpcserver] Couldn't listen on localhost:58846: [Errno -2] Name or service not known.
and then forces my tablet into reboot.

I wonder if it is possible to get it to work with Android? Transmission works fine, but I like Deluge better :D Thanks
alllexx
Member
Member
Posts: 30
Joined: Sat May 23, 2015 1:30 pm

Re: Deluge on Android

Post by alllexx »

Hm, no, deluged does work, but somewhat unstable. It is started OK by Optware-ng init.d script, but trying to stop it causes a reboot. If I disable deluged init script and reboot, and try to launch it later manually, I get the same error as above:

Code: Select all

root@tf101:/data/local # deluged
root@tf101:/data/local # 12:29:53 [ERROR   ][deluge.core.rpcserver] Couldn't listen on localhost:58846: [Errno -2] Name or service not known.
and another reboot...
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Deluge on Android

Post by Cas »

That error will be coming from twisted or lower level, I can't think of anything in Deluge that should need altered for it work on Android.

Separate to your issue I notice there are no line numbers in non-dev mode logging, why is not very helpful...
alllexx
Member
Member
Posts: 30
Joined: Sat May 23, 2015 1:30 pm

Re: Deluge on Android

Post by alllexx »

Cas, thank you for your reply!

Here's error in dev mode:

Code: Select all

root@tf101:/data/local # deluged
root@tf101:/data/local # 13:27:28.708 [ERROR   ][deluge.core.rpcserver:355 ] Couldn't listen on localhost:58846: [Errno -2] Name or service not known.
and here're lines 348-357:

Code: Select all

        # Check for SSL keys and generate some if needed
        check_ssl_keys()

        try:
            reactor.listenSSL(port, self.factory, ServerContextFactory(), interface=hostname)
        except Exception as ex:
            log.info("Daemon already running or port not available..")
            log.error(ex)
            sys.exit(0)

Clearly, reactor.listenSSL(port, self.factory, ServerContextFactory(), interface=hostname) fails for some reason.

Sadly, now my tablet won't boot, stuck at boot animation. I only have access via Optware-ng's dropbear, which apparently starts before boot process hangs. But I can still tinker with it before doing a wipe, so please let me know if you have any ideas :) Thanks
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Deluge on Android

Post by Cas »

I wonder if localhost lookup is not working.

You could alter the log.error to log.exception and it should output the entire traceback, may or may not provide more info.
alllexx
Member
Member
Posts: 30
Joined: Sat May 23, 2015 1:30 pm

Re: Deluge on Android

Post by alllexx »

Cas,

Sorry for the delay. Here's the traceback:

Code: Select all

root@tf101:/data/local # deluged
root@tf101:/data/local # 14:33:33.794 [ERROR   ][deluge.core.rpcserver:355 ] Couldn't listen on localhost:58846: [Errno -2] Name or service not known.
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/deluge/core/rpcserver.py", line 352, in __init__
    reactor.listenSSL(port, self.factory, ServerContextFactory(), interface=hostname)
  File "/data/Optware-ng/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 522, in listenSSL
    port = self.listenTCP(port, tlsFactory, backlog, interface)
  File "/data/Optware-ng/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 495, in listenTCP
    p.startListening()
  File "/data/Optware-ng/lib/python2.7/site-packages/twisted/internet/tcp.py", line 990, in startListening
    raise CannotListenError(self.interface, self.port, le)
CannotListenError: Couldn't listen on localhost:58846: [Errno -2] Name or service not known.
Also, `nslookup localhost` works fine:

Code: Select all

root@tf101:/data/local # nslookup localhost
Server:    8.8.4.4
Address 1: 8.8.4.4 google-public-dns-b.google.com

Name:      localhost
Address 1: 127.0.0.1 localhost
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Deluge on Android

Post by Cas »

What is the contents of your /etc/hosts file? Have you asked any android developers about the issue? It is something in the configuration of the system so out with Deluge and Twisted.
alllexx
Member
Member
Posts: 30
Joined: Sat May 23, 2015 1:30 pm

Re: Deluge on Android

Post by alllexx »

My /etc/hosts used to be pretty long, since it contained blocked ad sites (and it did contain "127.0.0.1 localhost"). I then issued `echo "127.0.0.1 localhost" > /etc/hosts`, but it didn't help.

Honestly, I'm not sure whom to contact on this. Maybe, I should first try to run deluged on other firmwares/devices
Post Reply