Skip to content

Conversation

@jeverling
Copy link

@jeverling jeverling commented Dec 8, 2022

Hi, we were running into issues where newly created instances weren't able to register with Github as runners, because by default the hostname is used as --name, and AWS was reusing hostnames from our IP range.
This can be fixed by setting the name explicitly, to something that is unique.
I think --name $(hostname)-$(uuidgen) should work well.

Fixes #128

Avoid failures when other runners are already registered with same name
@scottdickerson
Copy link

this is awesome and was also causing us problems.

@GiovaneRibeiro-neuro
Copy link

Awesome fix! I am facing this problem right now on my builds... When this PR will be merged?

@dsnjunior
Copy link

Awesome fix! I am facing this problem right now on my builds... When this PR will be merged?

It looks like it won't be that soon.

If it helps we are using it like that:

- name: Start EC2 runner
  uses: kimetrica/ec2-github-runner@set-unique-name-in-UserData-script

@thimios
Copy link

thimios commented Apr 15, 2024

We are also running in the same issue, it would be great to see this merged soon

@cd-Barnes cd-Barnes mentioned this pull request Jun 18, 2024
romeroyonatan added a commit to Shiphero/ec2-github-runner that referenced this pull request Aug 8, 2024
romeroyonatan added a commit to Shiphero/ec2-github-runner that referenced this pull request Aug 8, 2024
romeroyonatan added a commit to Shiphero/ec2-github-runner that referenced this pull request Aug 8, 2024
Bellangelo added a commit to Bellangelo/ec2-github-runner that referenced this pull request Jun 11, 2025
@humzam
Copy link
Contributor

humzam commented Dec 11, 2025

I think we are also facing the issue at my company! Now that we ramped up the # of instances, its causing lots of failed runner registrations. I see repeated log lines on the machine with:

2025-12-11T11:29:15.859530-08:00 ip-10-102-30-214 user-data:  A runner exists with the same name

@Preen Any chance we could get this PR merged and released?

@Preen
Copy link
Collaborator

Preen commented Dec 11, 2025

@humzam someone needs to fix the conflicts that are present. I dont have the time to do it right now sadly.

@Preen
Copy link
Collaborator

Preen commented Dec 11, 2025

@jeverling
Would you have time to fix the conflicts?

@jeverling
Copy link
Author

jeverling commented Dec 11, 2025 via email

@jeverling
Copy link
Author

jeverling commented Dec 17, 2025

I have updated the PR. There shouldn't be any more conflicts.
I'm not sure why the Github diff shows changes for a lot of lines that are the same, they don't show up in any of the diff tools I tried (VS Code, kdiff3, meld).
I only changed the lines that contain --labels ${label}, to include the --name parameter.

@Preen
Copy link
Collaborator

Preen commented Dec 17, 2025

It looks like you removed './run.sh',
ab95878#diff-3d2b59189eeedc2d428ddd632e97658fe310f587f7cb63b01f9b98ffc11c0197L145027

?

@jeverling
Copy link
Author

jeverling commented Dec 17, 2025

It looks like you removed './run.sh', ab95878#diff-3d2b59189eeedc2d428ddd632e97658fe310f587f7cb63b01f9b98ffc11c0197L145027

?

No, this was removed in the main branch of this repo. I merged main into the set-unique-name-in-UserData-script branch in our fork, to bring it up-to-date. The only changes should be the lines where ./config.sh is being called with the --label parameter.
Check out this diff between the current main HEAD of this repo, and the fork: main...kimetrica:ec2-github-runner:set-unique-name-in-UserData-script

@humzam
Copy link
Contributor

humzam commented Dec 23, 2025

The diff looks good now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runners fail to register when IPs/hostnames are reused

7 participants