From ed1493dd802b709eae2ba55cca493df45be67d0e Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Fri, 16 Feb 2024 20:52:47 -0800 Subject: [PATCH] Add documentation for deleting runners from DB. --- homelab/druid/config/gitea/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homelab/druid/config/gitea/README.md b/homelab/druid/config/gitea/README.md index 0fbb5c1f..b07c0f88 100644 --- a/homelab/druid/config/gitea/README.md +++ b/homelab/druid/config/gitea/README.md @@ -35,3 +35,9 @@ To force the runners to re-register (to apply updated labels, for example). 2. Delete the `.runner` files for each runner. Run `find ~/data/gitea/ -name ".runner" -delete`. 3. Bring the runners back up. Run `docker compose up -d` from the gitea directory. +# Delete Registed Runners +Apparently a misconfigured Docker-in-Docker runner may sometimes retry registering over and over until the heat death of the universe. In that case you will end up with many "ghost" runners. In my case, 27,619. To resolve, you can either step through each one and click "edit", then "delete", then "confirm". Or you can just use the database. + +1. `docker exec -it gitea_postgres psql --username "gitea"` To open a terminal inside the container and open a CLI session to the database. +2. `\c gitea` To select the 'gitea' database. +3. `DELETE FROM action_runner WHERE id NOT IN (50, 66);` To delete all entries except those with the IDs I wanted to keep.