Describe the bug
I am currently unable to start up a self-hosted runner that has been inactive for a while. I can't reconfigure it either, since I need to provide a removal token, which I can't access because the runner isn't listed anymore.
Expected behavior
I expected the runner to either start up or GitHub to list the runner in question so I can request a removal token.
When starting the runner using ./run.cmd, the session closes immediately with an error that the runner registration has been removed, most likely automatically due to inactivity.
However, when configuring the runner again using the instructions from the "New Self-Hosted Runner" page, config.cmd throws an error, saying the runner has already been configured and would have to be removed to configure again. This is already contrary to what the first error said.
When using ./config.cmd remove, I am asked for a removal token, which is also mentioned in the guide in the product docs. According to the guide, I am supposed to get one from the settings of the runner, but the runner is nowhere to be found. Back then, I've added it as an organization runner, but it's not listed there, and it isn't listed in the runners of the repository that has used the runner in the past.
Runner and Worker's Diagnostic Logs
Here's a log attempting to start the runner:
[2024-04-11 13:23:56Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'Credentials': 'C:\actions-runner\.credentials'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'Runner': 'C:\actions-runner\.runner'
[2024-04-11 13:23:56Z INFO Listener] Runner is built for Windows (X64) - win-x64.
[2024-04-11 13:23:56Z INFO Listener] RuntimeInformation: Microsoft Windows 10.0.14393.
[2024-04-11 13:23:56Z INFO Listener] Version: 2.315.0
[2024-04-11 13:23:56Z INFO Listener] Commit: 86858e39e42e25e23332fea3ef7d459ff10f30f7
[2024-04-11 13:23:56Z INFO Listener] Culture: en-US
[2024-04-11 13:23:56Z INFO Listener] UI Culture: en-US
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO Listener] Validating directory permissions for: 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO CommandLineParser] Parse
[2024-04-11 13:23:56Z INFO CommandLineParser] Parsing 1 args
[2024-04-11 13:23:56Z INFO CommandLineParser] parsing argument
[2024-04-11 13:23:56Z INFO CommandLineParser] HasArgs: False
[2024-04-11 13:23:56Z INFO CommandLineParser] Adding Command: run
[2024-04-11 13:23:56Z INFO Listener] Arguments parsed
[2024-04-11 13:23:56Z INFO Runner] ExecuteCommand
[2024-04-11 13:23:56Z INFO ConfigurationStore] currentAssemblyLocation: C:\actions-runner\bin\Runner.Listener.dll
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO ConfigurationStore] binPath: C:\actions-runner\bin
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO ConfigurationStore] RootFolder: C:\actions-runner
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'Runner': 'C:\actions-runner\.runner'
[2024-04-11 13:23:56Z INFO ConfigurationStore] ConfigFilePath: C:\actions-runner\.runner
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'Credentials': 'C:\actions-runner\.credentials'
[2024-04-11 13:23:56Z INFO ConfigurationStore] CredFilePath: C:\actions-runner\.credentials
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'MigratedCredentials': 'C:\actions-runner\.credentials_migrated'
[2024-04-11 13:23:56Z INFO ConfigurationStore] MigratedCredFilePath: C:\actions-runner\.credentials_migrated
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'Service': 'C:\actions-runner\.service'
[2024-04-11 13:23:56Z INFO ConfigurationStore] ServiceConfigFilePath: C:\actions-runner\.service
[2024-04-11 13:23:56Z INFO CommandSettings] Flag 'help': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Flag 'version': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Flag 'commit': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Flag 'check': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Command 'configure': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Command 'remove': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Command 'warmup': 'False'
[2024-04-11 13:23:56Z INFO ConfigurationManager] LoadSettings
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsConfigured()
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsConfigured: True
[2024-04-11 13:23:56Z INFO ConfigurationManager] Is configured: True
[2024-04-11 13:23:56Z INFO ConfigurationStore] Read setting file: 294 chars
[2024-04-11 13:23:56Z INFO ConfigurationManager] Settings Loaded
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsServiceConfigured()
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsServiceConfigured: False
[2024-04-11 13:23:56Z INFO CommandSettings] Command 'run': 'True'
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsConfigured()
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsConfigured: True
[2024-04-11 13:23:56Z INFO ConfigurationManager] Is configured: True
[2024-04-11 13:23:56Z INFO Runner] Could not parse the argument value '' for StartupType. Defaulting to Manual
[2024-04-11 13:23:56Z INFO Runner] Set runner startup type - Manual
[2024-04-11 13:23:56Z INFO CommandSettings] Flag 'once': 'False'
[2024-04-11 13:23:56Z INFO CommandSettings] Flag 'once': 'False'
[2024-04-11 13:23:56Z INFO Runner] RunAsync
[2024-04-11 13:23:56Z INFO ConfigurationManager] LoadSettings
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsConfigured()
[2024-04-11 13:23:56Z INFO ConfigurationStore] IsConfigured: True
[2024-04-11 13:23:56Z INFO ConfigurationManager] Is configured: True
[2024-04-11 13:23:56Z INFO ConfigurationManager] Settings Loaded
[2024-04-11 13:23:56Z INFO MessageListener] {
"AgentId": 79,
"AgentName": "HTANTE007",
"PoolId": 5,
"PoolName": "Durmont",
"ServerUrl": "https://pipelinesghubeus15.actions.githubusercontent.com/Wdz6FvgVMtnihy3DOHGaz89KPQs55bW9fVKMsNt4cM2T5dOtnh/",
"GitHubUrl": "https://github.com/CBS-BC-AT",
"WorkFolder": "_work"
}
[2024-04-11 13:23:56Z INFO MessageListener] Loading Credentials
[2024-04-11 13:23:56Z INFO ConfigurationStore] HasCredentials()
[2024-04-11 13:23:56Z INFO ConfigurationStore] stored True
[2024-04-11 13:23:56Z INFO CredentialManager] GetCredentialProvider
[2024-04-11 13:23:56Z INFO CredentialManager] Creating type OAuth
[2024-04-11 13:23:56Z INFO CredentialManager] Creating credential type: OAuth
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:23:56Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:23:56Z INFO HostContext] Well known config file 'RSACredentials': 'C:\actions-runner\.credentials_rsaparams'
[2024-04-11 13:23:56Z INFO RSAEncryptedFileKeyManager] Loading RSA key parameters from file C:\actions-runner\.credentials_rsaparams
[2024-04-11 13:23:56Z INFO MessageListener] Attempt to create session.
[2024-04-11 13:23:56Z INFO MessageListener] Connecting to the Runner Server...
[2024-04-11 13:23:56Z INFO RunnerServer] EstablishVssConnection
[2024-04-11 13:23:56Z INFO RunnerServer] Establish connection with 100 seconds timeout.
[2024-04-11 13:23:56Z INFO GitHubActionsService] Starting operation Location.GetConnectionData
[2024-04-11 13:23:56Z INFO RunnerServer] EstablishVssConnection
[2024-04-11 13:23:56Z INFO RunnerServer] Establish connection with 60 seconds timeout.
[2024-04-11 13:23:56Z INFO GitHubActionsService] Starting operation Location.GetConnectionData
[2024-04-11 13:23:56Z INFO RunnerServer] EstablishVssConnection
[2024-04-11 13:23:56Z INFO RunnerServer] Establish connection with 60 seconds timeout.
[2024-04-11 13:23:56Z INFO GitHubActionsService] Starting operation Location.GetConnectionData
[2024-04-11 13:23:57Z INFO GitHubActionsService] Finished operation Location.GetConnectionData
[2024-04-11 13:23:57Z INFO GitHubActionsService] Finished operation Location.GetConnectionData
[2024-04-11 13:23:57Z INFO GitHubActionsService] Finished operation Location.GetConnectionData
[2024-04-11 13:23:57Z INFO MessageListener] VssConnection created
[2024-04-11 13:23:57Z INFO Terminal] WRITE LINE:
[2024-04-11 13:23:57Z INFO Terminal] WRITE LINE:
[2024-04-11 13:23:57Z INFO RSAEncryptedFileKeyManager] Loading RSA key parameters from file C:\actions-runner\.credentials_rsaparams
[2024-04-11 13:23:57Z INFO RSAEncryptedFileKeyManager] Loading RSA key parameters from file C:\actions-runner\.credentials_rsaparams
[2024-04-11 13:23:58Z ERR GitHubActionsService] POST request to https://vstoken.actions.githubusercontent.com/_apis/oauth2/token/c5c4a164-9486-4ef9-b7ad-736824ea4c89 failed. HTTP Status: BadRequest, AFD Ref: Ref A: 4CC3403D3428418E925546C5FB12F7D9 Ref B: VIEEDGE4406 Ref C: 2024-04-11T13:24:09Z
[2024-04-11 13:23:58Z INFO GitHubActionsService] AAD Correlation ID for this token request: Unknown
[2024-04-11 13:23:58Z ERR MessageListener] Catch exception during create session.
[2024-04-11 13:23:58Z ERR MessageListener] GitHub.Services.OAuth.VssOAuthTokenRequestException: Registration was not found or is not medium trust. ClientType:
at GitHub.Services.OAuth.VssOAuthTokenProvider.OnGetTokenAsync(IssuedToken failedToken, CancellationToken cancellationToken)
at GitHub.Services.Common.IssuedTokenProvider.GetTokenOperation.GetTokenAsync(VssTraceActivity traceActivity)
at GitHub.Services.Common.IssuedTokenProvider.GetTokenAsync(IssuedToken failedToken, CancellationToken cancellationToken)
at GitHub.Services.Common.VssHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at GitHub.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at GitHub.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
at GitHub.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
at GitHub.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
at GitHub.Runner.Listener.MessageListener.CreateSessionAsync(CancellationToken token)
[2024-04-11 13:23:58Z ERR Terminal] WRITE ERROR: Failed to create a session. The runner registration has been deleted from the server, please re-configure. Runner registrations are automatically deleted for runners that have not connected to the service recently.
[2024-04-11 13:23:58Z INFO Listener] Runner execution has finished with return code 1
And here's a log attempting to configure the runner:
[2024-04-11 13:24:10Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO HostContext] Well known config file 'Credentials': 'C:\actions-runner\.credentials'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO HostContext] Well known config file 'Runner': 'C:\actions-runner\.runner'
[2024-04-11 13:24:10Z INFO Listener] Runner is built for Windows (X64) - win-x64.
[2024-04-11 13:24:10Z INFO Listener] RuntimeInformation: Microsoft Windows 10.0.14393.
[2024-04-11 13:24:10Z INFO Listener] Version: 2.315.0
[2024-04-11 13:24:10Z INFO Listener] Commit: 86858e39e42e25e23332fea3ef7d459ff10f30f7
[2024-04-11 13:24:10Z INFO Listener] Culture: en-US
[2024-04-11 13:24:10Z INFO Listener] UI Culture: en-US
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO Listener] Validating directory permissions for: 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO CommandLineParser] Parse
[2024-04-11 13:24:10Z INFO CommandLineParser] Parsing 1 args
[2024-04-11 13:24:10Z INFO CommandLineParser] parsing argument
[2024-04-11 13:24:10Z INFO CommandLineParser] HasArgs: False
[2024-04-11 13:24:10Z INFO CommandLineParser] Adding Command: configure
[2024-04-11 13:24:10Z INFO Listener] Arguments parsed
[2024-04-11 13:24:10Z INFO Runner] ExecuteCommand
[2024-04-11 13:24:10Z INFO ConfigurationStore] currentAssemblyLocation: C:\actions-runner\bin\Runner.Listener.dll
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO ConfigurationStore] binPath: C:\actions-runner\bin
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO ConfigurationStore] RootFolder: C:\actions-runner
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO HostContext] Well known config file 'Runner': 'C:\actions-runner\.runner'
[2024-04-11 13:24:10Z INFO ConfigurationStore] ConfigFilePath: C:\actions-runner\.runner
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO HostContext] Well known config file 'Credentials': 'C:\actions-runner\.credentials'
[2024-04-11 13:24:10Z INFO ConfigurationStore] CredFilePath: C:\actions-runner\.credentials
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO HostContext] Well known config file 'MigratedCredentials': 'C:\actions-runner\.credentials_migrated'
[2024-04-11 13:24:10Z INFO ConfigurationStore] MigratedCredFilePath: C:\actions-runner\.credentials_migrated
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Bin': 'C:\actions-runner\bin'
[2024-04-11 13:24:10Z INFO HostContext] Well known directory 'Root': 'C:\actions-runner'
[2024-04-11 13:24:10Z INFO HostContext] Well known config file 'Service': 'C:\actions-runner\.service'
[2024-04-11 13:24:10Z INFO ConfigurationStore] ServiceConfigFilePath: C:\actions-runner\.service
[2024-04-11 13:24:10Z INFO CommandSettings] Flag 'help': 'False'
[2024-04-11 13:24:10Z INFO CommandSettings] Flag 'version': 'False'
[2024-04-11 13:24:10Z INFO CommandSettings] Flag 'commit': 'False'
[2024-04-11 13:24:10Z INFO CommandSettings] Flag 'check': 'False'
[2024-04-11 13:24:10Z INFO CommandSettings] Command 'configure': 'True'
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE:
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: --------------------------------------------------------------------------------
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | ____ _ _ _ _ _ _ _ _ |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | / ___(_) |_| | | |_ _| |__ / \ ___| |_(_) ___ _ __ ___ |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | | | _| | __| |_| | | | | '_ \ / _ \ / __| __| |/ _ \| '_ \/ __| |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | | |_| | | |_| _ | |_| | |_) | / ___ \ (__| |_| | (_) | | | \__ \ |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | \____|_|\__|_| |_|\__,_|_.__/ /_/ \_\___|\__|_|\___/|_| |_|___/ |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | |
[2024-04-11 13:24:10Z INFO Terminal] WRITE: |
[2024-04-11 13:24:10Z INFO Terminal] WRITE: Self-hosted runner registration
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: | |
[2024-04-11 13:24:10Z INFO Terminal] WRITE LINE: --------------------------------------------------------------------------------
[2024-04-11 13:24:10Z INFO ConfigurationManager] ConfigureAsync
[2024-04-11 13:24:10Z INFO CommandSettings] Flag 'generateServiceConfig': 'False'
[2024-04-11 13:24:10Z INFO ConfigurationStore] IsConfigured()
[2024-04-11 13:24:10Z INFO ConfigurationStore] IsConfigured: True
[2024-04-11 13:24:10Z INFO ConfigurationManager] Is configured: True
[2024-04-11 13:24:10Z ERR Runner] System.InvalidOperationException: Cannot configure the runner because it is already configured. To reconfigure the runner, run 'config.cmd remove' or './config.sh remove' first.
at GitHub.Runner.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
at GitHub.Runner.Listener.Runner.ExecuteCommand(CommandSettings command)
[2024-04-11 13:24:10Z ERR Terminal] WRITE ERROR: Cannot configure the runner because it is already configured. To reconfigure the runner, run 'config.cmd remove' or './config.sh remove' first.
[2024-04-11 13:24:10Z INFO Listener] Runner execution has finished with return code 1
Describe the bug I am currently unable to start up a self-hosted runner that has been inactive for a while. I can't reconfigure it either, since I need to provide a removal token, which I can't access because the runner isn't listed anymore.
Expected behavior I expected the runner to either start up or GitHub to list the runner in question so I can request a removal token.
Runner Version and Platform
Version: 2.315.0 Commit: 86858e39e42e25e23332fea3ef7d459ff10f30f7
OS of the machine running the runner? Windows
What's not working?
When starting the runner using
./run.cmd
, the session closes immediately with an error that the runner registration has been removed, most likely automatically due to inactivity. However, when configuring the runner again using the instructions from the "New Self-Hosted Runner" page,config.cmd
throws an error, saying the runner has already been configured and would have to be removed to configure again. This is already contrary to what the first error said. When using./config.cmd remove
, I am asked for a removal token, which is also mentioned in the guide in the product docs. According to the guide, I am supposed to get one from the settings of the runner, but the runner is nowhere to be found. Back then, I've added it as an organization runner, but it's not listed there, and it isn't listed in the runners of the repository that has used the runner in the past.Runner and Worker's Diagnostic Logs
Here's a log attempting to start the runner:
And here's a log attempting to configure the runner: