Kreusada / Kreusada-Cogs

Cogs for Red-DiscordBot
https://kreusadacogs.readthedocs.io/en/latest/
MIT License
30 stars 18 forks source link

[TimeStamps] Multiple conflicting time zone configurations raises ZoneInfoNotFoundError #194

Closed Sheep100 closed 2 years ago

Sheep100 commented 2 years ago

I get this error:

Oct 22 10:22:05 sheep python[14126]: [2021-10-22 04:22:05] [ERROR] red: ConversionError
Oct 22 10:22:05 sheep python[14126]: Traceback (most recent call last):
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 451, in _actual_conversion
Oct 22 10:22:05 sheep python[14126]:     ret = await instance.convert(ctx, argument)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/CogManager/cogs/timestamps/timestamps.py", line 20, in convert
Oct 22 10:22:05 sheep python[14126]:     parsed = dateparser.parse(arg)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/conf.py", line 92, in wrapper
Oct 22 10:22:05 sheep python[14126]:     return f(*args, **kwargs)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/__init__.py", line 61, in parse
Oct 22 10:22:05 sheep python[14126]:     data = parser.get_date_data(date_string, date_formats)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/date.py", line 428, in get_date_data
Oct 22 10:22:05 sheep python[14126]:     parsed_date = _DateLocaleParser.parse(
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/date.py", line 178, in parse
Oct 22 10:22:05 sheep python[14126]:     return instance._parse()
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/date.py", line 182, in _parse
Oct 22 10:22:05 sheep python[14126]:     date_data = self._parsers[parser_name]()
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/date.py", line 196, in _try_freshness_parser
Oct 22 10:22:05 sheep python[14126]:     return freshness_date_parser.get_date_data(self._get_translated_date(), self._settings)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/freshness_date_parser.py", line 156, in get_date_data
Oct 22 10:22:05 sheep python[14126]:     date, period = self.parse(date_string, settings)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/freshness_date_parser.py", line 93, in parse
Oct 22 10:22:05 sheep python[14126]:     now = datetime.now(self.get_local_tz())
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/dateparser/freshness_date_parser.py", line 41, in get_local_tz
Oct 22 10:22:05 sheep python[14126]:     return get_localzone()
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/tzlocal/unix.py", line 205, in get_localzone
Oct 22 10:22:05 sheep python[14126]:     _cache_tz = _get_localzone()
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/tzlocal/unix.py", line 167, in _get_localzone
Oct 22 10:22:05 sheep python[14126]:     tzname = _get_localzone_name(_root)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/.local/share/Red-DiscordBot/data/sheepbot/cogs/Downloader/lib/tzlocal/unix.py", line 146, in _get_localzone_name
Oct 22 10:22:05 sheep python[14126]:     raise utils.ZoneInfoNotFoundError(message)
Oct 22 10:22:05 sheep python[14126]: tzlocal.utils.ZoneInfoNotFoundError: 'Multiple conflicting time zone configurations found:\n/etc/timezone: Europe/Oslo\n/usr/share/zoneinfo/posixrules: posixrules\nFix the configuration, or set the time zone in a TZ environment variable.\n'
Oct 22 10:22:05 sheep python[14126]: The above exception was the direct cause of the following exception:
Oct 22 10:22:05 sheep python[14126]: Traceback (most recent call last):
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
Oct 22 10:22:05 sheep python[14126]:     await ctx.command.invoke(ctx)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 855, in invoke
Oct 22 10:22:05 sheep python[14126]:     await self.prepare(ctx)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 497, in prepare
Oct 22 10:22:05 sheep python[14126]:     await self._parse_arguments(ctx)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 706, in _parse_arguments
Oct 22 10:22:05 sheep python[14126]:     kwargs[name] = await self.transform(ctx, param)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 552, in transform
Oct 22 10:22:05 sheep python[14126]:     return await self.do_conversion(ctx, converter, argument, param)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 526, in do_conversion
Oct 22 10:22:05 sheep python[14126]:     return await super().do_conversion(ctx, converter, argument, param)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 505, in do_conversion
Oct 22 10:22:05 sheep python[14126]:     return await self._actual_conversion(ctx, converter, argument, param)
Oct 22 10:22:05 sheep python[14126]:   File "/home/sheep/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 464, in _actual_conversion
Oct 22 10:22:05 sheep python[14126]:     raise ConversionError(converter, exc) from exc
Oct 22 10:22:05 sheep python[14126]: discord.ext.commands.errors.ConversionError: (<class 'timestamps.timestamps.DateConverter'>, ZoneInfoNotFoundError('Multiple conflicting time zone configurations found:\n/etc/timezone: Europe/Oslo\n/usr/share/zoneinfo/posixrules: posixrules\nFix the configuration, or set the time
lines 917-1001/1001 (END)
Kreusada commented 2 years ago

Unfortunately I am unable to fix this issue myself, I've had a browse and haven't found anything relevant. However, you could keep yourself notified to this issue as this user seems to be having the same problem as you.

Kreusada commented 2 years ago

Hi again, this appears to be an issue caused by your machine instead of the code. Please keep notified to the issue I linked above, I'll be closing this seeing as there is no fix implementable.