[Deluge] #3329: builtins.KeyError: 'label/label.js

18 views
Skip to first unread message

Deluge

unread,
Nov 29, 2019, 4:26:50 AM11/29/19
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
----------------------------+--------------------
Reporter: jools772 | Type: bug
Status: new | Priority: minor
Milestone: needs verified | Component: Web UI
Version: 2.0.3 | Keywords:
----------------------------+--------------------
web.Server Traceback (most recent call last):
builtins.KeyError: 'label/label.js'
/usr/lib/python3/dist-packages/twisted/web/server.py:199 in process
198 self._encoder = encoder
199 self.render(resrc)
200 except:
/usr/lib/python3/dist-packages/twisted/web/server.py:259 in render
258 try:
259 body = resrc.render(self)
260 except UnsupportedMethod as e:
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:629 in render
628
629 scripts = component.get('Scripts').get_scripts(script_type)
630 scripts.insert(0, 'gettext.js')
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:371 in get_scripts
370 # A folder resource is enclosed in a tuple.
371 if isinstance(_scripts[path], tuple):
372 filepath, recurse = _scripts[path]
builtins.KeyError: 'label/label.js'

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329>
Deluge <https://deluge-torrent.org/>
Deluge Project

Deluge

unread,
Dec 6, 2019, 6:19:49 AM12/6/19
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
-----------------------+----------------------------
Reporter: jools772 | Owner:

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Web UI | Version: 2.0.3
Resolution: | Keywords:
-----------------------+----------------------------

Old description:

> web.Server Traceback (most recent call last):
> builtins.KeyError: 'label/label.js'
> /usr/lib/python3/dist-packages/twisted/web/server.py:199 in process
> 198 self._encoder = encoder
> 199 self.render(resrc)
> 200 except:
> /usr/lib/python3/dist-packages/twisted/web/server.py:259 in render
> 258 try:
> 259 body = resrc.render(self)
> 260 except UnsupportedMethod as e:
> /usr/lib/python3/dist-packages/deluge/ui/web/server.py:629 in render
> 628
> 629 scripts = component.get('Scripts').get_scripts(script_type)
> 630 scripts.insert(0, 'gettext.js')
> /usr/lib/python3/dist-packages/deluge/ui/web/server.py:371 in get_scripts
> 370 # A folder resource is enclosed in a tuple.
> 371 if isinstance(_scripts[path], tuple):
> 372 filepath, recurse = _scripts[path]
> builtins.KeyError: 'label/label.js'

New description:

{{{


web.Server Traceback (most recent call last):
builtins.KeyError: 'label/label.js'
/usr/lib/python3/dist-packages/twisted/web/server.py:199 in process
198 self._encoder = encoder
199 self.render(resrc)
200 except:
/usr/lib/python3/dist-packages/twisted/web/server.py:259 in render
258 try:
259 body = resrc.render(self)
260 except UnsupportedMethod as e:
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:629 in render
628
629 scripts = component.get('Scripts').get_scripts(script_type)
630 scripts.insert(0, 'gettext.js')
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:371 in get_scripts
370 # A folder resource is enclosed in a tuple.
371 if isinstance(_scripts[path], tuple):
372 filepath, recurse = _scripts[path]
builtins.KeyError: 'label/label.js'
}}}

--

Comment (by Cas):

Please provide more information as to how you encountered this issue

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329#comment:1>

Deluge

unread,
Dec 6, 2019, 6:52:11 AM12/6/19
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
-----------------------+----------------------------
Reporter: jools772 | Owner:
Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Web UI | Version: 2.0.3
Resolution: | Keywords:
-----------------------+----------------------------

Comment (by jools772):

It happens each time I open the web page for the web ui, after ther daemon
has been running for some time. It happened now again, and it's resolved
by restarting deluge-web.service. There is really no other context, except
that you open the web ui page.

Logs: deliuge-web: https://pastebin.com/rCk9EaRH

The error log also appears on the web ui page when trying to load it.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329#comment:2>

Deluge

unread,
Dec 30, 2019, 12:02:45 PM12/30/19
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
-----------------------+----------------------------
Reporter: jools772 | Owner:
Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Web UI | Version: 2.0.3
Resolution: | Keywords:
-----------------------+----------------------------

Comment (by jools772):

Here's the error written out since the pastebin expired:

web.Server Traceback (most recent call last):
builtins.KeyError: 'label/label.js'
/usr/lib/python3/dist-packages/twisted/web/server.py:199 in process
198 self._encoder = encoder
199 self.render(resrc)
200 except:
/usr/lib/python3/dist-packages/twisted/web/server.py:259 in render
258 try:
259 body = resrc.render(self)
260 except UnsupportedMethod as e:
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:629 in render
628
629 scripts = component.get('Scripts').get_scripts(script_type)
630 scripts.insert(0, 'gettext.js')
/usr/lib/python3/dist-packages/deluge/ui/web/server.py:371 in get_scripts
370 # A folder resource is enclosed in a tuple.
371 if isinstance(_scripts[path], tuple):
372 filepath, recurse = _scripts[path]
builtins.KeyError: 'label/label.js'

The error is pretty obvious: the path 'label/label.js' isn't found in the
list '_scripts'. See here:

https://git.deluge-torrent.org/deluge/tree/deluge/ui/web/server.py#n371

The fix is to add one check:

if path in _scripts:

Would you please do this. I get the error quite frequently and it crashes
the whole deluged daemon because of this.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329#comment:3>

Deluge

unread,
Dec 30, 2019, 12:26:20 PM12/30/19
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
-----------------------+----------------------------
Reporter: jools772 | Owner:
Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Web UI | Version: 2.0.3
Resolution: | Keywords:
-----------------------+----------------------------

Comment (by jools772):

The context is that one of the torrents is probably missing its label. I
found out by looking at the count of torrents in filters window:
http://prntscr.com/qhlqe2

The count of the totals didn't mwatch the number of unfiltered torrents,
and I re-added labels to those all torrents manually.

It could be many things that lead to a missing label, but it would be good
if the logs told us what happens instead of crashing. Maybe add that check
and also log the name of the culprit in case there is a missing label.
Could probably do this myself if I knew how to check out from trac.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329#comment:4>

Deluge

unread,
Jan 3, 2020, 2:56:01 PM1/3/20
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
-----------------------+-------------------
Reporter: jools772 | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0.4

Component: Web UI | Version: 2.0.3
Resolution: | Keywords:
-----------------------+-------------------
Changes (by Cas):

* milestone: needs verified => 2.0.4


Comment:

Unfortunately I cannot replicate the issue however the problem you are
reporting is a server script lookup issue, separate from actual torrents.

Looking at the code there should be no reason for `order` path value not
be in the `scripts` dict but your error and forum users reporting it mean
we will need to catch it, even if we don't understand it.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329#comment:5>

Deluge

unread,
Jul 25, 2021, 12:37:01 PM7/25/21
to delug...@googlegroups.com
#3329: builtins.KeyError: 'label/label.js
-----------------------+-------------------
Reporter: jools772 | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.0.4

Component: Web UI | Version: 2.0.3
Resolution: | Keywords:
-----------------------+-------------------

Comment (by Cas):

I think this might be the other way around that the keyerror is because
the daemon has crashed since the label plugin scripts would not be
available to the web server

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329#comment:6>

Reply all
Reply to author
Forward
0 new messages