ACR Push Error - received unexpected HTTP status: 502 Server Hangup

855 views Asked by At

I have a Azure DevOps pipeline that attempts to build and pushe a Docker container to the Azure ACR from an on-prem 2016 server. We get a 502 error when attempting to push the image via Docker BuildAndPush task. It looks like the build part succeeds but the push portion never really connects to the server. It just keeps trying until the server times-out and closes the connection. Cannot post the full log due to length, abbreviated log follows...

2020 - 10 - 02T12: 17: 37.0544736Z ##[section]Starting: Docker
2020 - 10 - 02T12: 17: 37.0757563Z ==============================================================================
    2020 - 10 - 02T12: 17: 37.0757882Z Task: Docker
2020 - 10 - 02T12: 17: 37.0758237Z Description: Build or push Docker images, login or logout, start or stop containers, or run a Docker command
2020 - 10 - 02T12: 17: 37.0758560Z Version: 2.175.0
2020 - 10 - 02T12: 17: 37.0758804Z Author: Microsoft Corporation
2020 - 10 - 02T12: 17: 37.0759076Z Help: https://aka.ms/azpipes-docker-tsg
2020 - 10 - 02T12: 17: 37.0759426Z ==============================================================================
    2020 - 10 - 02T12: 17: 41.9579527Z[command]"C:\Program Files\Docker\docker.exe" build - f E: \vsts - agent - win - x64 - 2.169.0\_work\2\s\ECP\ECP_Services\ECPServiceMonitor\Dockerfile--label com.azure.dev.image.system.teamfoundationcollectionuri = https://dev.azure.com/RiversideResearchInstitute/ --label com.azure.dev.image.system.teamproject=Dragon --label com.azure.dev.image.build.repository.name=Dragon --label com.azure.dev.image.build.sourceversion=be093d03b114952bebf2b2b18646b85768e18acc --label com.azure.dev.image.build.repository.uri=https://[email protected]/RiversideResearchInstitute/Dragon/_git/Dragon --label com.azure.dev.image.build.sourcebranchname=master --label com.azure.dev.image.build.definitionname=ECP_ServiceMonitor --label com.azure.dev.image.build.buildnumber=20201002.1 --label com.azure.dev.image.build.builduri=vstfs:///Build/Build/3466 -t ***/dragon_ecpservicemonitor:3466 E:\vsts-agent-win-x64-2.169.0\_work\2\s\ECP\ECP_Services\ECPServiceMonitor
