Cannot click the "Add Torrent" button in Deluge GTK

General support for problems installing or using Deluge
Post Reply
eric90
New User
New User
Posts: 5
Joined: Sun Feb 02, 2014 6:22 am

Cannot click the "Add Torrent" button in Deluge GTK

Post by eric90 »

Hello, I have two computers that are both running OpenSUSE 13.1 and Deluge 1.3.5. One is running the deluged daemon as a server, the other is running deluge-gtk.

Deluge-gtk successfully connects to the daemon on the server. However, I cannot click the Add Torrent button. It is not grayed out, it is clickable, but nothing happens when I click on it. Here is the output:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/protocols/policies.py", line 120, in dataReceived
    self.wrappedProtocol.dataReceived(data)
  File "/usr/lib/python2.7/site-packages/deluge/ui/client.py", line 183, in dataReceived
    d.callback(request[2])
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 382, in callback
    self._startRunCallbacks(result)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 577, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/site-packages/deluge/ui/gtkui/addtorrentdialog.py", line 186, in _on_config_values
    self.set_default_options()
  File "/usr/lib/python2.7/site-packages/deluge/ui/gtkui/addtorrentdialog.py", line 461, in set_default_options
    self.core_config["download_location"])
exceptions.TypeError: Gtk.Entry.set_text() argument 1 must be string, not None
[ERROR   ] 22:24:58 client:395 RPCError Message Received!
--------------------------------------------------------------------------------
RPCRequest: core.get_free_space()
--------------------------------------------------------------------------------
  File "/usr/lib/python2.7/site-packages/deluge/core/rpcserver.py", line 298, in dispatch
    ret = self.factory.methods[method](*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/deluge/core/core.py", line 817, in get_free_space
    return deluge.common.free_space(path)
  File "/usr/lib/python2.7/site-packages/deluge/common.py", line 522, in free_space
    if not os.path.exists(path):
  File "/usr/lib/python2.7/genericpath.py", line 18, in exists
    os.stat(path)

TypeError: coercing to Unicode: need string or buffer, NoneType found
--------------------------------------------------------------------------------
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
Failure: deluge.ui.client.DelugeRPCError: <deluge.ui.client.DelugeRPCError object at 0x3a68590>
Why is this happening and how can I fix it?
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by Cas »

Can you go to your machine running deluged and using deluge-console check `config download_location`
eric90
New User
New User
Posts: 5
Joined: Sun Feb 02, 2014 6:22 am

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by eric90 »

Download_location is set to 'None' .

I tried to set it to a path with 'config -s download_location /path/to/location' and I get an error.

Code: Select all

'Command' object has no attribute 'config'
Traceback (most recent call last):
    ret = self._commands[cmd].handle(*args, **options.__dict__)
    return self._set_config(*args, **options)
    self.config.write("Configuration value provided has incorrect type.")      
AttributeError: 'Command' object has no attribute 'config'
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by Cas »

Can you provide the actual command and path used to generate that error

Also on your server can you get the result of these commands:

Code: Select all

python -c "import os; print os.environ.get('HOME')"
python -c "from os.path import expanduser; print expanduser('~')"
python -c "import os; from xdg.BaseDirectory import xdg_config_home; print os.path.exists(os.path.join(xdg_config_home, 'user-dirs.dirs'))"
eric90
New User
New User
Posts: 5
Joined: Sun Feb 02, 2014 6:22 am

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by eric90 »

The actual command is

Code: Select all

# deluge-console
config -s download_location /var/nfs/Downloads
The output of the following commands:

Code: Select all

# python -c "import os; print os.environ.get('HOME')"
/root

Code: Select all

# python -c "from os.path import expanduser; print expanduser('~')"
/root

Code: Select all

# python -c "import os; from xdg.BaseDirectory import xdg_config_home; print os.path.exists(os.path.join(xdg_config_home, 'user-dirs.dirs'))"
False
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by Cas »

Ok the console error is due to download_location being set to None so can ignore that for now. What is puzzling though is how the download_location was set the None as that is causing all the trouble here.

Could you check what 'torrentfiles_location' is set to.

It would also be helpful if could you stop deluged, backup core.conf and then delete it (basically move it somewhere) so that after restarting deluged a new one is created and see what value download_location is.
eric90
New User
New User
Posts: 5
Joined: Sun Feb 02, 2014 6:22 am

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by eric90 »

Torrentfiles_location is set to 'None' .

After deleting core.conf, download_location is still 'None' .
eric90
New User
New User
Posts: 5
Joined: Sun Feb 02, 2014 6:22 am

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by eric90 »

Manually changing these settings does not seem to do anything different.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by Cas »

It should be fixed by manually changing it but I am trying to work out why it's being set to None in the first place as it is clearly a bug that some users are facing except I can't replicate it.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Cannot click the "Add Torrent" button in Deluge GTK

Post by Cas »

Are you happy to modify the source code to trace this bug?

If so can you find deluge/common.py:

Code: Select all

locate deluge/common.py
and add the following log line to it (ensure indent is 8 spaces not tabs):

Code: Select all

--- a/deluge/common.py
+++ b/deluge/common.py
@@ -188,6 +188,7 @@ def get_default_download_dir():
         except IOError:
             pass
 
+        log.error("%s, %s", os.environ.get("HOME"), os.path.join(os.path.expanduser("~")))
         return os.environ.get("HOME")
 
 def windows_check():
You may need to remove the core.conf as before but when you run deluged you should see log messages.

If you see (None,"/root") this would be the fix:

Code: Select all

--- a/deluge/common.py
+++ b/deluge/common.py
@@ -188,7 +186,7 @@ def get_default_download_dir():
         except IOError:
             pass
 
-        return os.environ.get("HOME")
+        return os.path.join(os.path.expanduser("~"), 'Downloads')
 
 def windows_check():
     """
Post Reply