[JIRA] [perforce-plugin] (JENKINS-28367) perforce plugin don't support P4 ticket authentication

19 views
Skip to first unread message

ybdesire@gmail.com (JIRA)

unread,
May 13, 2015, 2:24:01 AM5/13/15
to jenkinsc...@googlegroups.com
Bin Yin updated an issue
 
Jenkins / Bug JENKINS-28367
perforce plugin don't support P4 ticket authentication
Change By: Bin Yin
Priority: Minor Critical
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

ybdesire@gmail.com (JIRA)

unread,
May 13, 2015, 2:24:02 AM5/13/15
to jenkinsc...@googlegroups.com
Bin Yin created an issue
Issue Type: Bug Bug
Assignee: Rob Petti
Components: perforce-plugin
Created: 13/May/15 6:23 AM
Environment: perforce plugin version: 1.3.33
OS: windows
web browser: all
JAVA version:1.7.0_25
CI Architecture: master-slave
Priority: Minor Minor
Reporter: Bin Yin

If the credential for job is P4 ticket auth, we cannot sync the source code from P4, and get the error below. But the non-ticket auth credential can be used to sync source code from P4 correctly.

It seems current perforce plugin don't support P4 ticket authentication.

ERROR:
----------------------------------------------------------------
[EnvInject] - Loading node environment variables.
Building remotely on Slave31 (SlaveGroup3) in workspace C:\CI\workspace\Src-Main
Using remote perforce client: Beacon-Src-

Main -461461931
[Src-AppDNA-AppDNA-Main] $ p4 workspace o Beacon-Src-Main -461461931
[Src-AppDNA-AppDNA-Main] $ p4 login -a -p
[Src-AppDNA-AppDNA-Main] $ p4 workspace o Beacon-Src-Main -461461931
Caught exception communicating with perforce. Perforce password (P4PASSWD) invalid or unset.com.tek42.perforce.PerforceException: Perforce password (P4PASSWD) invalid or unset.
at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:406)
at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:301)
at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:61)
at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1641)
at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1602)
at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:907)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1265)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
at hudson.model.Run.execute(Run.java:1718)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
ERROR: Unable to communicate with perforce. Perforce password (P4PASSWD) invalid or unset.
Skipped archiving because build is not successful
Sending e-mails to: svcacc...@xxx.com
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE

rob.petti@gmail.com (JIRA)

unread,
May 13, 2015, 9:32:02 AM5/13/15
to jenkinsc...@googlegroups.com
Rob Petti assigned an issue to Unassigned
Change By: Rob Petti
Assignee: Rob Petti

rob.petti@gmail.com (JIRA)

unread,
May 13, 2015, 9:34:01 AM5/13/15
to jenkinsc...@googlegroups.com
Rob Petti commented on Bug JENKINS-28367
 
Re: perforce plugin don't support P4 ticket authentication

How have you passed the ticket into the plugin? It should work fine if you just specify it in place of the password. Alternatively, add it manually to your tickets file on your slave.

ybdesire@gmail.com (JIRA)

unread,
May 13, 2015, 10:07:01 PM5/13/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

Thanks Rob for the update!
I did't passed the ticket into plugin. It works successfully if I passed the ticket into plugin instead of password. But the ticket is changed dynamically by P4 server, so it's not a good way to get & input the ticket manually for the periodically executing job.
Is it possible to make the plugin support ticket auth by just input password as the non-ticket auth?

ybdesire@gmail.com (JIRA)

unread,
May 13, 2015, 10:10:01 PM5/13/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

It seems the issue can be solved if the login command "p4 login -a -p" could be modified to "p4 login". Since we can use "p4 login" to login P4 with only password.

rob.petti@gmail.com (JIRA)

unread,
May 14, 2015, 12:29:01 AM5/14/15
to jenkinsc...@googlegroups.com

I'm not sure I follow... The plugin already supports tickets as much as possible. When you specify a password, be it a ticket or an actual password, the plugin will use "p4 login -a -p" to get a valid ticket from the perforce server, and will continue to use it for as long as it's valid.

If you want to use ticket auth permanently, then you will need to get a ticket that doesn't expire. If you want the plugin to be able to get a new ticket whenever it expires, then you will obviously need to give it the password.

ybdesire@gmail.com (JIRA)

unread,
May 14, 2015, 4:19:04 AM5/14/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

Thanks Rob for the comment.
The command "p4 login -a -p" don't support my P4 ticket auth(as below). But I can use "p4 login" to login P4.

C:\Users\xxx>p4 login -a -p
User not allowed to create a ticket that is valid on all host machines.

ybdesire@gmail.com (JIRA)

unread,
May 14, 2015, 4:21:01 AM5/14/15
to jenkinsc...@googlegroups.com
Bin Yin edited a comment on Bug JENKINS-28367
Thanks Rob for the comment.
The command "p4 login -a -p" don't support my P4 ticket auth(as below). But I can use "p4 login" to login P4.
-----------------------------------------------------------------------------------------------
C:\Users\xxx>p4 login -a -p
User not allowed to create a ticket that is valid on all host machines.

rob.petti@gmail.com (JIRA)

unread,
May 14, 2015, 9:35:01 AM5/14/15
to jenkinsc...@googlegroups.com

That looks like an issue with the configuration of your server. Unfortunately there's nothing I can do about that.

rob.petti@gmail.com (JIRA)

unread,
May 14, 2015, 2:55:01 PM5/14/15
to jenkinsc...@googlegroups.com

The best I can do is provide an automatic fallback to use a machine-specific ticket in the event that a universal one cannot be provided due to the server configuration. Note that this will potentially re-introduce a race condition that sometimes occurs when using the same home directory across multiple machines.

rob.petti@gmail.com (JIRA)

unread,
May 14, 2015, 2:56:01 PM5/14/15
to jenkinsc...@googlegroups.com
Rob Petti edited a comment on Bug JENKINS-28367
The best I can do is provide an automatic fallback to use a machine-specific ticket in the event that a universal one cannot be provided due to the server configuration. Note that this will potentially re-introduce a race condition that sometimes occurs when  using the same home directory across  running builds on  multiple machines.

scm_issue_link@java.net (JIRA)

unread,
May 14, 2015, 2:58:02 PM5/14/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Rob Petti
Path:
src/main/java/com/tek42/perforce/parse/AbstractPerforceTemplate.java
http://jenkins-ci.org/commit/perforce-plugin/55762a900e64b9f5c3c49699cea30f0b06846dfb
Log:
JENKINS-28367 fallback on 'p4 login -p' when '-a' fails

ybdesire@gmail.com (JIRA)

unread,
May 22, 2015, 4:28:02 AM5/22/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

Thanks for the code change for the fix.
I think the fix can resolved this issue.

rob.petti@gmail.com (JIRA)

unread,
May 22, 2015, 12:22:01 PM5/22/15
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Jun 24, 2015, 3:36:04 PM6/24/15
to jenkinsc...@googlegroups.com

Code changed in jenkins


User: Rob Petti
Path:
src/main/java/com/tek42/perforce/parse/AbstractPerforceTemplate.java

scm_issue_link@java.net (JIRA)

unread,
Jun 24, 2015, 3:36:04 PM6/24/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Matthew DeTullio
Path:
src/main/java/com/tek42/perforce/parse/AbstractPerforceTemplate.java
http://jenkins-ci.org/commit/perforce-plugin/c1a842020a4b950344c9b6906b129723d058bc8b
Log:


JENKINS-28367 Add error message to allow fallback to 'p4 login -p'.

checkAuthnErrors was not detecting the error message for 'p4 login -a
-p' when the '-a' option is not allowed by the server. Added the
message to p4errors so that a PerforceException would be thrown and
cause the fallback implemented in 55762a90 to occur.

ybdesire@gmail.com (JIRA)

unread,
Sep 16, 2015, 5:38:03 AM9/16/15
to jenkinsc...@googlegroups.com
Bin Yin edited a comment on Bug JENKINS-28367
[~rpetti], How can I  test  add  the .hpi file  to my Jenkins

ybdesire@gmail.com (JIRA)

unread,
Sep 16, 2015, 5:38:03 AM9/16/15
to jenkinsc...@googlegroups.com

rob.petti@gmail.com (JIRA)

unread,
Sep 16, 2015, 10:14:04 AM9/16/15
to jenkinsc...@googlegroups.com

Install it using the update manager like you would any other plugin. There's an option to install by uploading a jpi/hpi file, rather than from the repository.

ybdesire@gmail.com (JIRA)

unread,
Sep 17, 2015, 8:15:03 AM9/17/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

Thanks Rob Petti.
I've updated my p4 plugin to "1.3.35-SNAPSHOT (private-05/22/2015 10:03-rpetti)", and Jenkins has been restarted after updating. But the the private plugin still login by command "p4 login -a -p". It seems the code change at here https://github.com/jenkinsci/perforce-plugin/commit/55762a900e64b9f5c3c49699cea30f0b06846dfb is not work, so command "login -p" never ran. Errors below:

Started by upstream project "Src-xxx" build number 17
originally caused by:
Started by user bin


[EnvInject] - Loading node environment variables.

Building remotely on Slave20 (SlaveGroup2) in workspace C:\CI\workspace\Src-xxx
Using remote perforce client: xxx--461461963
[Src-xxx] $ p4 workspace

o xxx -461461963
[Src-xxx] $ p4 login -a -p
[Src-xxx] $ p4 workspace o xxx -461461963

