ec2-github-runner icon indicating copy to clipboard operation
ec2-github-runner copied to clipboard

Bug: Failed to register with GitHub before timeout period reached

Open mikelax opened this issue 9 months ago • 1 comments

Overview

Using version 2.3.9 of this workflow, I am seeing situations where the runner fails to register with GitHub and fails with a timeout error. What is odd is that this situation occurs well before the timeout period is reached.

For example, I am using the default value of 5 minutes for a timeout, but the timeout error was thrown after just 41s. I have looked through the source code and can not see an obvious logic error that would cause this.

Example

Parameters: startup-timeout-minutes - not specified startup-retry-interval-seconds: 2 startup-quiet-period-seconds: 15

Here is the output from a workflow run.

Image
Run machulav/[email protected]
GitHub Registration Token is received
AWS EC2 instance i-xxxxxxxxxxxxxxxxx is started
Checking for instance i-xxxxxxxxxxxxxxxxx to be up and running
AWS EC2 instance i-xxxxxxxxxxxxxxxxx is up and running
Waiting 15s for the AWS EC2 instance to be registered in GitHub as a new self-hosted runner
Checking every 2s if the GitHub self-hosted runner is registered
Checking...
Checking...
Checking...
Checking...
Error: GitHub self-hosted runner registration error
Checking...
Error: A timeout of 5 minutes is exceeded. Your AWS EC2 instance was not able to register itself in GitHub as a new self-hosted runner.

mikelax avatar Apr 09 '25 11:04 mikelax

I had the same problem, and to fix it I had to remove the initialization parameters so that the default parameters would be used. apparently after a few attempts the script considers that the 5-minute time limit has been reached, even if this time limit has not.

tecnologia-ainext avatar Apr 23 '25 16:04 tecnologia-ainext