Azure DevOps - Visual studio deploy task silently fails with getaddrinfo ENOTFOUND 443

1.9k views Asked by At

I am running a pipeline which generates and uploads release build to app center, on a self hosted macOS(10.15.6) agent behind a corporate proxy. I am using the App Center Distribute task for this. When it was triggered by PR approval, debug was false by default and the pipeline run status was successful. But, I could not find the build in the app center. I double checked the destination ID and app slug -- seems to be valid.

Problem: Then I ran the pipeline manually with debug as true and below are the logs. As you can see, the task throws an error reason: getaddrinfo ENOTFOUND file.appcenter.ms file.appcenter.ms:443 while it tries to upload the build to app center, and silently ignores it and immediately tries to cancel the release. Even though the exception has occurred, it is ignored and build release is cancelled -- due to this, the task is marked as successful and release is nowhere in app center.

I also have another tasks Get Sources from Azure repo and Publish build artifacts, which seem to be having the proxy info in their debug logs. But the deploy-to-visual-studio does not mention such logs and marks itself succeeded in less than 5 seconds.

##[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://learn.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

Please help me understand the reason for this. I have tried to remove and set up the agent few times, no success till now.

1

There are 1 answers

2
Mengdi Liang On

I also have another tasks Get Sources from Azure repo and Publish build artifacts, which seem to be having the proxy info in their debug logs. But the deploy-to-visual-studio does not mention such logs

The code for the Get Source task in builds is baked into the agent. This task will follow the agent proxy configuration from the .proxy file if you configured the .proxy file when set up the self agent. As of now, only Get Source and the Download Artifact task in release are baked into agent.

For other Azure devops pipeline tasks, we have built-in proxy support to task lib. The agent exposes proxy configuration via environment variables for every task execution. Task authors need to use azure-pipelines-task-lib methods to retrieve proxy configuration and handle the proxy within their task.

BUT, AppCenterDistributeV3 task is still using vsts-task-lib v2.0.5, which proxy isn't supported yet. Refer to this page. That's why there's no proxy info displayed in AppCenterDistribute task.

vsts-task-lib v2.7.0 support proxy.

No network detected. Please try again.FetchError: request to https://file.appcenter.ms/upload/set_metadata/xxxxx failed, reason: getaddrinfo ENOTFOUND file.appcenter.ms file.appcenter.ms:443

According to this error message, this is more like an issue cause by proxy.

If you check this source code, you should knew that the basic logic of AppCenterDistribute task is uploading files to App center via Rest Api. According to the agent's limitations, you have to set up proxy config since AppCenterDistribute task is making Rest Api call.

Since your self agent can communicate with Azure devops, you just need to set whitelist for App Center so that the self agent can access App Center over Internet. Below are the URLs for App Center:

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