Caught exception communicating with perforce. Perforce password (P4PASSWD) invalid or unset.com.tek42.perforce.PerforceException: Perforce password (P4PASSWD) invalid or unset.
at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:406)
at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:301)
at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:61)
at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1641)
at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1602)
at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:907)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)

ERROR: Unable to communicate with perforce. Perforce password (P4PASSWD) invalid or unset.
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 20 second

Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE

ybdesire@gmail.com (JIRA)

unread,
Sep 17, 2015, 8:16:04 AM9/17/15
to jenkinsc...@googlegroups.com
Bin Yin updated an issue
Change By: Bin Yin
If the credential for job is P4 ticket auth, we cannot sync the source code from P4, and get the error below. But the non-ticket auth credential can be used to sync source code from P4 correctly.

It seems current perforce plugin don't support P4 ticket authentication.

ERROR:
----------------------------------------------------------------

[EnvInject] - Loading node environment variables.
Building remotely on Slave31 (SlaveGroup3) in workspace C:\CI\workspace\Src-Main
Using remote perforce client: Beacon-Src--Main--461461931
[Src-
AppDNA-AppDNA-Main xxx ] $ p4 workspace -o Beacon-Src-Main--461461931
[Src-
AppDNA-AppDNA-Main xxx ] $ p4 login -a -p
[Src-
AppDNA-AppDNA-Main xxx ] $ p4 workspace -o Beacon-Src-Main--461461931

Caught exception communicating with perforce. Perforce password (P4PASSWD) invalid or unset.com.tek42.perforce.PerforceException: Perforce password (P4PASSWD) invalid or unset.
at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:406)
at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:301)
at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:61)
at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1641)
at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1602)
at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:907)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1265)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
at hudson.model.Run.execute(Run.java:1718)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)

ERROR: Unable to communicate with perforce. Perforce password (P4PASSWD) invalid or unset.
Skipped archiving because build is not successful
Sending e-mails to:  svcacct_gsnkg  xxx @xxx.com

Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE

rob.petti@gmail.com (JIRA)

unread,
Sep 17, 2015, 12:02:02 PM9/17/15
to jenkinsc...@googlegroups.com
Rob Petti commented on Bug JENKINS-28367
 
Re: perforce plugin don't support P4 ticket authentication

Did you restart jenkins after installing the snapshot?

rob.petti@gmail.com (JIRA)

unread,
Sep 17, 2015, 12:05:02 PM9/17/15
to jenkinsc...@googlegroups.com

Scratch that, the snapshot you are using is from before my changes were fixed by Matthew.

ybdesire@gmail.com (JIRA)

unread,
Sep 17, 2015, 9:23:04 PM9/17/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

Rob Petti Jenkins has been restarted after installing the snapshot. Would you send me a correctly fixed snapshot? I can help verify the fixing.

rob.petti@gmail.com (JIRA)

unread,
Sep 18, 2015, 12:02:04 AM9/18/15
to jenkinsc...@googlegroups.com

ybdesire@gmail.com (JIRA)

unread,
Oct 19, 2015, 11:19:02 PM10/19/15
to jenkinsc...@googlegroups.com
Bin Yin commented on Bug JENKINS-28367

Rob Petti - This issue has been fixed from my verification for https://dl.dropboxusercontent.com/u/1897231/perforce.hpi

Which version of official release contains the fixing?

rob.petti@gmail.com (JIRA)

unread,
Oct 19, 2015, 11:20:02 PM10/19/15
to jenkinsc...@googlegroups.com
Rob Petti resolved as Fixed
 
Change By: Rob Petti
Status: Open Resolved
Resolution: Fixed

rob.petti@gmail.com (JIRA)

unread,
Oct 19, 2015, 11:21:01 PM10/19/15
to jenkinsc...@googlegroups.com

Packy_Anderson@bmc.com (JIRA)

unread,
Feb 11, 2016, 1:07:01 PM2/11/16
to jenkinsc...@googlegroups.com

Any word on when this fix might make it into an official release? I'm running into what appears to be the same problem.

rob.petti@gmail.com (JIRA)

unread,
Feb 11, 2016, 3:39:01 PM2/11/16
to jenkinsc...@googlegroups.com

This plugin isn't really supported anymore, but I'll try to kick off a release...

rob.petti@gmail.com (JIRA)

unread,
Feb 11, 2016, 5:24:01 PM2/11/16
to jenkinsc...@googlegroups.com

I just pushed 1.3.36, which contains this fix. It might take up to 6 hours for it to be replicated through the update center.

ant.bur@tin.it (JIRA)

unread,
Nov 4, 2016, 4:41:02 AM11/4/16
to jenkinsc...@googlegroups.com
antonio bur reopened an issue
 

