【问题标题】:Azure DevOps - Visual studio deploy task silently fails with getaddrinfo ENOTFOUND 443Azure DevOps - Visual Studio 部署任务以静默方式失败,并出现 getaddrinfo ENOTFOUND 443
【发布时间】:2020-10-01 15:37:20
【问题描述】:

我正在运行一个管道,该管道在公司代理后面的自托管 macOS(10.15.6) 代理上生成发布版本并将其上传到应用中心。我正在为此使用 App Center Distribute 任务。 PR审批触发时,debug默认为false,流水线运行状态为成功。但是,我在应用中心找不到构建。我仔细检查了目标 ID 和应用程序段 - 似乎是有效的。

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

我还有另一个任务Get Sources from Azure repo 和 Publish build artifacts,它们的调试日志中似乎包含代理信息。但是 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

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

【问题讨论】:

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


    【解决方案1】:

    我还有其他任务 Get Sources 从 Azure repo 和 Publish 构建工件,它们的调试中似乎包含代理信息 日志。但是 deploy-to-visual-studio 并没有提到这样的日志

    构建中Get Source 任务的代码被烘焙到代理中。如果您在设置自我代理时配置了.proxy 文件,则此任务将遵循.proxy 文件中的代理代理配置。到目前为止,只有 Get SourceDownload 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: request to https://file.appcenter.ms/upload/set_metadata/xxxxx 失败,原因: getaddrinfo ENOTFOUND 文件.appcenter.ms 文件.appcenter.ms:443

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

    查看source code,你应该知道AppCenterDistribute任务的基本逻辑是通过Rest Api上传文件到App center。根据代理的limitations,由于AppCenterDistribute任务正在调用Rest Api,您必须设置代理配置。

    由于您的自代理可以与 Azure devops 通信,您只需为 App Center 设置白名单,以便自代理可以通过 Internet 访问 App Center。以下是应用中心的网址:

    • api.appcenter.ms
    • api.mobile.azure.com
    • *.appcenter.ms
    • *.rink.hockeyapp.net(分发)

    【讨论】:

    • 非常感谢您对此问题的明确答复。我们按照官方文档设置代理并配置管道将构建分发到应用中心。在我们将操作系统更新到 10.15.6 之前它运行良好。不知道后来是什么导致了这个问题。我将尝试将上述 IP 地址列入白名单,如果它工作正常,我会恢复。
    • 我尝试使用用户名和密码设置 VSTS_HTTP 环境变量;但仍然无法上传具有相同错误的构建。您能否指导如何在 macOS 代理中将这些 IP 地址列入白名单?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-25
    • 2017-01-28
    • 2023-01-26
    • 2020-05-18
    • 2020-02-23
    • 1970-01-01
    相关资源
    最近更新 更多