PhasecoreX / PCXCogs

PhasecoreX's Cogs for Red-DiscordBot
GNU General Public License v3.0
59 stars 46 forks source link

[netspeed] Unable to connect to servers to test latency. #156

Closed DJTOMATO closed 1 month ago

DJTOMATO commented 1 month ago

Traceback (most recent call last):
  File "/mnt/hdd/data/lenabot/cogs/Downloader/lib/speedtest.py", line 1493, in get_best_server
    fastest = sorted(results.keys())[0]
              ~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/hdd/data/lenabot/cogs/CogManager/cogs/netspeed/netspeed.py", line 44, in netspeed
    await loop.run_in_executor(executor, speed_test.get_best_server)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/hdd/data/lenabot/cogs/Downloader/lib/speedtest.py", line 1495, in get_best_server
    raise SpeedtestBestServerFailure('Unable to connect to servers to '
speedtest.SpeedtestBestServerFailure: Unable to connect to servers to test latency.

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

Traceback (most recent call last):
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1366, in invoke
    await ctx.command.invoke(ctx)
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{HOME}/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: SpeedtestBestServerFailure: Unable to connect to servers to test latency.```
PhasecoreX commented 1 month ago

Hmm... I am not seeing this error when I test with my bot. Perhaps you have some network or firewall issue? The error seems to be that speedtest doesn't have a list of servers present, when there should be some. Not sure what could cause that.

DJTOMATO commented 1 month ago

yeah i don't know what happened, restarted the router and everything and seems to work fine now, my bad! <3