0
votes

Hello Cloud Engineers,

I am trying to create a self hosted agent in azure to run by build and release pipeline. When i am configuring the linux VM as a agent, i am getting below error.

--------OS Information--------
NAME="SLES"
VERSION="15-SP2"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2"

  ___                      ______ _            _ _
 / _ \                     | ___ (_)          | (_)
/ /_\ \_____   _ _ __ ___  | |_/ /_ _ __   ___| |_ _ __   ___  ___
|  _  |_  / | | | '__/ _ \ |  __/| | '_ \ / _ \ | | '_ \ / _ \/ __|
| | | |/ /| |_| | | |  __/ | |   | | |_) |  __/ | | | | |  __/\__ \
\_| |_/___|\__,_|_|  \___| \_|   |_| .__/ \___|_|_|_| |_|\___||___/
                                   | |
        agent v2.183.1             |_|          (commit b8617e6)


>> End User License Agreements:

Building sources from a TFVC repository requires accepting the Team Explorer Everywhere End User License Agreement. This step is not required for building sources from Git repositories.

A copy of the Team Explorer Everywhere license agreement can be found at:
  /home/selfhosted-linuxagent/externals/tee/license.html

Enter (Y/N) Accept the Team Explorer Everywhere license agreement now? (press enter for N) > y

>> Connect:

Enter server URL > https://hello.world.com/
Enter authentication type (press enter for PAT) >
Enter personal access token > *****************
Error reported in diagnostic logs. Please examine the log for more details.
    - /home/selfhosted-linuxagent/_diag/Agent_20210308-094413-utc.log
The SSL connection could not be established, see inner exception.
Failed to connect.  Try again or ctrl-c to quit
Enter server URL >
1
since you are using both terms: What are you really using: Azure DevOps (cloud-hosted by Microsoft) or your self-hosted ADO Server?silent
self-hosted linux agent in azure devops serverSatyam Pandey
And I assume a) your ADO server is accessible from the internet and b) you have read the guide docs.microsoft.com/en-us/azure/devops/pipelines/agents/…silent
no my azure devops organization server is not accessible from internet, i went through the documentation but did not find any thingSatyam Pandey
well I would say then either you need to put your VM on a VNET that you connect via VPN to your network or you are out of lucksilent

1 Answers

0
votes

The error may indicate the server certificate you used on your TFS server is not trusted by the build machine. Make sure you install your self-signed ssl server certificate into the OS certificate store.

Windows: Windows certificate store
Linux: OpenSSL certificate store
macOS: OpenSSL certificate store for agent version 2.124.0 or below
       Keychain for agent version 2.125.0 or above

You can easily verify whether the certificate has been installed correctly by running few commands. You should be good as long as SSL handshake finished correctly even you get a 401 for the request.

Windows: PowerShell Invoke-WebRequest -Uri https://corp.tfs.com/tfs -UseDefaultCredentials 
Linux: curl -v https://corp.tfs.com/tfs 
macOS: curl -v https://corp.tfs.com/tfs (agent version 2.124.0 or below, curl needs to be built for OpenSSL)
       curl -v https://corp.tfs.com/tfs (agent version 2.125.0 or above, curl needs to be built for Secure Transport)

Check the following documentation for more details:

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/certificate?view=azure-devops-2020