Opened 5 years ago

Closed 3 years ago

#3309 closed bug (Fixed)

TypeError: '>' not supported between instances of 'NoneType' and 'str'

Reported by: kuraga Owned by:
Priority: blocker Milestone: 2.0.4
Component: GTK UI Version: 2.0.3
Keywords: Cc: kuraga333@…, scott@…

Description

At start:

TypeError: '>' not supported between instances of 'NoneType' and 'str'
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/deluge/ui/gtk3/listview.py", line 233, in stabilized
    result = sort_func(model, iter1, iter2, data)
  File "/usr/lib64/python3.6/site-packages/deluge/ui/gtk3/torrentview.py", line 106, in progress_sort
    return cmp(state1, state2)
  File "/usr/lib64/python3.6/site-packages/deluge/ui/gtk3/common.py", line 45, in cmp
    return (x > y) - (x < y)

Seems like number of this messages correlates with number of torrents...

Change History (11)

comment:1 Changed 4 years ago by milto

  • Component changed from Unknown to GTK UI

I have the same error as kuraga, I report here the result of my investigation.

Problem

The list of torrents takes time to load at startup with the current version of Deluge 2.0.3 from the offical ppa deluge-stable installed for Ubuntu 1.04 Bionic.

The problem seems located in the GTK UI component of Deluge and it leads to too many open files error. It seems to be a problem of passing a null parameter to the cmp function in deluge/ui/gtk3/common.py.

I have around 60 torrents, seeded correctly with Deluge 1.3 or Transmission.

Reproduce error

After a successful fresh install of Deluge 2.0 and a first start in standalone mode without any error, I add torrents in seed manually via menu -> File -> Add Torrent everything seems right so far. Then I close and restart Deluge. It starts with an empty list of torrent and it takes several seconds to load them. It may sometimes crash at this point or just run slowly and starts to use more and more CPU ressources.

To track the problem you can watch in your system log file (personally I use journalctl) or just start Deluge in terminal and see the error.

This error is repeated houndreds of times

Error: Failed to load processor console
No macro or processor named 'console' found

And finally the last line of error is:

Error: Failed to load processor console
No macro or processor named 'console' found

Diagnostic

I have installed the package deluge 2.0.3-2~201906121747~ubuntu18.04.1 provided by the ppa:deluge-team/stable for Ubuntu 18.04 Bionic, Python 3.6 is used to run Deluge with libtorrent: 1.1.5.0

Prior to the installation of Deluge 2.0.3, I have purged all packages related to Deluge 1.3 from the universe repository of Ubuntu: deluge deluge-common deluge-gtk and moved my ~/.config/deluge

I run the command deluge -L=debug -l=deluge_debug --profile=deluge_profile &! to report information about the bug. The following are extracts from deluge_debug that might help to track the problem.

Around line 397 and repeated sometimes in the rest of log after:

Error: Failed to load processor console
No macro or processor named 'console' found

Something weird happens, around line 516 everything seems fines:

Error: Failed to load processor console
No macro or processor named 'console' found

in between all torrent seems to be loaded correctly and latter:

Error: Failed to load processor console
No macro or processor named 'console' found

however it is a bit contradictory with the message received in standard error output:

Error: Failed to load processor console
No macro or processor named 'console' found

In the end the log is full of:

Error: Failed to load processor console
No macro or processor named 'console' found
Version 1, edited 4 years ago by milto (previous) (next) (diff)

comment:2 Changed 4 years ago by milto

  • Milestone changed from needs verified to 2.x
  • Priority changed from minor to blocker

comment:3 Changed 4 years ago by Cas

  • Milestone changed from 2.x to 2.0.4

There is a related ticket #3330 which has a TypeError comparing None and None so the issue is due to string type checking by Python 3. So the cmp function needs to be able to handle either or both values being None by converting to appropriate type before comparison.

comment:4 Changed 4 years ago by DanBit

Is there any update on this?

comment:5 Changed 4 years ago by milto

I hoped there would be an update since this error makes Deluge 2 totally unusable however I lost hope and stick with Deluge 1.3 that it is stable and functional.

comment:6 Changed 4 years ago by jools772

https://portingguide.readthedocs.io/en/latest/comparisons.html

Here's a guide in how to port python 2 comparison operations to python 3.

comment:7 Changed 4 years ago by sremick

Another person bitten by this. I don't understand how I triggered it. Deluge had been working fine, I messed some things up w/ Python then fixed that, but now Deluge won't start. Mine is more like ticket 3330 where I'm getting "TypeError?: '>' not supported between instances of 'NoneType?' and 'NoneType?'" like that user.

Is there even a workaround or hack so I can become functional again in the meantime?

comment:8 Changed 4 years ago by sremick

  • Cc scott@… added

comment:9 Changed 4 years ago by p4nch1

Same error on my system, deluge closes itself after a lot of those "TypeError?" messages.

Info: deluge 2.0.3 | libtorrent: 1.1.13.0 | Python: 3.8.2 | OS: Linux Mint 20 MATE

comment:10 Changed 3 years ago by revlev

This got fixed in commit 23a48dd.

comment:11 Changed 3 years ago by Cas

  • Resolution set to Fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.