jellyfin / jellyfin-kodi

Jellyfin Plugin for Kodi
https://jellyfin.org
GNU General Public License v3.0
820 stars 111 forks source link

Crash in log filtering when a server is broadcasting address without protocol #734

Open deovrat opened 1 year ago

deovrat commented 1 year ago

Describe the bug I had two jellyfin servers running on LAN, one on synology docker and one on proxmox LXC. On trying to setup jellyfin for Kodi, it synced the media fine, but on trying to play anything will throw an error for second server ( Proxmox LXC )

To Reproduce

  1. Have two jellyfin instances running on LAN
  2. Add one of jellyfin server in plugin (will only repro with one of the instances )
  3. Try to play something after media is synced
  4. Error - Jellyfin error - see logs for more information

Expected behavior Media should play fine

Logs Added log file

Screenshots

System (please complete the following information):

Additional context I could fix problem by shutting down one of the jellyfin server ( synology ) on LAN.

It looks to me like the issue is that this line - https://github.com/jellyfin/jellyfin-kodi/blob/4d1da60154915a4d79cd0adb416590af966abd59/jellyfin_kodi/helper/loghandler.py#L47

was causing index out-of-bounds exception.

kodi_log.txt

oddstr13 commented 1 year ago

Looks like the server address field has been set incorrectly on one of your servers, triggering this issue.

// Found Servers:
[
  {'Address': 'http://10.0.0.8:8096', 'Id': '0162a5183b1840bd8e4387ea9920dcb4', 'Name': 'jellyfin', 'EndpointAddress': None}, 
  {'Address': '10.0.0.61', 'Id': '5abe7de62af74364b7838d906ed9601a', 'Name': 'deosingh-jf', 'EndpointAddress': None},
  {'Address': '10.0.0.61', 'Id': '5abe7de62af74364b7838d906ed9601a', 'Name': 'deosingh-jf', 'EndpointAddress': None}
]

Notice that Address doesn't include http(s):// which is a configuration error.

(This is still a bug in the addon tho)

oddstr13 commented 1 year ago
Traceback (most recent call last):
 File "./default.py", line 18, in <module>
   LOG.debug("--->[ default ]")
   ^^^^^^^^^
 File "./jellyfin_kodi/helper/lazylogger.py", line 17, in __getattr__
   from .loghandler import getLogger
 File "./jellyfin_kodi/helper/loghandler.py", line 130, in <module>
   __LOGGER.addHandler(LogHandler())
                       ^^^^^^^^^^^^
 File "./jellyfin_kodi/helper/loghandler.py", line 47, in __init__
   self.sensitive['Server'].append(server['address'].split('://')[1])
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range