Hi,
I have installed the Jenkins server using the perforce plug in 1.3.36, but I still get the following error. Note I sure that the password is right. Can you help on this?
[workspace] $ p4 -p ssl:myperforce:1666 trust -y
[workspace] $ p4 login -a -p
[workspace] $ p4 -P xxxxxxxxxxxxxxxxxxxxxxxxxx workspace -o -S //depot/abcd jenkins_workspace


Caught exception communicating with perforce. Perforce password (P4PASSWD) invalid or unset.com.tek42.perforce.PerforceException: Perforce password (P4PASSWD) invalid or unset.

Change By: antonio bur
Resolution: Fixed
Status: Resolved Reopened
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

ant.bur@tin.it (JIRA)

unread,
Nov 4, 2016, 7:08:02 AM11/4/16
to jenkinsc...@googlegroups.com
antonio bur edited a comment on Bug JENKINS-28367
 
Re: perforce plugin don't support P4 ticket authentication
Hi,
I have installed the Jenkins server
(2.28 ver) using the perforce plug in 1.3.36, but I 'm still get the following error. Note I sure that the password is right. Can you help me on this?

[workspace] $ p4 -p ssl:myperforce:1666 trust -y
[workspace] $ p4 login -a -p
[workspace] $ p4 -P xxxxxxxxxxxxxxxxxxxxxxxxxx workspace -o -S //depot/abcd jenkins_workspace
Caught exception communicating with perforce. Perforce password (P4PASSWD) invalid or unset.com.tek42.perforce.PerforceException: Perforce password (P4PASSWD) invalid or unset.

rob.petti@gmail.com (JIRA)

unread,
Nov 4, 2016, 12:02:02 PM11/4/16
to jenkinsc...@googlegroups.com

I'm not sure that's related to this ticket. Can you try running the commands by hand?

ant.bur@tin.it (JIRA)

unread,
Nov 4, 2016, 1:05:01 PM11/4/16
to jenkinsc...@googlegroups.com

I'm not a Perforce expert, anyway when I use the command line and I do the p4 set P4PORT:myserver and than I can do the login whiteout any problem. Note I'm not interest to use the ticket, but I don't understand Jenkins is forcing to use this option. It seems that Jenkins plugin doesn't pass the password information.
Note: I also have a Perforce that I use as test server (on this server I don't use the ssl protocol), and the perforce plugin on Jenkins works fine.

Thanks in advance.

ajeng@adobe.com (JIRA)

unread,
Nov 4, 2016, 1:10:02 PM11/4/16
to jenkinsc...@googlegroups.com

I see the same issue as Antoino. The issue is random since I have multiple Jenkins masters. First of all, I use ssl with our Perforce server. Here's some interesting things I've observed:
1. only happens with Windows nodes. (Mac nodes has no problem)
2. it's specific to a Windows node.

Now, I haven't tried checking if it's because of different Perforce p4.exe versions – but they have no problem using the token at command line. Only with Perforce plugin.

rob.petti@gmail.com (JIRA)

unread,
Nov 4, 2016, 1:51:01 PM11/4/16
to jenkinsc...@googlegroups.com

It sounds like you are both having separate issues from this ticket.

Allen, check your P4 versions... They need to match the server.

Antonio, I don't know if I can help you with this. You might want to do the same as Allen and double check that the perforce client versions match the server you are connecting to.

Finally, the perforce-plugin isn't really supported at all anymore. If you have fixes, I'd be happy to merge them, but aside from that, you might want to consider migrating to the official p4-plugin. If you have issues with that plugin, you can file tickets against them or contact Perforce support.

rob.petti@gmail.com (JIRA)

unread,
Nov 4, 2016, 1:52:03 PM11/4/16
to jenkinsc...@googlegroups.com
Rob Petti closed an issue as Fixed
 
Change By: Rob Petti
Status: Resolved Closed

rob.petti@gmail.com (JIRA)

unread,
Nov 4, 2016, 1:52:03 PM11/4/16
to jenkinsc...@googlegroups.com
Rob Petti resolved as Fixed
 

Resolving ticket again, since reported issues are not related to ticket acquisition.

Change By: Rob Petti
Status: Reopened Resolved
Resolution: Fixed

ajeng@adobe.com (JIRA)

unread,
Nov 4, 2016, 1:56:02 PM11/4/16
to jenkinsc...@googlegroups.com
Allen Jeng commented on Bug JENKINS-28367
 
Re: perforce plugin don't support P4 ticket authentication

Thanks Rob! I figure it was something silly like that!

Antonio: if the source you're pulling isn't big, you should consider using the official P4 plugin. I have an open ticket with them (Perforce) to fix issues. The source base I'm pulling is around 16GB+. P4 plugin can ... at random, freeze up and the sync rate would drop to less than 50kb/sec. Hence, my reliance on the old Perforce plugin.

Reply all
Reply to author
Forward
0 new messages