CSSS / wall_e

CSSS Discord Bot (Wall-E)
GNU General Public License v3.0
19 stars 19 forks source link

discord.app_commands.errors.CommandInvokeError: Command 'unban' raised an exception: FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/zoneinfo/Canada/Pacific' #498

Closed csss-admin closed 8 months ago

csss-admin commented 8 months ago
2024-01-15 22:05:54 = ERROR = Ban = Encountered exception in command 'unban'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/discord/app_commands/commands.py", line 827, in _do_call
    return await self._callback(self.binding, interaction, **params)  # type: ignore
  File "/usr/src/app/extensions/ban.py", line 553, in unban
    name = await BanRecord.unban_by_id(user_id)
  File "/usr/local/lib/python3.8/site-packages/asgiref/sync.py", line 444, in __call__
    ret = await asyncio.wait_for(future, timeout=None)
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 455, in wait_for
    return await fut
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/asgiref/sync.py", line 486, in thread_handler
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/wall_e_models/models.py", line 99, in unban_by_id
    user.save()
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 739, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 776, in save_base
    updated = self._save_table(
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 855, in _save_table
    values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False)))
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 855, in <listcomp>
    values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False)))
  File "/usr/local/lib/python3.8/site-packages/wall_e_models/customFields.py", line 188, in pre_save
    elif date.tzinfo == tzfile('/usr/share/zoneinfo/Canada/Pacific'):
  File "/usr/local/lib/python3.8/site-packages/dateutil/tz/tz.py", line 464, in __init__
    fileobj = open(fileobj, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/zoneinfo/Canada/Pacific'

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/usr/local/lib/python3.8/site-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/usr/local/lib/python3.8/site-packages/discord/app_commands/commands.py", line 846, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'unban' raised an exception: FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/zoneinfo/Canada/Pacific'
modernNeo commented 8 months ago

fixed with https://github.com/CSSS/wall_e/commit/5d81916aada77aeaf8978680992c8517fdc0b7cb