将 azure 代理作为守护程序运行时出现以下错误:
网络不可达
日志:
[2021-08-17 15:28:18Z ERR VisualStudioServices] Attempt 4 of GET request to https://dev.azure.com/SspCtt/_apis/connectionData?connectOptions=1&lastChangeId=-1&lastChangeId64=-1 failed (Socket Error: NetworkUnreachable). The maximum number of attempts has been reached.
[2021-08-17 15:28:18Z INFO VisualStudioServices] Finished operation Location.GetConnectionData
[2021-08-17 15:28:18Z INFO AgentServer] Catch exception during connect. 1 attempt left.
[2021-08-17 15:28:18Z ERR AgentServer] System.Net.Http.HttpRequestException: Network is unreachable
---> System.Net.Sockets.SocketException (101): Network is unreachable
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.GetConnectionDataAsync(ConnectOptions connectOptions, Int64 lastChangeId, CancellationToken cancellationToken, Object userState)
at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.GetConnectionDataAsync(ConnectOptions connectOptions, Int32 lastChangeId, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.ConnectAsync(ConnectOptions connectOptions, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.AgentServer.EstablishVssConnection(Uri serverUrl, VssCredentials credentials, TimeSpan timeout)
我遵循run-as-a-systemd-service在 ubuntu 服务器上将 azure 代理作为 systemd 运行。首先,我为代理创建了用户,然后将代理下载到用户主文件夹并运行命令:
./svc.sh install azureAgentaccount
该服务已启动,但无法连接到 azure,如日志文件中所示。
服务器运行的是 Ubuntu 20 LTS,它比代理支持的版本更新,但代理从命令行运行良好,只需使用:
./runsvc.sh
我试图成功地从用户帐户访问 url,所以我不知道可能出了什么问题。
我可能会错过什么?