Self-hosted runner got "Runner connect error" error

Hello!
Recently I found an self-hosted runner issue. One minute after my runner registered (everything works as expected), runner reports “Runner connect error: The HTTP request timed out after 00:01:00… Retrying until reconnected.” error. And runner status becomes “Offline”. I have no idea what’s the problem. Could you please take a look? Thanks.

Here’s the log from runner log file:

[2020-08-30 14:03:11Z WARN GitHubActionsService] GET request to https://pipelines.actions.githubusercontent.com/3BFMTJb3mQLP9DxjEs6dZszP1Ni6QR9LCYj08DGlVzmfbznFth/_apis/distributedtask/pools/1/messages?sessionId=a93c836f-154e-4a3b-ae4a-6bccbc2f3509&lastMe
ssageId=1 timed out after 60 seconds.
[2020-08-30 14:03:11Z ERR  MessageListener] Catch exception during get next message.
[2020-08-30 14:03:11Z ERR  MessageListener] System.TimeoutException: The HTTP request timed out after 00:01:00.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
 ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
 ---> System.Net.Sockets.SocketException (125): Operation canceled
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
   at System.Net.Security.SslStream.<FillBufferAsync>g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial)
   at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationTok
en)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at GitHub.Services.Common.VssHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   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.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   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, Cancella
tionToken cancellationToken)

@henrywang ,

One minute after my runner registered (everything works as expected), runner reports “Runner connect error: The HTTP request timed out after 00:01:00… Retrying until reconnected.” error. And runner status becomes “Offline”.

Do you mean the job had started to execute on the the self-hosted runner, but after one minute the runner became disconnected (Offline) during the job execution?

Maybe you can try to check with the steps below:

  1. Check if the runner machine is shut down or the runner service is stopped on the runner machine.

  2. check if there are any steps executed in the job could shut down the runner machine or the runner service.

More details, you can see:

Thanks for your response!
If I understand correctly from your response, this kind of issue comes from test script or network environment which caused failed to connect to pipelines.actions.githubusercontent.com, right? Thanks!

@henrywang ,

Yes.
According to your comment, you have configured your self-hosted runner as a service. Right?

Normally, when a runner is connected to GitHub, it should be Idle status (waiting a job to run on it) or Active status (a job is running on it).

When the self-hosted runner is Offline status, it means the runner is not connected to GitHub. Typically, the following behaviors could cause this status:

  • The runner machine is offline or shut down.
  • The runner service is stopped.
  • The self-hosted runner application cannot communicate with GitHub for some reasons, such as Firewall or Proxy restrictions.

You need to check and confirm that whether there is any step in your workflow job can change the settings or configurations on the runner machine to let the self-hosted runner become Offline.