0

Our self-hosted build agent fails on publishing the test results to Azure DevOps (MS Cloud, not on-premise) sometimes.

We configured the agent according to the documentation on https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/proxy?view=azure-devops&tabs=windows by passing the proxy settings in the config.cmd.

We have the following task description:

steps:
- task: PublishTestResults@2
  displayName: 'Publish Test Results **/junit*.xml'
  inputs:
    testResultsFiles: '**/junit*.xml'
    testRunTitle: 'Jest unit tests'
  continueOnError: true
  condition: succeededOrFailed()
  timeoutInMinutes: 2

In most cases the build agent takes round about 15minutes to run the "Publish Test Results */junit.xml" job. (Pipeline in Azure DevOps). Since it sometimes took less time (only 6 seconds) i am thinking that something goes wrong in this task. Really shouldn't take that much time for this task.

Task returns following warning:

##[warning]Failed to upload file junit.xml to Blob Transfer exception with errorcode Unknown, exception message Microsoft.Azure.Storage.DataMovement.TransferException: The transfer failed. ---> Microsoft.Azure.Storage.StorageException: Fehler beim Senden der Anforderung. ---> System.Net.Http.HttpRequestException: Fehler beim Senden der Anforderung. ---> System.Net.WebException: Der Remoteserver hat einen Fehler zurückgegeben: (407) Proxyauthentifizierung erforderlich.

Sorry for the warning message being in German! Can try to get in English if necessary.

Does somebody know where the error/warning comes from? Grateful for any help, and sorry if this issue is not being created in perfection, i promise i will do better next time. I am learning!

For those who suggest using environment variables for the proxy configuration - unfortunately this is not a option. Thanks in advance!

Arne Klein
  • 662
  • 5
  • 12

2 Answers2

0

You are having http 407 error. So it is Proxy Authentication Required client error status response code. Please check: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/proxy?view=azure-devops&tabs=windows

MoonHorse
  • 1,966
  • 2
  • 24
  • 46
  • Hi, I'm working with fra-kuk and he forgot to mention, that the proxy is already configured like described in the link. I changed the description already, but it won't be visible until someone approves of it. – Arne Klein May 26 '20 at 16:18
  • On which OS, is the agent running? What is your agent version? – MoonHorse May 26 '20 at 16:21
  • Its running on WS 2019, I can't check the version at the moment, but it should be something like 2.166.x – Arne Klein May 26 '20 at 19:46
  • Agent version is 2.168.2 – fra-kuk May 27 '20 at 12:51
  • The firewall acts like a proxy. The running authentication mode is Active Directory SSO. Could that be a problem? – fra-kuk May 29 '20 at 09:09
  • Maybe. You may configure the proxy with an exception to not require authentication for required domains such as dev.azure.com – MoonHorse May 29 '20 at 09:20
0

Problem solved! The problem was that there were some URLs that needed to be whitelisted. The firewall blocked them before.

Works fine now.