Child pages
  • Getting error Connection failed! upon testing connection to Perforce VCS Root from TeamCity running as a Windows service using SYSTEM account
Skip to end of metadata
Go to start of metadata

Challenge

If Perforce server uses SSL-encrypted connection, adding a Perforce VCS Root on a Windows-based TeamCity server running as a services using SYSTEM account may result in the error below.

Connection failed!

p4 error: "The authenticity of '172.20.186.72:1666' can't be established,
this may be your first attempt to connect to this P4PORT.
The fingerprint for the key sent to your client is
E5:99:F1:14:42:4E:AC:B5:BD:ED:4E:26:F2:81:A8:68:EF:33:3C:3C
To allow connection use the 'p4 trust' command." - while running "p4 -u Anatoly.Cherenkov -p ssl:172.20.186.72:1666 stream -o -v //mydepot/perforceLinuxMain"

Cause

The account used to start TeamCity service does not have the Perforce server's SSL certificate fingerprint in its p4trust.txt file. The error might persist even after you use p4 trust command if TeamCity is using a different account from the one using which the command is run.

Solution

Add the perforce port and SSL fingerprint into p4trust.txt file under the %USERPROFILE% folder of TeamCity account. File content example:

172.20.186.72:1666=**++**:E5:99:F1:14:42:4E:AC:B5:BD:ED:4E:26:F2:81:A8:68:EF:33:3C:3C

If SYSTEM account is used to start TeamCity service, the %USERPROFILE% folder is C:\Windows\System32\config\systemprofile.

  • No labels