Skip to end of metadata
Go to start of metadata

P4 Plugin - By Perforce Software. Jenkins plugin for a Perforce Helix Versioning Engine.

Contribution

Please consider helping out and joining this project to make it even better.  

There are many features to add and a growing backlog of SIRs, I am happy to accept GitHub pull requests or Shelved Swarm reviews.  Any questions please contact me via our support team support@perforce.com.

Kind regards,

Paul

Overview

P4 Plugin for Jenkins manages Perforce Helix workspaces; synchronising code and polling/triggering builds. 

The P4 Plugin has been fully tested against Helix P4D release version 2015.1

The plugin supports:

  • Credential authentication
  • Client Workspace management
  • Synchronisation behaviour
  • Polling and filtered builds
  • External review tools (Swarm)
  • Change-list browsing
  • Labeling builds (Tagging)
  • External repository browsers (P4Web, Swarm)
  • Submit assets back to Perforce Helix (Publish)

Requirements

  • Jenkins 1.642.3 or greater.
  • Helix Versioning Engine 2015.1 or greater.
  • Minimum Protection of 'open' for the Jenkins user.
  • If you wish to use the Review Build feature you will need Swarm. 
  • Swarm 2015.1 or greater.

Issues

All issues are managed on the JIRA Agile Board, when reporting an issue please set the Component to `P4` (not `Perforce`).

Limitations

  • Some parameters are not available during Polling.  As a result these variables will not get expanded leading to unexpected results (e.g. new workspaces being created resulting in continuous polling).  Jenkins job and multi configuration parameters should be expand, but custom or parameterised build variables are unlikely to be available.

Documentation

Please refer to the README for more information.

48 Comments

  1. Hi, Just wondering from where this plugin picks the "p4" executable (or it uses only P4JAVA API).

    We have a wrapper to the native p4 binary which is also called 'p4', looks like this plugin is picking the that wrapper binary as it is available through $PATH env variable.

    Thanks!

    Punith

  2. Hi,

    I have configured the plugin as per specification, also checked the setting. but when i run the job i get below error, need helpjava.io.IOException: remote file operation failed: /scratch/builds/jenkins/workspace/xxxx_bug-fix_SUSE11_SP2_cde_linux64i8 at hudson.remoting.Channel@72afe16b:Rhel5.7-sucd606: java.io.IOException: Remote call on Rhel5.7-sucd606 failed
    at hudson.FilePath.act(FilePath.java:976)
    at hudson.FilePath.act(FilePath.java:958)
    at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:285)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1253)
    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:1745)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
    Caused by: java.io.IOException: Remote call on Rhel5.7-sucd606 failed
    at hudson.remoting.Channel.call(Channel.java:760)
    at hudson.FilePath.act(FilePath.java:969)
    ... 10 more
    Caused by: java.lang.ClassFormatError: Failed to load org.kohsuke.stapler.Stapler
    at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:325)
    at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:237)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at hudson.util.Secret.<clinit>(Secret.java:239)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
    at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140)
    at java.lang.reflect.Field.acquireFieldAccessor(Field.java:936)
    at java.lang.reflect.Field.getFieldAccessor(Field.java:917)
    at java.lang.reflect.Field.getLong(Field.java:546)
    at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1631)
    at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:69)
    at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:442)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:430)
    at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:327)
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:564)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
    at hudson.remoting.UserRequest.deserialize(UserRequest.java:185)
    at hudson.remoting.UserRequest.perform(UserRequest.java:99)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:324)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    at ......remote call to Rhel5.7-sucd606(Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
    at hudson.remoting.Channel.call(Channel.java:752)
    ... 11 more
    Caused by: java.lang.ClassFormatError: Failed to load javax.servlet.http.HttpServlet
    at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:325)
    at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:237)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:480)
    at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:323)
    at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:237)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at hudson.util.Secret.<clinit>(Secret.java:239)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
    at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140)
    at java.lang.reflect.Field.acquireFieldAccessor(Field.java:936)
    at java.lang.reflect.Field.getFieldAccessor(Field.java:917)
    at java.lang.reflect.Field.getLong(Field.java:546)
    at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1631)
    at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:69)
    at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:442)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:430)
    at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:327)
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:564)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
    at hudson.remoting.UserRequest.deserialize(UserRequest.java:185)
    at hudson.remoting.UserRequest.perform(UserRequest.java:99)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:324)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    Caused by: java.lang.UnsupportedClassVersionError: javax/servlet/http/HttpServlet : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:480)
    at hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:323)
    ... 51 more
    Sending e-mails to: narayanpradhan7876@gmail.com
    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 0 seconds
    Notifying upstream projects of job completion
    Finished: FAILURE

  3. First, thank you for making this plugin!

    I would very much appreciate an option to fail the job if any kind of errors occur when synching the workspace.  This seems critical to me.  Currently, a syntax error in a view spec, or any number of other issues can cause my build to use the wrong source code, but there is no indication of a problem, unless I read the console output (which I obviously don't do on every build).

  4. By experiment, I have found that the Polling Build filters which say "Exclude changes from Depot path" only seems to work when a specific file is used.

    As such I want to use something like this:

    //some/path/version.*

    Instead I had to use version.h and version.xml in separate lines. Is this as intended? If so, the wording is misleading and the help should mention this.

  5. Hi all,

    I've recently upgraded from v1.4.2 to v1.4.4 and started to notice interesting behavior: if my workspace has a soft link to another directory unrelated to this job, the files are get cleaned up in this referenced directory (only files, recursively in all dirs, dirs themselves are kept).

    Before upgrading (when was @ v1.4.2) the referenced dirs never cleaned up.

    Do you have any ideas if this is a bug or feature and whether the changes between 1.4.2 and 1.4.4 may affect such behavior or should I search for an issue in other directions?

    I'll try to downgrade back to 1.4.2 soon, just pending awaiting the next maintenance window.

    Thanks!

     

    p.s. investigated a bit and found more details on this issue, finally filed a JIRA for this:  JENKINS-40948 - Getting issue details... STATUS  however, it doesn't get much attention through all this time..... (sad)

  6. Hey guys!

    Are there any options to be able to pass View Mappings to build execution as a variable?

    I want text area parameter to be filled by some mapping by default, and requestor should be able to edit it (e.g. if he or she wants to build on dev branch).

    In our project developers have lots of dev branches and then merge into Main branch.

    So, to avoid creating job for any new dev branch I would like to allow developer to tweak View Mapping at time of build execution.

    If there is no way to do this, then my question is why? Why not to implement ability to pick up the View Mapping from a variable?

    Thanks,

    Pavel

    1. Just in case guys) I've found out long ago that variables are recognized pretty fine, so you can pass any user-defined values (e.g. paths) to P4 View Mapping.

  7. Hello,

    We are using this plugin but for some of the jobs we see "Unable to get current change: java.lang.NullPointerException" and for these jobs the Jenkins API doesn't work with similar exceptions.

    See the StackTrace in attached file StackTrace.txt, any comment on this please?

    Thanks,

  8. Hi is there a way to sync to a specific change list with P4 Plugin ?

     

    1. Hi Yury,

      Yes, there is.

      "Pin build at Perforce Label" option in Source Code Management section of the job configuration is responsible for this.

      You can put either plain changelist number (e.g. 147081) or p4 label to sync to. Keeping it blank will sync to head revision prior the build.

      To automate this process you can make the job parametrized, add a string (or Validating String for checking user input) parameter, e.g. CUSTOM_REV. By default you can leave the value empty for it and put "${CUSTOM_REV}" to "Pin build at Perforce Label" field to ask the value when user builds it and pass it to P4 plugin then. User can keep the default value to sync to head or enter different value if required. The default value is also used when build is triggered automatically (e.g. via SCM polling).

      Hope this helps =)

      1. That worked great!

        Thanks Pavel.

        Yury

  9. Hello all.

    Is there a way to get hold of change list description as a variable ?

    I would like to parse through the description for keywords.

    Thanks

    Yury

    1. So I have a way to do this if anyone else is looking for it. 

      Look in $JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER/changelog.xml, this file has the sync information.

      Yury

  10. Is there a way to force the build to build with "Clean and sync" using a boolean but just use sync normally?

    1. could you elaborate little more, it is not clear what you are trying to do.

       

      1. Sure

        So I have a build with "Sync Only" selected as the sync option.   I want the ability to be able to set a Boolean to enable the ability to change it to a "Force Clean and Sync" when manually building the job. 

        Doesn't have to actually change the job option, but would change the perforce command to have the -f in the sync command, this is useful in a number of circumstances. 

        1. I would like this too. We have a large C++ project that we want to do incremental builds on (don't wipe the workspace!). However, every so often we need to do a full re-build. The only way to accomplish this is to edit the job config, run the job enough times that it wipes all node workspaces, then edit the job config back.

          It would be extremely helpful if we could choose the sync options with a job parameter or environment variable or something.

  11. Is it possible to use a timestamp in the pin section and if so what is the format?

  12.  The SCM poll feature doesn't seem to work as expected. From the poll log:

    Started on Dec 11, 2017 10:54:00 AM
    P4: Polling on: master with:some_workspace_name_by_nodeid_executor_id
    Done. Took 2 ms
    Changes found

    A build gets triggered:

    Skipping Parent build...
    P4 Task: saving built changes.
    Found last change 88146 on syncID some_workspace_name_by_nodeid_executor_id

    But, the build status page says:

    • started by SCM change
    • No changes from last build

     

    Subsequent builds (my poll schedule is every 5 minutes) all have the same CL number (88146), since there were no changes committed anywhere within the worksapce view mapping. We're using manual workspace definition, if that makes any difference.

     

    1. Hi,

      I have been struggling with that all day and still couldn't come up with a good solution.

      I am too using a manual view where a bunch a variable such as computer and node name are used to make up a workspace name.

      The problem seems to come from the fact that polling is executed on master node, therefore creating an empty workspace view to check the poll but then build is executed on a slave node where the workspace depot is up to date.

      Is there a way to have the poll check on the node it would be executed? Or do I have to make "static" workspace name?

      (Hope I didn't stir away from your original question but hopefully added little information)

      1. Hi Yuri, Mayo

        There might be a similar JIRA open if not please consider raising the issue on the Jenkins JIRA issue page issues.jenkins-ci.org.  If you have Perforce support please contact us and/or ping me the JIRA ID / Support case number.  I don't check the old wiki page very often as the Jenkins community favour JIRA.

        If you raise a JIRA issue please set the component to 'p4-plugin', include the plugin version e.g. 1.8.4 and provide as much detail about your Jenkins Job setup e.g. are you using FreeStyle, MatrixBuilds, Pipeline, MultiBranch, etc...

        What variables do you use in your Workspace Format name e.g. jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}

        'Skipping Parent build...' Parent build? - Is this a Matrix Project? What Axes do you have and do you use any variables in the workspace view?

        Jenkins polls on the master and I rely on the SyncID to track changes. The workspace view should be the same as the slave (at least the depot side of the mapping).  Polling should then use 'p4 changes' with the view to see if there are any new changes since the last SyncID.

        Try a 'Build Now' to 'reset' the SyncID if you have recently changed the workspace view or other configuration settings.

        Kind regards,

        Paul

        1. I've fixed my issue by:

          In Project's Execution Strategy, pick "Perforce: Matrix Options" and then check the "Build Parent" checkbox.

          Paul Allen This is a matrix build, I have one axis (multiple platforms via labels), and I do use workspace variables (so we check out platform specific stuff only). Jenkins seems to poll on one of the slave nodes rather than the master. We put ${NODE_NAME} into workspace name specifically to keep the workspaces for each build slave seaprate, as we were running into issues. Are you saying I should keep the workspace name the same across the nodes in the matrix? (ie. jenkins-${JOB_NAME}, without NODE_NAME). Other than that, the actual workspace mapping is identical between the matrix nodes.

          This above execution strategy seemed to have solved my problem, but the option is quite hidden if you don't know to look for it. There also seem to be no documentation on what "Perforce: Matrix Options" exactly means or does (as opposed to classic), but these settings seemed to have done it for now.

          1. I had forgotten about the Execution Strategy for Matrix Builds; the past few years have been focused on Pipeline/MultiBranch for Jenkins 2.  Updating the markdown documentation, would help other users - I will have to remind myself of the behaviour.

            Try and keep your workspaces unique (use NODE_NAME and other variables to help), this is important if concurrent builds are used and more efficient if you are using AutoClean as the Perforce 'have' data is used during the sync.

        2. Hi Paul,

          I just made a simple freestyle project, so I don't have options such as "matrix".

          The source code management is setup as follow:

          • Workspace behaviour: Manual (custom view)
          • Character set: none
          • Workspace name: jenkins-${COMPUTERNAME}-${NODE_NAME}-${JOB_NAME} (something like that)

          I originally added the computer and node name (${COMPUTERNAME}-${NODE_NAME})  to the worspace name as I thought workspace name should be unique per computer per user in perforce but it made Jenkins confused when master was checking if it needed to poll or not. As it was checking a non-existing workspace, the polling was always validate.

          I just remove Node and computer name from the workspace name so master now check the same workspace created by worker node and it works much better.

          I didn't write any JIRA issue as I now realize I might have been asking for something that can't be done. (poll on the worker node)

          Unless it's a feature you want and can add, I'm not gonna report any issue.

          Thanks for your answers, have a great day!

          1. Hi Yuri, thank you for letting me know.  No need to raise a JIRA issue unless you need the feature.

  13. I created a Pipeline which sync code via P4 plugin,

    I noticed the 'changes' will display triple, for example, there is only 7 change, but the 'change' will display 21 changes.

     

    And I checked the poll log, its sync the code three times, how can I avoid this issue?

    j1JuEOaOP4 Task: syncing files at change: 3957444
    (p4):cmd:... p4 sync /Jenkins/xxxxxx/myPipelineJob%40script/...@3957444
    p4 sync /Jenkins/xxxxxx/myPipelineJob%40script/...@3957444
    ...
    ...
    P4 Task: syncing files at change: 3957444
    (p4):cmd:... p4 sync /Jenkins/xxxxxx/myPipelineJob/...@3957444
    p4 sync /Jenkins/xxxxxx/myPipelineJob/...@3957444
    ...
    ...
    P4 Task: syncing files at change: 3957444
    (p4):cmd:... p4 sync -q /Jenkins/xxxxxx/workspace/TEST/Pipel___
    p4 sync -q /Jenkins/xxxxxx/workspace/TEST/Pipeline-Development/TEST/...@3957444

    1. Dose anyone meet this issue?

      1. Hi Shanghai,

        I don't usually check the old wiki page as the Jenkins community favour JIRA.  Please raise issues on the Jenkins JIRA issue page issues.jenkins-ci.org (setting 'p4-plugin' as the component) and if you have Perforce Support contact us and include the JIRA issue number.

        The first 'sync' operation (%40script/...) is due to the way Jenkins fetches the Jenkinsfile, see https://github.com/jenkinsci/p4-plugin/blob/master/WORKFLOW.md for details.  The very latest release of my plugin 1.8.4 supports lightweight checkout, using 'p4 print' to fetch the Jenkinsfile.

        The change count is possibly a bug, as it is including all the changes from the sync operations, but I would need to investigate this further. Please raise a JIRA issue.

        Kind regards,

        Paul

        1. hi Paul,

          I already submitted a issue in the JIRA issue page. https://issues.jenkins-ci.org/browse/JENKINS-48854

          Thanks for your kindly help!

  14. All of our builds using P4Plugin have started failing in the last 24 hours, with the following error:

    P4: Unable to connect: com.perforce.p4java.exception.TrustException: Error occurred while installing fingerprint XXXXXXXXX for Perforce server 'XXXXXXXX' (XXXXXXX) to trust file.

    The credentials being used for the SSL connection have worked fine for months. However, now the "Test Connection" button now gives this error as well, regardless of the username/password credentials being used.

    What sort of issue could be happening to cause this error? The error message doesn't seem to help me determine how to fix the issue. All of the nodes (including the master) have successfully trusted this server (I've verified the entries in the .p4trust file), the fingerprint doesn't appear to have expired, and to my knowledge no changes have been made to the Jenkins server, the Perforce host, or the credentials in the last day.

    Any insight into what could be going on would be very helpful.

    Thanks,

    Alex

     

    1. After further investigation, it turns out that P4Plugin had filled the drive so no new files could be made in the /tmp directory - it was full of files in the form of "p4auth_XXXXXXXXXXXXXXXXXXX.txt" containing server fingerprints for SSL connections. The timestamps of the files appear to correspond to the automated SCM polling used by the job (which happens every 5 minutes).

      Is there a way to disable the creation of these files, or configure P4Plugin to clean them up when it's done? As a temporary fix we are periodically removing all *.txt files created by the Jenkins user.

      1. p4auth_*.txt files are generated by the p4java API, but should get deleted (the bugfix for p4java went out about a year ago).  What version of the p4-plugin are you using (latest 1.8.4)?

        1. We upgraded to 1.8.4 last week after discovering this issue; previously we were using 1.8.0.

          After the upgrade, p4auth_*.txt files continue to be generated without getting deleted. 

        2. Just chiming in to note that I see nearly 1000 p4auth*.txt files in my temp directory, it looks like they're not getting deleted.

           

          Jenkins 2.73.1 (Windows), p4-plugin 1.8.3

          1. I have the same issue as you, there are so many '/tmp/p4auth_1515*.txt' files, I create a script to remove all of them every night.

            1. If P4Java (the API used by Jenkins) does not have write access to update the '.p4ticket' file then the 'p4auth_*' file is left behind.  The code attempts to move the 'p4auth_*' file over the '.p4ticket' file; perhaps on error we should cleanup the 'p4auth_*' file?

  15. Hi is there a way to get the Summary of Changes into a formatted variable, say P4_CHANGES?

  16. Hi,

    I'm using P4 plugin but I need to use mask when syncing (not polling). Is it possible ? If yes, how can I do that ?

    Thanks.

  17. Hi,

    I have installed P4 Plugin. I start my first build and got below message.

    I have assigned a node which i configured with P4 env variable like P4PORT; and user/passwd.

    P4: Unable to connect: java.net.URISyntaxException: missing or malformed Perforce server hostname: p4java://
    P4: Connection retry: 1
    P4: Connection retry giving up...
    P4: Unable to setup workspace: java.lang.NullPointerException
    P4: Unable to close Perforce connection.
    ERROR: P4: Unable to setup workspace: java.lang.NullPointerException

  18. I need to change from the old perforce plugin to the newer p4 plugin.  It is a bit "difficult" as all of the jobs created by a previous owner are based off of templates without my knowing where the original jobs used for the templates are.  So with some suggestions of co-workers created a new example job and I am exploring the differences of the new config.xml to the old template XML.

    I have tried various Google searches trying to find any porting tips, but nothing good.  The other thing I have tried is to briefly look through the code for the new plugin to see if I could find where the tags in the config.xml are processed for setup.  Haven't found much yet... probably have skipped a obvious directory.  Likewise I'd like to find similar documentation for the old plugin so I could more accurately match up configuration.

    Any tips or pointers would be appreciated.  It may be time to just copy and paste some XML into the template and experiment.  All 10+ multijobs are blocked so breaking the config will not make things worse!

  19. Hi

    We are currently using the P4 Plugin in declarative pipeline jobs and using to submit/publish some artifacts back to Perforce.

    However there does not appear to be any option available to attach Perforce Jobs to the submission changelist.

    Are we missing something or is this currently not possible via the plugin?

    Thanks

    1. Hi Neil,

      There is no Perforce Job (p4 fix) link when submitting with the p4-plugin, however it does sound like a good SIR.  Please can you create an issue on issues.jenkins-ci.org and set the component to 'p4-plugin'.

      1. Thanks for the update Paul, I've create the Feature Request - JENKINS-51394

  20. Hi All,

    is there a way to set rmdir flag when using streamSpec in declarative pipeline ?

    Thank you

    Yury

    1. Hi Yuri,

      You can set the rmdir option in the Manual Workspace and use the Stream field (leaving the View field empty) assuming you want a Streams workspace.

  21. Hi All,

    When I change the old perforce plugin to the new one, the error below has occurred.

    ERROR: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
    'change_client' validation failed: You can not select submitunchanged or submitunchanged_reopen as client SubmitOptions

    I can't see anything about change_client in the configuration.
    Do I miss anything?

    Thanks

    1. It looks like your Perforce admin has set a trigger to prevent 'submitunchanged' (which is the default option) from being used.

  22. How do I enable the filters to allow exclusion by user or directory. I don't see these options showing up.

    Thanks!

Write a comment…