Azure DevOps-Visual Studio部署任务通过getaddrinfo ENOTFOUND 443

时间:2020-10-01 15:37:20

标签: azure-devops visual-studio-app-center

我正在运行管道,该管道在公司代理后面的自托管macOS(10.15.6)代理上生成发行版本并将其上载到App Center。我正在为此使用 App Center Distribute 任务。由PR批准触发时,默认情况下debug为false,并且管道运行状态为成功。但是,我在应用程序中心找不到该版本。我仔细检查了目标ID和应用程序插件-似乎是有效的。

问题: 然后,我以debug为true手动运行管道,以下是日志。如您所见,任务尝试将内部版本上传到应用程序中心时reason: getaddrinfo ENOTFOUND file.appcenter.ms file.appcenter.ms:443silently ignores it and immediately tries to cancel the release都会引发错误。即使发生了异常,也会将其忽略并取消构建发布-因此,该任务被标记为成功,并且发布不在应用中心中。

我还从Azure存储库中有另一个任务获取资源发布构建工件,它们似乎在其调试日志中都有代理信息。但是deploy-to-visual-studio并未提及此类日志,并且标记自己在不到5秒的时间内就成功了。

##[debug]Evaluating condition for step: 'Deploy to Visual Studio App Center'
##[debug]Evaluating: succeededOrFailed()
##[debug]Evaluating succeededOrFailed:
##[debug]=> True
##[debug]Result: True
Starting: Deploy to Visual Studio App Center
==============================================================================
Task         : App Center distribute
Description  : Distribute app builds to testers and users via Visual Studio App Center
Version      : 3.173.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/app-center-distribute
==============================================================================
##[debug]Using node path: /path/to/agent/externals/node/bin/node
##[debug]agent.workFolder=/path/to/agent/_work
##[debug]loading inputs and endpoints
##[debug]loading INPUT_SERVERENDPOINT
##[debug]loading INPUT_APPSLUG
##[debug]loading INPUT_APP
##[debug]loading INPUT_SYMBOLSTYPE
##[debug]loading INPUT_SYMBOLSPATH
##[debug]loading INPUT_APPXSYMPATH
##[debug]loading INPUT_DSYMPATH
##[debug]loading INPUT_MAPPINGTXTPATH
##[debug]loading INPUT_NATIVELIBRARIESPATH
##[debug]loading INPUT_PACKPARENTFOLDER
##[debug]loading INPUT_RELEASENOTESSELECTION
##[debug]loading INPUT_RELEASENOTESINPUT
##[debug]loading INPUT_RELEASENOTESFILE
##[debug]loading INPUT_ISMANDATORY
##[debug]loading INPUT_DESTINATIONTYPE
##[debug]loading INPUT_DESTINATIONGROUPIDS
##[debug]loading INPUT_ISSILENT
##[debug]loading ENDPOINT_AUTH_6ddbb81d-7d44-41c0-8de9-78a20876d4ca
##[debug]loading ENDPOINT_AUTH_SCHEME_6ddbb81d-7d44-41c0-8de9-78a20876d4ca
##[debug]loading ENDPOINT_AUTH_PARAMETER_6ddbb81d-7d44-41c0-8de9-78a20876d4ca_APITOKEN
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading SECRET_KEY_CHAIN
##[debug]loading SECRET_P12PASSWORD
##[debug]loading SECRET_AGENT_PROXYPASSWORD
##[debug]loaded 26
##[debug]System.DefaultWorkingDirectory=/path/to/agent/_work/1/s

