Skip to content

[BetterUptime] Error in loop #148

Open
@Riseofpower1

Description

@Riseofpower1

What cog is this bug report for?

Betteruptime

What versions are you running?


Describe the bug

Just used betteruptimegraph and caused bot to read this error every 60 seconds

If there's an error, paste it here

[10:47:30] ERROR    [red.vex.betteruptime.loop] Something went wrong in the main BetterUptime loop. The loop will try again in 60 seconds. Please report this and the below information to Vexed.
╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ in pandas._libs.index.DatetimeEngine.get_loc:627                                                                 │
│ in pandas._libs.hashtable.Int64HashTable.get_item:2606                                                           │
│ in pandas._libs.hashtable.Int64HashTable.get_item:2630                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 1750204800000000000

During handling of the above exception, another exception occurred:

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \base.py:3812 in get_loc                                                                                         │
│ ❱ 3812             return self._engine.get_loc(casted_key)                                                       │
│ in pandas._libs.index.DatetimeEngine.get_loc:595                                                                 │
│ in pandas._libs.index.DatetimeEngine.get_loc:629                                                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: Timestamp('2025-06-18 00:00:00')

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

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \datetimes.py:630 in get_loc                                                                                     │
│ ❱  630             return Index.get_loc(self, key)                                                               │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \base.py:3819 in get_loc                                                                                         │
│ ❱ 3819             raise KeyError(key) from err                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: Timestamp('2025-06-18 00:00:00')

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

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\CogManager\cogs\betteruptime\loop. │
│ py:143 in update_uptime                                                                                          │
│ ❱ 143             self.cog_loaded_cache[utcdatetoday] += 60                                                      │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\series. │
│ py:1130 in __getitem__                                                                                           │
│ ❱ 1130             return self._get_value(key)                                                                   │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\series. │
│ py:1246 in _get_value                                                                                            │
│ ❱ 1246         loc = self.index.get_loc(label)                                                                   │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \datetimes.py:632 in get_loc                                                                                     │
│ ❱  632             raise KeyError(orig_key) from err                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: datetime.datetime(2025, 6, 18, 0, 0)

During handling of the above exception, another exception occurred:

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ in pandas._libs.index.DatetimeEngine.get_loc:627                                                                 │
│ in pandas._libs.hashtable.Int64HashTable.get_item:2606                                                           │
│ in pandas._libs.hashtable.Int64HashTable.get_item:2630                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 1750204800000000000

During handling of the above exception, another exception occurred:

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \base.py:3812 in get_loc                                                                                         │
│ ❱ 3812             return self._engine.get_loc(casted_key)                                                       │
│ in pandas._libs.index.DatetimeEngine.get_loc:595                                                                 │
│ in pandas._libs.index.DatetimeEngine.get_loc:629                                                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: Timestamp('2025-06-18 00:00:00')

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

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \datetimes.py:630 in get_loc                                                                                     │
│ ❱  630             return Index.get_loc(self, key)                                                               │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \base.py:3819 in get_loc                                                                                         │
│ ❱ 3819             raise KeyError(key) from err                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: Timestamp('2025-06-18 00:00:00')

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

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\series. │
│ py:1307 in __setitem__                                                                                           │
│ ❱ 1307             self._set_with_engine(key, value, warn=warn)                                                  │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\series. │
│ py:1379 in _set_with_engine                                                                                      │
│ ❱ 1379         loc = self.index.get_loc(key)                                                                     │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexes │
│ \datetimes.py:632 in get_loc                                                                                     │
│ ❱  632             raise KeyError(orig_key) from err                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: datetime.datetime(2025, 6, 18, 0, 0)

During handling of the above exception, another exception occurred:

╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\CogManager\cogs\betteruptime\loop. │
│ py:112 in betteruptime_main_loop                                                                                 │
│ ❱ 112                 await self.update_uptime()                                                                 │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\CogManager\cogs\betteruptime\loop. │
│ py:145 in update_uptime                                                                                          │
│ ❱ 145             self.cog_loaded_cache[utcdatetoday] = 60                                                       │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\series. │
│ py:1331 in __setitem__                                                                                           │
│ ❱ 1331                 self.loc[key] = value                                                                     │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexin │
│ g.py:911 in __setitem__                                                                                          │
│ ❱  911         iloc._setitem_with_indexer(indexer, value, self.name)                                             │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexin │
│ g.py:1932 in _setitem_with_indexer                                                                               │
│ ❱ 1932                 self._setitem_with_indexer_missing(indexer, value)                                        │
│ C:\Users\Admin\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\SparkBot\cogs\Downloader\lib\pandas\core\indexin │
│ g.py:2231 in _setitem_with_indexer_missing                                                                       │
│ ❱ 2231             with warnings.catch_warnings():                                                               │
│ C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\warnings.py:450 in __init__                           │
│ ❱ 450         self._module = sys.modules['warnings'] if module is None else module                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'warnings'

Metadata

Metadata

Assignees

No one assigned

    Labels

    cog: betteruptimeRelating to the betteruptime cogtype: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions