Agent Side Checkout fails (Linux) - Perforce password (P4PASSWD) invalid or unset
Using Team City 2017.1
I am unable to use Agent Side checkout with my Ubuntu 14.04 build agent due to the following error:
[2017-06-22 13:41:12,779] INFO - jetbrains.buildServer.VCS.P4 - Running p4 login for user myUserId in [P4Port: redacted-server-address:1666; P4User: myUserId; perforce client mapping with 1 rules, VCSRoot: "ETG" {internal id=170}]
[2017-06-22 14:07:38,029] INFO - jetbrains.buildServer.VCS.P4 - Creating P4 workspace TC_p4_LinuxBuildAgent1_964e0a7b4154cd8c_85d77afe3e61a99a
[2017-06-22 14:07:38,225] INFO - jetbrains.buildServer.VCS.P4 - Creating/updating Perforce client specification:
Client: TC_p4_LinuxBuildAgent1_964e0a7b4154cd8c_85d77afe3e61a99a
Owner: myUserId
Description:
Created by TeamCity for user myUserId.
Root: /home/someuser/BuildAgent/work/964e0a7b4154cd8c
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
Host: ubuntu
SubmitOptions: revertunchanged
LineEnd: local
View:
//ETS/GE_DEV/Build/... //TC_p4_LinuxBuildAgent1_964e0a7b4154cd8c_85d77afe3e61a99a/...
[2017-06-22 14:07:38,436] INFO - jetbrains.buildServer.VCS.P4 - Running p4 login for user myUserId in [P4Port: redacted-server-address:1666; P4User: myUserId; perforce client mapping with 1 rules, VCSRoot: "ETG" {internal id=170}]
[2017-06-22 14:07:39,016] WARN - l.patch.AbstractSourcesUpdater - Error while checkout on agent: Perforce password (P4PASSWD) invalid or unset. - while running 'p4 -c TC_p4_LinuxBuildAgent1_964e0a7b4154cd8c_85d77afe3e61a99a -u myUserId -p
redacted-server-address:1666 -H ubuntu client -i'
jetbrains.buildServer.vcs.VcsException: Perforce password (P4PASSWD) invalid or unset. - while running 'p4 -c TC_p4_LinuxBuildAgent1_964e0a7b4154cd8c_85d77afe3e61a99a -u myUserId -p redacted-server-address:1666 -H ubuntu client -i'
at jetbrains.buildServer.vcs.perforce.PerforceConnection.runCommand(PerforceConnection.java:271)
at jetbrains.buildServer.vcs.perforce.PerforceConnection.runCommand(PerforceConnection.java:257)
at jetbrains.buildServer.vcs.perforce.PerforceWorkspacesImpl.createOrUpdateWorkspace(PerforceWorkspacesImpl.java:80)
at jetbrains.buildServer.vcs.perforce.PerforceAgentSourceUpdater.createOrUpdateLocalWorkspace(PerforceAgentSourceUpdater.java:99)
at jetbrains.buildServer.vcs.perforce.PerforceAgentSourceUpdater.updateSources(PerforceAgentSourceUpdater.java:68)
at jetbrains.buildServer.vcs.perforce.PerforceAgentSourceUpdater.updatePerforceSources(PerforceAgentSourceUpdater.java:55)
at jetbrains.buildServer.vcs.perforce.PerforceSourceUpdatePolicy.updateSources(PerforceSourceUpdatePolicy.java:66)
at jetbrains.buildServer.agent.impl.vcs.AgentVcsManagerExImpl$CheckoutSupportImpl.updateSources(AgentVcsManagerExImpl.java:108)
at jetbrains.buildServer.agent.impl.patch.ProjectSourcesOnAgent$1.run(ProjectSourcesOnAgent.java:186)
at java.lang.Thread.run(Thread.java:745)
I am fairly certain our Perforce server uses ticket based auth. At the build machine, I can run p4 login (which prompts for password). This is successful and allows me to run p4 client which returns a User specification that includes an "AuthMethod: perforce" (the user specification does not include a "Password:" line).
I have tried a couple of different workarounds including:
- Creating a .p4enviro file which includes the P4PASSWD
- Setting an environment variable for P4PASSWD (in /etc/environment)
However, these have no effect...
The logs seems strange to me because the login appears to succeed (at least, no errors are logged). But, the checkout fails with the P4PASSWD error.
Also, the VCS root is using a Client mapping (but I have tried it with Client as well - same error is present).
Any help would be very appreciated!
Please sign in to leave a comment.
Do you have the password configured in the Perforce VCS Root configuration?
This was resolved with the help of members of the Stack Overflow community. Thanks.