![](/img/trans.png)
[英]“The remote name could not be resolved” when running an Azure DevOps self-hosted build agent in Service Fabric
[英]The remote name could not be resolved: 'dev.azure.com' when setting up self-hosted devops agent in Docker
当我在 cmd 提示符下运行命令时
docker run -e AZP_URL=https://dev.azure.com/myOrganisation/ -e AZP_TOKEN=myToken -e AZP_AGENT_NAME=myAgent -e AZP_POOL=myPool dockeragent:latest
这个错误的原因是什么?
容器开始运行并启动powershell脚本start.ps1(从微软的教程中获得)我收到错误
1. Determining matching Azure Pipelines agent...
Invoke-RestMethod : The remote name could not be resolved: 'dev.azure.com'
At C:\azp\start.ps1:32 char:12
+ $package = Invoke-RestMethod -Headers @{Authorization=("Basic $base64 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeRestMethodCommand
Cannot index into a null array.
At C:\azp\start.ps1:33 char:1
+ $packageUrl = $package[0].Value.downloadUrl
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
2. Downloading and installing Azure Pipelines agent...
Exception calling "DownloadFile" with "2" argument(s): "Value cannot be null.
Parameter name: address"
At C:\azp\start.ps1:40 char:34
+ $wc.DownloadFile($packageUrl, "$(Get-Location)\agent.zip")
+ ~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException
Expand-Archive : The path 'agent.zip' either does not exist or is not a valid
file system path.
At C:\azp\start.ps1:42 char:1
+ Expand-Archive -Path "agent.zip" -DestinationPath "\azp\agent"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (agent.zip:String) [Expand-Arch
ive], InvalidOperationException
+ FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive
3. Configuring Azure Pipelines agent...
Cleanup. Removing Azure Pipelines agent...
.\config.cmd : The term '.\config.cmd' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At C:\azp\start.ps1:65 char:3
+ .\config.cmd remove --unattended `
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\config.cmd:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
.\config.cmd : The term '.\config.cmd' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At C:\azp\start.ps1:48 char:3
+ .\config.cmd --unattended `
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.\config.cmd:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我可以使用浏览器访问该地址,但设置无法访问。 这里有什么问题,我该如何解决?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.