EmmettPeck / Pinebot

A Docker logfile listener in a Discord bot
2 stars 0 forks source link

List IndexError Exception when Getting Online Playercount #81

Open EmmettPeck opened 2 years ago

EmmettPeck commented 2 years ago


Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Unhandled exception in internal background task 'pass_message'.
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "/app/cogs/gamecog.py", line 826, in pass_message
    await ctx.send(embed=embed_message(server.message_queue.get_nowait()))
  File "/usr/lib/python3.10/site-packages/discord/abc.py", line 1065, in send
    data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,
  File "/usr/lib/python3.10/site-packages/discord/http.py", line 254, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.title: Must be 256 or fewer in length.```
EmmettPeck commented 2 years ago

If longer than 256 characters after parsing, format as embed content instead?

EmmettPeck commented 2 years ago

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 618, in _load_from_module_spec
    setup(self)
  File "/app/cogs/minecraft.py", line 227, in setup
    bot.add_cog(Minecraft(bot))
  File "/app/cogs/gamecog.py", line 50, in __init__
    self.servers = self.load_servers()
  File "/app/cogs/gamecog.py", line 471, in load_servers
    pl = self.get_player_list(server)
  File "/app/cogs/minecraft.py", line 118, in get_player_list
    player_max = int(response.split("max of")[1].split()[0])
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "//app/main.py", line 28, in <module>
    bot.load_extension(extension)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "/usr/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 623, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.minecraft' raised an error: IndexError: list index out of range