myoung34 / docker-github-actions-runner

This will run the new self-hosted github actions runners with docker-in-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runner reusage is disabled

SteveBox0 opened this issue · comments

Very recently a new issue has started when creating a runner with the same name after removing the old container from the host. This was not an issue a day ago.

Runner reusage is disabled
Obtaining the token of the runner
Configuring

A runner exists with the same name *******.
An error occurred: Not configured. Run config.(sh/cmd) to configure the runner.

What's your runtime configuration look like

docker stop github-runner-EXAMPLENAME
docker rm github-runner-EXAMPLENAME
docker pull myoung34/github-runner:latest

docker run --rm -d --name github-runner-EXAMPLENAME -e RUNNER_NAME="github-runner-EXAMPLENAME" -e ACCESS_TOKEN="**************" -e LABELS="github-runner-EXAMPLENAME" -e RUNNER_SCOPE="org" -e ORG_NAME="*************" -e RUNNER_WORKDIR="/tmp/github-runner-your-repo" --dns="1.0.0.1" --dns="1.1.1.1" myoung34/github-runner:latest

Interesting. Looks like something between

2.296.1:

A runner exists with the same name
√ Successfully replaced the runner
√ Runner connection is good

and 2.296.2:

A runner exists with the same name
A runner exists with the same name github-runner-EXAMPLENAME.
An error occurred: Not configured. Run config.(sh/cmd) to configure the runner.

Digging in to see if I caused it or if tthe upstream project changed

@SteveBox0 this is a bug from runner 2.296.2

Filed a bug here

Seems the workaround using 2.296.1 docker image is no longer working as its force updating to 2.296.2.

Current runner version: '2.296.1'
2022-09-15 04:29:48Z: Listening for Jobs
Runner update in progress, do not shutdown runner.
Downloading 2.296.2 runner

The wiki details how to disable updates

I have also been caught by this issue, runners had stopped working, I set up an env file with:

DISABLE_AUTO_UPDATE=1

Set and updated my script to use the --env-file and pin to the 2.296.1 release of the runner and it all works again

For me it also works to remove runners manually via GH UI. (organization -> settings -> runners). I have to do it from time to time(around once per 2 weeks).

So I am also seeing Runner reusage is disabled, but then the run just exits after √ Settings Saved., same issue or different? 🤔

Can you post all the logs from startup?

@myoung34 sure! Is there a verbosity setting somewhere? Not much to see but posted below in case helps.

I get a new offline runner in https://github.com/organizations/JEFuller/settings/actions/runners each time I try to start.

This had been working fine for months, but older image won't start now due to:

Thanks 🙏🏻

dave@lededje:~$ docker run --rm -e RUNNER_SCOPE="org" -e ORG_NAME=jefuller -e LABELS=vision -e ACCESS_TOKEN='XXX' -v /var/run/docker.sock:/var/run/docker.sock -v /_work:/_work --name github-runner --entrypoint /entrypoint.sh myoung34/github-runner:2.298.2
Runner reusage is disabled
Obtaining the token of the runner
Configuring

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

# Authentication


√ Connected to GitHub

# Runner Registration




√ Runner successfully added
√ Runner connection is good

# Runner settings


√ Settings Saved.

dave@lededje:~$ 

@myoung34 Runner reusage is disabled turned out to be unrelated, moved to #253

@myoung34 As its taking a while to get an official fix. Would it be worth while adding a small curl command to your startup process to delete the existing running?

I think before that I'd like to see if we can get some comment from the actions team before I start shimming in hacks

@SteveBox0 @davetapley It looks as though this might have been hotfixed upstream without release notes

Can you retest?

# Authentication


√ Connected to GitHub

# Runner Registration




A runner exists with the same name
√ Successfully replaced the runner
√ Runner connection is good

# Runner settings


√ Settings Saved.


√ Connected to GitHub

Current runner version: '2.296.2'
2022-10-20 14:14:29Z: Listening for Jobs

@myoung34 should I be doing something to update first? I'm still seeing the same, and to be double sure, for me "the same" means that I am seeing Runner reusage is disabled immediately after docker run (i.e. before the snippet you posted).

dave@lededje:~$ docker run --rm -e RUNNER_SCOPE="org" -e ORG_NAME=jefuller -e LABELS=vision -e ACCESS_TOKEN='XXX' -v /var/run/docker.sock:/var/run/docker.sock -v /_work:/_work --name github-runner myoung34/github-runner:2.298.2
Runner reusage is disabled
Obtaining the token of the runner
Configuring

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

# Authentication


√ Connected to GitHub

# Runner Registration




√ Runner successfully added
√ Runner connection is good

# Runner settings


√ Settings Saved.


√ Connected to GitHub

Current runner version: '2.298.2'
2022-10-20 18:17:16Z: Listening for Jobs

If you want to use that, you need to set the CONFIGURED_ACTIONS_RUNNER_FILES_DIR var per the README. relevant code is here

Runner reusage is disabled does not mean it wont replace, it means that the data directory will attempt to be preserved across container runs

Closing for now as it seems like the original issue is resolved. Let me know if thats not the case