Jenkins and Perforce password issue

161 views
Skip to first unread message

David Rabinowitz

unread,
Sep 21, 2014, 2:35:29 PM9/21/14
to jenkins...@googlegroups.com

I'm using Jenkins with Perforce to build a maven project, and I need to use the maven-release plugin. I have configured my project and the build is going well, until I have tried to use the maven release plugin using the relevant Jenkins plugin. With dry run everything went well, but when trying to make the release I got this nasty error message (below). For some reason the Jenkins cannot connect to the P4 server. Also, the "Expose P4PASSWD in environment" is checked.

Answering some questions I got

  • When you say dry run, do you perform it using Jenkins only or from command line? Both
  • Where exactly are you setting the password for P4? In the 'Global credentials' section? In the project configuration, under Source Code Management->Perforce->Password
  • Where are you getting the option of 'Expose P4PASSWD in environment'? Same place
  • In the log above, is this line setting up the password for P4 "d:\program files\perforce\p4.exe" setThis line exposes the P4 parameters - all of them (including P4PASSWD) are set correctly. I have removed the actual values from obvious reasons...

This is the error message:

Started by user David 
[EnvInject] - Loading node environment variables.
Building on master in workspace X:\hudson\jobs\myproject\workspace
Using master perforce client: myproject
[workspace] $ "D:\Program Files\Perforce\p4.exe" workspace -o myproject
[workspace] $ "D:\Program Files\Perforce\p4.exe" login -a -p
[workspace] $ "D:\Program Files\Perforce\p4.exe" -P *** workspace -o myproject
Last build changeset: 1062732
[workspace] $ "D:\Program Files\Perforce\p4.exe" -P *** changes -s submitted -m 1 //myproject/...
Sync'ing workspace to changelist 1062732 (forcing sync of unchanged files).
[workspace] $ "D:\Program Files\Perforce\p4.exe" -P *** -s sync -f //myproject/...@1062732
Sync complete, took 108 ms
[workspace] $ cmd /c call D:\apache-tomcat-6\temp\hudson368187580614800030.bat

X:\hudson\jobs\myproject\workspace>"d:\program files\perforce\p4.exe" set 
P4CLIENT=myproject
P4PASSWD=***
P4PORT=***
P4USER=***

X:\hudson\jobs\myproject\workspace>exit 0 
Parsing POMs
Downloaded artifact ...
[workspace] $ D:/ins/Java/jdk1.7.0_10.x64/bin/java -DcreateChecksum=true -cp X:\hudson\plugins\maven-plugin\WEB-INF\lib\maven31-agent-1.4.jar;X:\hudson\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1\boot\plexus-classworlds-2.5.1.jar;X:\hudson\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1/conf/logging jenkins.maven3.agent.Maven31Main X:\hudson\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1 D:\apache-tomcat-6\webapps\hudson\WEB-INF\lib\remoting-2.37.jar X:\hudson\plugins\maven-plugin\WEB-INF\lib\maven31-interceptor-1.4.jar X:\hudson\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.4.jar 51470
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f X:\hudson\jobs\myproject\workspace\pom.xml -DdevelopmentVersion=0.0.2-SNAPSHOT -DreleaseVersion=0.0.1 -Dresume=false release:prepare release:perform -X
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 18:22:22+0300)
Maven home: X:\hudson\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1
Java version: 1.7.0_10, vendor: Oracle Corporation
Java home: D:\ins\Java\jdk1.7.0_10.x64\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows server 2008", version: "6.0", arch: "amd64", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from X:\hudson\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1\conf\settings.xml
[DEBUG] Reading user settings from C:\...\.m2\settings.xml
[INFO] Scanning for projects...
[INFO] Downloading: ...
[INFO] Downloaded: ...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] proj-parent
[INFO] proja
[INFO] projb
[INFO] projc
[INFO] test-reactor
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test-reactor 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-release-plugin:2.5:prepare (default-cli) @ test-reactor ---
[INFO] Verifying that there are no local modifications...
[INFO]   ignoring changes on: **\release.properties, **\pom.xml.next, **\pom.xml.releaseBackup, **\pom.xml.backup, **\pom.xml.branch, **\pom.xml.tag
[INFO] No password found, proceeding without it.
[DEBUG] SCM path in pom: //depot/myproject
[DEBUG] Executing: cmd.exe /X /C "p4 -p *** where X:\hudson\jobs\myproject\workspace\pom.xml"
[DEBUG] Perforce password (P4PASSWD) invalid or unset.
[DEBUG] cannot find depot => using //depot/myproject
[DEBUG] Executing cmd.exe /X /C "p4 -d X:\hudson\jobs\myproject\workspace -p *** opened //depot/myproject/..."
[ERROR] CommandLineException Exit code: 1 - Perforce password (P4PASSWD) invalid or unset.

Dan Tran

unread,
Sep 22, 2014, 12:40:40 AM9/22/14
to jenkins...@googlegroups.com

The combination of new P4Jenkins[1] and P4Maven[2]  works well with maven-release-plugin. you will need cut an internal release of p4maven

-D




[2] https://swarm.workshop.perforce.com/files/guest/dantran/p4maven . p4maven has not officially release yet , do have snapshot deploy at sonatype

Jan Seidel

unread,
Sep 22, 2014, 5:16:47 AM9/22/14
to jenkins...@googlegroups.com
Is P4CHARSET set to winansi?
Maybe you should write the P4PAASWD into a text file and inject it with env_inject.
This would make the testing a bit easier.

You can then find whitespace characters and have no encoding trouble with the password.
If this works is your problem probably a matter of encoding, typo or the like.

P4CHARSET=winansi has to be set explicitly as far as I recall or it will got Unicode.
Well, if your P4 Servers runs with the code page. But it is likely.

David Rabinowitz

unread,
Sep 22, 2014, 7:41:56 AM9/22/14
to jenkins...@googlegroups.com
Hi Dan,

Thanks, I will check if I can take this plugin

David

David Rabinowitz

unread,
Sep 22, 2014, 7:43:47 AM9/22/14
to jenkins...@googlegroups.com
No, P$CHARSET is not set, but the password contains only US-ASCII characters. Also, I have verified there is no typo.
...
Reply all
Reply to author
Forward
0 new messages