(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:3718) Warning: Use Cipheriv for counter mode of aes-256-ctr
##[debug]---- "{\"id\":\"84526a02-e78b-4be0-ab1d-788f6ed26423\",\"package_asset_id\":\"716895fb-7522-43b3-9170-19ff61a1fdd6sdszxv\",\"upload_domain\":\"https://file.appcenter.ms\",\"token\":\"?sv=2019-02-02&sr=c&si=716895fb-7522-43b3-9170-19ff61a1fdd6&sig=zhkBOH7qfSssaHOYTwtHgykqYuzDj%2Ba78fPZ7%2ByP4p7JVc%3D&se=2020-10-06T15%3A14%3A03Z&t=distribution\",\"url_encoded_token\":\"%3fsv%3d2019-02-02%26sr%3dc%26si%3d716895fb-7522-43b3-9170-19ff61a1fdd6%26sig%3dzhkBOH7qfSHOYassasTwtHgykqYuzDj%252Ba78fPZ7%252ByP4p7JVc%253D%26se%3d2020-10-06T15%253A14%253A03Z%26t%3ddistribution\"}"
##[debug]---- http call status code: 201
##[debug]-- Uploading release...
##[debug]---- onMessage: Setting state: 0 
Message properties: {"assetId":"00000000-0000-0000-0000-000000000000","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"","VerboseMessage":"ac-fus-uploader - Setting state: 0"}
##[debug]---- onStateChanged: 0
##[debug]---- onMessage: Upload created 
Message properties: {"assetId":"716895fb-7522-43b3-9170-19ff61a5231fdd6asfasfasdg34","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"distribution","VerboseMessage":"ac-fus-uploader - Upload created"}
##[debug]---- onMessage: Setting state: 10 
Message properties: {"assetId":"716895fb-7522-43b3-9170-19ffasf61a1fdd6","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"distribution","VerboseMessage":"ac-fus-uploader - Setting state: 10"}
##[debug]---- onStateChanged: 10
##[debug]---- onProgressChanged: 1
##[debug]---- onMessage: Setting Metadata. 
Message properties: {"assetId":"716895fb-7522-43b3-9170-19ff61a1fdd6","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"distribution","fileName":"myfile","fileSize":36514258,"VerboseMessage":"ac-fus-uploader - Setting Metadata."}
##[debug]---- onMessage: Setting state: 60 
Message properties: {"assetId":"716895fb-7522-43b3-9170-19ff61a1fdd6","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"distribution","VerboseMessage":"ac-fus-uploader - Setting state: 60"}
##[debug]---- onStateChanged: 60
##[debug]---- onMessage: Upload Failed. No network detected. Please try again.FetchError: request to https://file.appcenter.ms/upload/set_metadata/716895fb-7522-43b3-9170-19ff61a1fdd6?file_name=myfile&file_size=36514258&token=%3fsv%3d2019-02-02%26sr%3dc%26si%3d716895fb-7522-43b3-9170-19ff61a1fdd6%26sig%3dzhkBOH7qfSHOYTwtHgykqYuzDj%252Ba78fPZ7%252ByP4p7JVc%253D%26se%3d2020-10-06T15%253A14%253A03Z%26t%3ddistribution failed, reason: getaddrinfo ENOTFOUND file.appcenter.ms file.appcenter.ms:443 
Message properties: {"assetId":"716895fb-7522-43b3-9170-19ff61a1fdd6","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"distribution","VerboseMessage":"ac-fus-uploader - Error Code: 60 - Upload Failed. No network detected. Please try again.FetchError: request to https://file.appcenter.ms/upload/set_metadata/716895fb-7522-43b3-9170-19ff61a1fdd6?file_name=myfile&file_size=36514258&token=%3fsv%3d2019-02-02%26sr%3dc%26si%3d716895fb-7522-43b3-9170-19ff61a1fdd6%26sig%3dzhkBOH7qfSHOYTwtHgykqYuzDj%252Ba78fPZ7%252ByP4p7JVc%253D%26se%3d2020-10-06T15%253A14%253A03Z%26t%3ddistribution failed, reason: getaddrinfo ENOTFOUND file.appcenter.ms file.appcenter.ms:443"}
##[debug]---- onMessage: UploadCancelled 
Message properties: {"assetId":"716895fb-7522-43b3-9170-19ff61a1fdd6","correlationId":"716895fb-7522-43b3-9170-19ff61a1fdd6","tenant":"distribution","VerboseMessage":"ac-fus-uploader - UploadCancelled"}
##[debug]-- Aborting release...
##[debug]---- url: https://api.appcenter.ms/v0.1/apps/org/app/release_uploads/84526a02-e78b-4be0-ab1d-788f6ed26423
##[debug]---- {}
##[debug]---- http call status code: 200
Finishing: Deploy to Visual Studio App Center

请帮助我了解原因。我尝试删除并设置代理几次,直到现在都没有成功。

1 个答案:

答案 0 :(得分:1)

我还有另外一项任务,从Azure存储库中获取来源,然后发布 构建工件,它们似乎在调试中具有代理信息 日志。但是deploy-to-visual-studio没有提及此类日志

构建中的Get Source任务的代码已烘焙到代理中。如果在设置自我代理程序时配置了.proxy文件,则此任务将遵循.proxy文件中的代理程序配置。到目前为止,只有Get Source和发行版中的Download Artifact任务已放入代理。

对于其他Azure devops管道任务,我们具有task lib的内置代理支持。代理通过环境变量为每个任务执行公开代理配置。任务作者需要使用azure-pipelines-task-lib方法来retrieve proxy configuration并在任务中处理代理。

但是,AppCenterDistributeV3任务仍在使用vsts-task-lib v2.0.5,尚不支持该代理。请参阅此page。这就是AppCenterDistribute任务中没有显示代理信息的原因。

vsts-task-lib v2.7.0 support代理。

未检测到网络。请重试。FetchError:请求 https://file.appcenter.ms/upload/set_metadata/xxxxx失败,原因: getaddrinfo ENOTFOUND file.appcenter.ms file.appcenter.ms:443

根据此错误消息,这更像是代理引起的问题。

如果选中此source code,则应该知道AppCenterDistribute任务的基本逻辑是通过Rest Api将文件上传到App Center。根据代理人的limitations,您必须设置代理配置,因为AppCenterDistribute任务正在进行Rest Api呼叫。

由于自助代理可以与Azure开发人员进行通信,因此您只需要为App Center设置白名单,以便自助代理可以通过Internet访问App Center。以下是App Center的网址:

  • api.appcenter.ms
  • api.mobile.azure.com
  • *。appcenter.ms
  • *。rink.hockeyapp.net(发行版)