Skip to content

[BUG] No connection could be made because the target machine actively refused it. (os error 10061) #964

@Thomas-Boi

Description

@Thomas-Boi

Bug description

This bug is sometimes found when running the peek-bot Action. When this bug occurs, the following error is shown:
image

This bug is usually resolved by rerunning the script. However, this can take up to 3-5 times of retrying before the script works.

Before, this issue was hypothesized to be caused by Icomoon's security system. We thought that it was the site's anti-spam blocking the connection. The OS error listed was usually caused by firewall or the server is rejecting the request (see this). Thus, we thought Icomoon's server was blocking our request

However, after rechecking the code, this was incorrect. The code that triggers the error is creating a new WebDriver instance, not getting the URL (which is actually the next command). Thus, the issue is not related to Icomoon's security as we thought before.

After more research into the Selenium repo (which is the library that causes the error), I found that the code actually requires a local port to be opened on the machine (think http://localhost:8080). By default, the code would get a random open port and host a server on the GitHub hosted-runners (see this)
image

However, I'm guessing that the port (even though it's supposed to be open) was blocked by GitHub's firewall. This matches with the random pattern of how the script fails. Sometimes, a port that's not blocked would be chosen => the script will run fine. However, other times, a port would be chosen but it's actually inaccessible.

Possible fixes or solutions

I'm updating peek-bot to try by default port 8080. This port is usually used as a freeport for programming and hopefully the GitHub runners won't block it. If that doesn't work, I have a piece of code that will retry the script 5 times with a random port number. I'll log these ports and use them as the default from now on.

In the worst case that the ports are blocked randomly each time (which should not exist but just in case), I'll just let the script retry the port 5-10 times until it works. This would save maintainers from re-running the script multiple times.

Additional information

I'm now figuring out how to specify a specific port for the Selenium server. Hopefully, a fix will be pushed within the next 2 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUse this label for pointing out bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions