./config.sh remove - Failed: Removing service - even after service uninstall
See original GitHub issueDescribe the bug error on removing runners [user@server folder]$ ./config.sh remove
Runner removal
Removing service Failed: Removing service Unconfigure service first
To Reproduce run ./config.sh remove
[user@server folder]$ ./config.sh remove
Runner removal
Removing service Failed: Removing service Unconfigure service first
Expected behavior runner should be removed locally and from github.
Runner Version and Platform
Version of your runner? 2.277.1
OS of the machine running the runner? OSX/Windows/Linux/… Linux
What’s not working?
[user@server folder]$ ./config.sh remove
# Runner removal
Removing service
Failed: Removing service
Unconfigure service first
[ec2-user@ip-10-97-97-125 eap_automations_10_97_97_125_b_1]$ sudo ./svc.sh status
not installed
Job Log Output
If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.
Runner and Worker’s Diagnostic Logs
If applicable, add relevant diagnostic log information. Logs are located in the runner’s _diag
folder. The runner logs are prefixed with Runner_
and the worker logs are prefixed with Worker_
. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.
[2021-03-24 15:28:31Z INFO ConfigurationStore] IsServiceConfigured()
[2021-03-24 15:28:31Z INFO ConfigurationStore] IsServiceConfigured: True
[2021-03-24 15:28:31Z INFO Terminal] WRITE LINE: Removing service
[2021-03-24 15:28:31Z ERR Terminal] WRITE ERROR: Failed: Removing service
[2021-03-24 15:28:31Z ERR Runner] System.Exception: Unconfigure service first
at GitHub.Runner.Listener.Configuration.ConfigurationManager.UnconfigureAsync(CommandSettings command)
at GitHub.Runner.Listener.Runner.ExecuteCommand(CommandSettings command)
[2021-03-24 15:28:31Z ERR Terminal] WRITE ERROR: Unconfigure service first
[2021-03-24 15:28:31Z INFO Listener] Runner execution has finished with return code 1
So for some reason it thinks the service is configured, but it has already been uninstalled.
I looked at https://github.com/actions/runner/issues/403 This is the same error, but it seems this was solved by uninstalling the service first. I’ve uninstalled, but the error persists.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
Hi Where can I find the runner remove token here?
Platform: Linux (Ubuntu 20.04)
Steps:
Run
curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | bash -s yourorg/yourrepo
to install and configure service. The runner is now active:Try to remove the runner now (see it fail):
Run
sudo ./svc.sh uninstall
: Runner is now offline:Run
./config.sh remove
:Summary
@TingluoHuang I never managed to get to the state where
./svc.sh status
givesnot installed
andconfig.sh remove
fails using our scripts. I suspect if someone removes the service from systemd using something other thansvc.sh uninstall
,.service
remains in the runner folder, which meansconfig.sh remove
can’t run.Details
The message
Unconfigure service first
is shown if the runner finds a .service file. The hidden file should be on the top level,runner/.service
, in the same directory assvc.sh
. Normally,./svc.sh uninstall
should delete it. That means eithersvc.sh uninstall
exits without deleting.service
, or the file got restored somehow since the last time you ran uninstall. This could be the cause of your issue. Note that./svc.sh uninstall
will not help if the service is no longer registered insystemd
, then the only solution is to delete.service
locally.