runner icon indicating copy to clipboard operation
runner copied to clipboard

www is being added to API endpoint

Open ay0o opened this issue 10 months ago • 2 comments

Describe the bug When I try to configure a runner with a registration token generated with either a GitHub App or a PAT, a www is added to the middle of the endpoint. Instead of api.github.com, it becomes api.www.github.com.

However, if I use the token generated by GitHub when manually going to a repo and hitting the New self-hosted runner button, it works.

To make things more weird, if we ignore the configuration and just run the run.sh --check, the same happens.

For example:

2025-02-07T11:03:22.6743857Z ***************************************************************************************************************
2025-02-07T11:03:22.6743878Z ****                                                                                                       ****
2025-02-07T11:03:22.6743881Z ****     Try DNS lookup for api.www.github.com
2025-02-07T11:03:22.6743893Z ****                                                                                                       ****
2025-02-07T11:03:22.6743897Z ***************************************************************************************************************
2025-02-07T11:03:22.6796296Z ***************************************************************************************************************
2025-02-07T11:03:22.6796319Z ****                                                                                                       ****
2025-02-07T11:03:22.6796338Z ****     Resolved DNS for api.www.github.com failed with error: System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): Name or service not known

I have tried both Ubuntu and Amazon Linux

To Reproduce

  1. Launch an EC2
  2. Download the runner software
  3. Run the checker. ./run.sh --check --url ... --pat ...

Expected behavior Correct endpoints used

Runner Version and Platform

2.322.0

Amazon Linux and Ubuntu 24.04

ay0o avatar Feb 07 '25 11:02 ay0o

oh, found the root cause for this.

It's because I was using as URL https://www.github.com/owner/repo.

I would say this is not ok. If the tool expects to connect to api.github.com, it shouldn't matter whether the URL is passed as either github.com or www.github.com, don't you think?

ay0o avatar Feb 07 '25 12:02 ay0o

Technically the GitHub Self-Hosted runners can also be used with a self-hosted instance of GitHub (GitHub Enterprise), which likely will end up having a completely different FQDN. I think this is a clever way to try to find the API endpoint.

lemisieur avatar Feb 25 '25 13:02 lemisieur