--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3329>
Deluge <https://deluge-torrent.org/>
Deluge Project
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>
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>
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>
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>
* 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>
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>