2020 - 10 - 02T12: 17: 44.4253789Z Sending build context to Docker daemon     15MB
2020 - 10 - 02T12: 17: 44.4254443Z
2020 - 10 - 02T12: 17: 44.4278893Z Step 1 / 16 : FROM mcr.microsoft.com / dotnet / framework / runtime: 4.7.2 - 20200714 - windowsservercore - ltsc2016
2020 - 10 - 02T12: 17: 44.4687705Z-- -> 03bc99d6d25e
2020 - 10 - 02T12: 17: 44.4688221Z Step 2 / 16 : COPY.\bin\release C: \ECP_Servies\ECP_ServiceMonitor
2020 - 10 - 02T12: 17: 44.6043722Z-- -> Using cache
2020 - 10 - 02T12: 17: 44.6044210Z-- -> d778785672ce
2020 - 10 - 02T12: 17: 44.6044537Z Step 3 / 16 : WORKDIR C: \ECP_Servies\ECP_ServiceMonitor
2020 - 10 - 02T12: 17: 44.6093840Z-- -> Using cache
2020 - 10 - 02T12: 17: 44.6094309Z-- -> a502035de123
2020 - 10 - 02T12: 17: 44.6094632Z Step 4 / 16 : EXPOSE 1433 1434  61616 61617
2020 - 10 - 02T12: 17: 44.6239465Z-- -> Using cache
2020 - 10 - 02T12: 17: 44.6239867Z-- -> 999e615b2f64
2020 - 10 - 02T12: 17: 44.6240166Z Step 5 / 16 : SHELL["powershell"]
2020 - 10 - 02T12: 17: 44.6281785Z-- -> Using cache
2020 - 10 - 02T12: 17: 44.6282611Z-- -> 50a5fd6a6a04
2020 - 10 - 02T12: 17: 44.6283328Z Step 6 / 16 : RUN Add - WindowsFeature NET - Framework - 45 - Core; Invoke - Command - ScriptBlock { C: \WINDOWS\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe / username=.\gmsa_ecp / install "C:/ECP_Servies/ECP_ServiceMonitor/ECPServiceMonitor.exe"; }
2020 - 10 - 02T12: 17: 44.6376598Z-- -> Using cache
2020 - 10 - 02T12: 17: 44.6379182Z-- -> 9802a9fb4104
2020 - 10 - 02T12: 17: 44.6379706Z Step 7 / 16 : ENTRYPOINT["powershell"]
2020 - 10 - 02T12: 17: 44.6380044Z-- -> Using cache
2020 - 10 - 02T12: 17: 44.6380296Z-- -> c5b81e5c33df
2020 - 10 - 02T12: 17: 44.6380615Z Step 8 / 16 : LABEL com.azure.dev.image.build.buildnumber = 20201002.1
2020 - 10 - 02T12: 17: 44.7097891Z-- -> Running in 60b830e64648
2020 - 10 - 02T12: 17: 49.4842440Z Removing intermediate container 60b830e64648
2020 - 10 - 02T12: 17: 49.4843676Z-- -> 1a8a7d26b43a
2020 - 10 - 02T12: 17: 49.4844377Z Step 9 / 16 : LABEL com.azure.dev.image.build.builduri = vstfs:///Build/Build/3466
2020 - 10 - 02T12: 17: 49.5469995Z-- -> Running in 53cc325504cc
2020 - 10 - 02T12: 17: 51.0298251Z Removing intermediate container 53cc325504cc
2020 - 10 - 02T12: 17: 51.0299114Z-- -> 63ea4c797537
2020 - 10 - 02T12: 17: 51.0299661Z Step 10 / 16 : LABEL com.azure.dev.image.build.definitionname = ECP_ServiceMonitor
2020 - 10 - 02T12: 17: 51.0819557Z-- -> Running in 1f240561cde9
2020 - 10 - 02T12: 17: 52.3775245Z Removing intermediate container 1f240561cde9
2020 - 10 - 02T12: 17: 52.3776202Z-- -> c34eda8e0ad4
2020 - 10 - 02T12: 17: 52.3776829Z Step 11 / 16 : LABEL com.azure.dev.image.build.repository.name = Dragon
2020 - 10 - 02T12: 17: 52.3971366Z-- -> Running in b02dd84163f0
2020 - 10 - 02T12: 17: 53.7445375Z Removing intermediate container b02dd84163f0
2020 - 10 - 02T12: 17: 53.7446537Z-- -> bab2a3d44b56
2020 - 10 - 02T12: 17: 53.7447357Z Step 12 / 16 : LABEL com.azure.dev.image.build.repository.uri = https://[email protected]/RiversideResearchInstitute/Dragon/_git/Dragon
2020 - 10 - 02T12: 17: 53.7640156Z-- -> Running in 1c773383a440
2020 - 10 - 02T12: 17: 55.0947497Z Removing intermediate container 1c773383a440
2020 - 10 - 02T12: 17: 55.0953799Z-- -> 5bec6fe76ae6
2020 - 10 - 02T12: 17: 55.0954386Z Step 13 / 16 : LABEL com.azure.dev.image.build.sourcebranchname = master
2020 - 10 - 02T12: 17: 55.1184335Z-- -> Running in 99d44bc949f2
2020 - 10 - 02T12: 17: 56.4406519Z Removing intermediate container 99d44bc949f2
2020 - 10 - 02T12: 17: 56.4407503Z-- -> 96df8be617a7
2020 - 10 - 02T12: 17: 56.4408181Z Step 14 / 16 : LABEL com.azure.dev.image.build.sourceversion = be093d03b114952bebf2b2b18646b85768e18acc
2020 - 10 - 02T12: 17: 56.4598788Z-- -> Running in 1e4407ca3082
2020 - 10 - 02T12: 17: 57.7595273Z Removing intermediate container 1e4407ca3082
2020 - 10 - 02T12: 17: 57.7596230Z-- -> 15b6efae3350
2020 - 10 - 02T12: 17: 57.7596974Z Step 15 / 16 : LABEL com.azure.dev.image.system.teamfoundationcollectionuri = https://dev.azure.com/RiversideResearchInstitute/
2020 - 10 - 02T12: 17: 57.7846262Z-- -> Running in cd825f791461
2020 - 10 - 02T12: 17: 59.0800687Z Removing intermediate container cd825f791461
2020 - 10 - 02T12: 17: 59.0801636Z-- -> f8aea1acdddb
2020 - 10 - 02T12: 17: 59.0802274Z Step 16 / 16 : LABEL com.azure.dev.image.system.teamproject = Dragon
2020 - 10 - 02T12: 17: 59.1187395Z-- -> Running in dfc0655cf951
2020 - 10 - 02T12: 18: 00.4057180Z Removing intermediate container dfc0655cf951
2020 - 10 - 02T12: 18: 00.4059870Z-- -> 9ae8ab2a80c8
2020 - 10 - 02T12: 18: 00.4250146Z Successfully built 9ae8ab2a80c8
2020 - 10 - 02T12: 18: 00.4314486Z Successfully tagged *** /dragon_ecpservicemonitor:3466
2020 - 10 - 02T12: 18: 01.8536964Z[command]"C:\Program Files\Docker\docker.exe" images
2020 - 10 - 02T12: 18: 06.3544142Z[command]"C:\Program Files\Docker\docker.exe" push *** /dragon_ecpservicemonitor:3466
2020 - 10 - 02T12: 18: 06.3554760Z REPOSITORY                                                       TAG                                         IMAGE ID            CREATED             SIZE
2020 - 10 - 02T12: 18: 06.3556887Z *** /dragon_ecpservicemonitor   3466                                        9ae8ab2a80c8        3 seconds ago       13.7GB
2020 - 10 - 02T12: 18: 06.3558931Z *** /dragon_ecpservicemonitor   3424                                        bb466ef152cc        2 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3576237Z *** /dragon_ecpservicemonitor   3421                                        ebf4212faf04        3 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3577439Z *** /dragon_ecpservicemonitor   3418                                        7f22cdb7f261        3 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3585528Z *** /dragon_ecpservicemonitor   3410                                        d13592901754        3 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3586647Z *** /dragon_ecpservicemonitor   3403                                        fb45141be45c        3 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3587683Z *** /dragon_ecpservicemonitor   3402                                        268864c52f33        3 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3589455Z *** /dragon_ecpservicemonitor   3390                                        887a11cedca4        4 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3594634Z *** /dragon_ecpservicemonitor   3388                                        60bda4f46c8d        4 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3601582Z *** /dragon_ecpservicemonitor   3387                                        b9fa6f52e289        4 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3617699Z *** /dragon_ecpservicemonitor   3386                                        0840f51c4b0e        4 days ago          13.7GB
2020 - 10 - 02T12: 18: 06.3641232Z *** /ecp-web                    0.0.69                                      e7731cf09ba4        4 weeks ago         14.3GB
2020 - 10 - 02T12: 18: 06.3643426Z ecp - web                                                          0.0.67                                      10da0249367d        5 weeks ago         14.3GB
2020 - 10 - 02T12: 18: 06.3644142Z ecp - servicemonitor                                               0.0.32                                      3fa1f604f04a        5 weeks ago         14.1GB
2020 - 10 - 02T12: 18: 06.3644816Z ecp - webapi                                                       0.0.43                                      d07e9f1c8b83        7 weeks ago         14.3GB
2020 - 10 - 02T12: 18: 06.3645489Z ecp - amq                                                          0.0.16                                      069e3d4bb63c        8 weeks ago         14.7GB
2020 - 10 - 02T12: 18: 06.3646155Z ecp - datamanager                                                  0.0.16                                      65a98b2b5245        2 months ago        14.1GB
2020 - 10 - 02T12: 18: 06.3646824Z mcr.microsoft.com / dotnet / framework / runtime                       4.7.2 - 20200714 - windowsservercore - ltsc2016   03bc99d6d25e        2 months ago        13.4GB
2020 - 10 - 02T12: 18: 06.3647494Z mcr.microsoft.com / dotnet / framework / runtime                       3.5 - windowsservercore - ltsc2016              5928ce0239e0        2 months ago        13.9GB
2020 - 10 - 02T12: 18: 06.3648171Z sixeyed / registry                                                 latest                                      02ec0cf9ff76        19 months ago       1.21GB
2020 - 10 - 02T12: 18: 06.3648841Z mcr.microsoft.com / windows / servercore / iis                         windowsservercore - 10.0.14393.953            9ee7a48b9ab3        3 years ago         10.4GB
2020 - 10 - 02T12: 18: 06.5229518Z The push refers to repository[*** /dragon_ecpservicemonitor]
2020 - 10 - 02T12: 18: 06.9628065Z 6c059191ee81: Preparing
2020 - 10 - 02T12: 18: 06.9637986Z 22babd9c7848: Preparing
2020 - 10 - 02T12: 18: 06.9638884Z 7a6bc11315f5: Preparing
2020 - 10 - 02T12: 18: 06.9639259Z daeda516fb1e: Preparing
2020 - 10 - 02T12: 18: 06.9639566Z fb9094de1d49: Preparing
2020 - 10 - 02T12: 18: 06.9639834Z 7b4090562bb9: Preparing
2020 - 10 - 02T12: 18: 06.9640113Z c8a21119b940: Preparing
2020 - 10 - 02T12: 18: 06.9640377Z 9496824d187c: Preparing
...
2020 - 10 - 02T12: 18: 06.9784812Z b5980fd82c50: Waiting
2020 - 10 - 02T12: 18: 06.9785080Z 2fcac74e92ca: Waiting
2020 - 10 - 02T12: 18: 06.9785619Z 6f91a6586968: Waiting
2020 - 10 - 02T12: 18: 06.9785899Z 4ff590c406a8: Waiting
2020 - 10 - 02T12: 18: 06.9786171Z fb6c6bd90655: Waiting
2020 - 10 - 02T12: 18: 06.9786454Z f358be10862c: Waiting
2020 - 10 - 02T12: 18: 38.3221159Z daeda516fb1e: Retrying in 5 seconds
2020 - 10 - 02T12: 18: 38.3221785Z 7a6bc11315f5: Retrying in 5 seconds
2020 - 10 - 02T12: 18: 38.4305978Z fb9094de1d49: Retrying in 5 seconds
2020 - 10 - 02T12: 18: 38.4306518Z 22babd9c7848: Retrying in 5 seconds
2020 - 10 - 02T12: 18: 38.5383110Z 6c059191ee81: Retrying in 5 seconds
2020 - 10 - 02T12: 18: 39.3345714Z 7a6bc11315f5: Retrying in 4 seconds
2020 - 10 - 02T12: 18: 39.3346281Z daeda516fb1e: Retrying in 4 seconds
...

2020 - 10 - 02T12: 20: 59.4487728Z daeda516fb1e: Retrying in 2 seconds
2020 - 10 - 02T12: 20: 59.8677439Z fb9094de1d49: Retrying in 1 second
2020 - 10 - 02T12: 21: 00.0259636Z 7a6bc11315f5: Retrying in 1 second
2020 - 10 - 02T12: 21: 00.1842897Z 6c059191ee81: Retrying in 1 second
2020 - 10 - 02T12: 21: 00.2957327Z 22babd9c7848: Retrying in 1 second
2020 - 10 - 02T12: 21: 00.4463498Z daeda516fb1e: Retrying in 1 second
2020 - 10 - 02T12: 21: 31.8188000Z received unexpected HTTP status: 502 Server Hangup
2020 - 10 - 02T12: 21: 31.8384859Z ##[error]The process 'C:\Program Files\Docker\docker.exe' failed with exit code 1
2020 - 10 - 02T12: 21: 31.8391980Z ##[section]Finishing: Docker
1

There are 1 answers

5
Charles Xu On

You got the 502 error, it means you cannot connect to the ACR server. The possible reason is that you set the wrong image name. To push images to ACR, you need to set the image names like yourACR.azurecr.io/imageName:tag, and then push it with the ACR credential.