[JIRA] (JENKINS-59556) Global Pipeline shared library version "now" fails when using Helix Library

2 views
Skip to first unread message

asmith@pipeworks.com (JIRA)

unread,
Sep 26, 2019, 6:45:02 PM9/26/19
to jenkinsc...@googlegroups.com
Adam Smith created an issue
 
Jenkins / Bug JENKINS-59556
Global Pipeline shared library version "now" fails when using Helix Library
Issue Type: Bug Bug
Assignee: Unassigned
Components: p4-plugin
Created: 2019-09-26 22:44
Environment: Jenkins 2.176.3
P4 Plugin 1.10.3
Priority: Minor Minor
Reporter: Adam Smith

I've tried several configurations of the Helix Library Modern SCM to configure my shared library, all to no avail.

Name: SampleLibrary
Path: //libraries/sample (or //libraries/sample/... as documented, however the logs seem to show this being appended automagically)
Default Version: now (also tried head, master)
Load Implicitly: false
Allow version override: false (or true)
Include in changesets: false

Running this sample pipeline:

pipeline {
    agent any
    libraries { lib('SampleLibrary') }
    stages {
        stage('stage') {
            steps {
                echo 'Library loaded successfully!'
            }
        }
    }
}

results in the following error:

(p4):stop:10
(p4):cmd:... p4 changes -m1 -ssubmitted //jenkins-lib-d94a3a59-55d8-4afb-a69d-9d8da59be94e/...@1___
p4 changes -m1 -ssubmitted //jenkins-lib-d94a3a59-55d8-4afb-a69d-9d8da59be94e/...@1,-1

Invalid changelist/client/label/date '@-1'.

(p4):stop:11
ERROR: P4: Unable to initialise CheckoutTask: com.perforce.p4java.exception.RequestException: Invalid changelist/client/label/date '@-1'.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

asmith@pipeworks.com (JIRA)

unread,
Sep 26, 2019, 7:28:02 PM9/26/19
to jenkinsc...@googlegroups.com
Adam Smith commented on Bug JENKINS-59556
 
Re: Global Pipeline shared library version "now" fails when using Helix Library

I may have mistitled this ticket. Digging in further: any version number I use produces the same error.

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 4:33:02 AM9/27/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 5:11:02 AM9/27/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-59556
 
Re: Global Pipeline shared library version "now" fails when using Helix Library

Hi Adam Smith. I haven't been able to reproduce this error with a pipeline polled job with a Jenkinsfile containing your code and your versions of Jenkins and plugin (see my setup below). Note that my shared library is defined under Manage Jenkins.

Note that we have added code [recently|https://swarm.workshop.perforce.com/changes/25826] to minimise the number of changes return when looking for differences with source during polling so my guess is that this code is being applied when it shouldn't be.

Please answer the following questions:

  • Does the problem occur when you click the Jenkins "Build Now" button?
  • Are you using a Jenkinsfile or the GUI?
  • Where are you defining the library? Manage Jenkins, folder level or somewhere else? Please send me screenshots.
  • If you go to manage Jenkins and look at 'Perforce: Query limits' what values are set?

 

Here is my working setup:

The console output was:

 

... p4 changes -m1 //depot/myLibrary/...@now +... p4 client -o jenkins-lib-a5181aaa-9ab1-49c7-ae00-ca4a511ab508 +

Console OutputStarted by user unknown or anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] library
Loading library my-shared-library@now
... p4 changes -m1 //depot/myLibrary/...@now +
... p4 client -o jenkins-lib-a5181aaa-9ab1-49c7-ae00-ca4a511ab508 +
    --- cut---
P4 Task: syncing files at change: 496
... p4 sync -f -q /var/lib/jenkins/workspace/JENKINS-59556-LoadALibrary%40libs/my-share___ -p4 sync -f -q /var/lib/jenkins/workspace/JENKINS-59556-LoadALibrary%40libs/my-shared-library/...@496
... totalFileSize 4341
... totalFileCount 2
duration: (2ms)

 

 

 

 

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 5:12:02 AM9/27/19
to jenkinsc...@googlegroups.com
Karl Wirth edited a comment on Bug JENKINS-59556
Hi [~asmith_pipeworks]. I haven't been able to reproduce this error with a pipeline polled job with a Jenkinsfile containing your code and your versions of Jenkins and plugin (see my setup below). Note that my shared library is defined under Manage Jenkins.


Note that we have added code [recently|[https://swarm.workshop.perforce.com/changes/25826]]
  to minimise the number of changes return when looking for differences with source during polling so my guess is that this code is being applied when it shouldn't be.


Please answer the following questions:
* Does the problem occur when you click the Jenkins "Build Now" button?
* Are you using a Jenkinsfile or the GUI?
* Where are you defining the library? Manage Jenkins, folder level or somewhere else? Please send me screenshots.
* If you go to manage Jenkins and look at 'Perforce: Query limits' what values are set?


 

Here is my working setup:

!MySharedLibrary.png!


The console output was:

 

... p4 changes -m1 //depot/myLibrary/...@now +... p4 client -o jenkins-lib-a5181aaa-9ab1-49c7-ae00-ca4a511ab508 +
{code:java}

Console OutputStarted by user unknown or anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] library
Loading library my-shared-library@now
... p4 changes -m1 //depot/myLibrary/...@now +
... p4 client -o jenkins-lib-a5181aaa-9ab1-49c7-ae00-ca4a511ab508 +
    --- cut---
P4 Task: syncing files at change: 496
... p4 sync -f -q /var/lib/jenkins/workspace/JENKINS-59556-LoadALibrary%40libs/my-share___ -p4 sync -f -q /var/lib/jenkins/workspace/JENKINS-59556-LoadALibrary%40libs/my-shared-library/...@496
... totalFileSize 4341
... totalFileCount 2
duration: (2ms){code}
 

 

 

 

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 5:13:03 AM9/27/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 5:13:04 AM9/27/19
to jenkinsc...@googlegroups.com
Karl Wirth edited a comment on Bug JENKINS-59556
Hi [~asmith_pipeworks]. I haven't been able to reproduce this error with a pipeline polled job with a Jenkinsfile containing your code and your versions of Jenkins and plugin (see my setup below). Note that my shared library is defined under Manage Jenkins.

Note that we have added code in [ recently|[ https://swarm.workshop.perforce.com/changes/25826] ]  to minimise the number of changes return when looking for differences with source during polling so my guess is that this code is being applied when it shouldn't be.


Please answer the following questions:
* Does the problem occur when you click the Jenkins "Build Now" button?
* Are you using a Jenkinsfile or the GUI?
* Where are you defining the library? Manage Jenkins, folder level or somewhere else? Please send me screenshots.
* If you go to manage Jenkins and look at 'Perforce: Query limits' what values are set?

 

Here is my working setup:

!MySharedLibrary.png!

The console output was:

 

... p4 changes -m1 //depot/myLibrary/...@now +... p4 client -o jenkins-lib-a5181aaa-9ab1-49c7-ae00-ca4a511ab508 +
{code:java}
Console OutputStarted by user unknown or anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] library
Loading library my-shared-library@now
... p4 changes -m1 //depot/myLibrary/...@now +
... p4 client -o jenkins-lib-a5181aaa-9ab1-49c7-ae00-ca4a511ab508 +
    --- cut---
P4 Task: syncing files at change: 496
... p4 sync -f -q /var/lib/jenkins/workspace/JENKINS-59556-LoadALibrary%40libs/my-share___ -p4 sync -f -q /var/lib/jenkins/workspace/JENKINS-59556-LoadALibrary%40libs/my-shared-library/...@496
... totalFileSize 4341
... totalFileCount 2
duration: (2ms){code}
 

 

 

 

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 5:13:04 AM9/27/19
to jenkinsc...@googlegroups.com

asmith@pipeworks.com (JIRA)

unread,
Sep 27, 2019, 5:37:02 AM9/27/19
to jenkinsc...@googlegroups.com
Adam Smith commented on Bug JENKINS-59556
 
Re: Global Pipeline shared library version "now" fails when using Helix Library

Good morning! I'm not at my computer at the moment, but will add a comment with the rest of the requested information as possible. In the meantime...

1. I'm only using the "build now" option
2. I'm using the gui, not a pipeline from scm. I will try using a Jenkinsfile to add data points
3. I'm defining the shared library under Manage Jenkins. Screenshots forthcoming.
4. Screenshots forthcoming, but since I'm not polling I imagine this isn't it

My setup looks very similar to your provided screenshot, but where your console output is p4 changes -m1 //depot/myLibrary/...@now, mine said p4 changes -m1 //depot/myLibrary/.../...@now

Removing the trailing "/..." from my Library Depot Path produced output that matched yours, but still presented the error reported in the ticket.

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 5:41:01 AM9/27/19
to jenkinsc...@googlegroups.com

Hi Adam Smith Thank. No obvious discrepencies there. Do you mind if I email you directly? I'd like to try and set up a meeting to look at your system.

asmith@pipeworks.com (JIRA)

unread,
Sep 27, 2019, 5:52:02 AM9/27/19
to jenkinsc...@googlegroups.com

Not at all, please do.

I won't be available for another several hours, but will respond then.

kwirth@perforce.com (JIRA)

unread,
Sep 27, 2019, 6:22:02 AM9/27/19
to jenkinsc...@googlegroups.com

Hi Adam Smith - Change of plan. I'm able to reproduce this if I use a static label in that field:

p4 changes -m1 -ssubmitted //jenkins-lib-56ca85cd-43c2-4b6f-b216-cf9fc5b75707/...@1,-1

Invalid changelist/client/label/date '@-1'.

ERROR: P4: Unable to initialise CheckoutTask: com.perforce.p4java.exception.RequestException: Invalid changelist/client/label/date '@-1'.

Therefore when you get in please check if you are using a label in the 'Default Version' field, if there are any spaces or you are using different case to 'now'.

asmith@pipeworks.com (JIRA)

unread,
Sep 30, 2019, 12:30:04 PM9/30/19
to jenkinsc...@googlegroups.com

Karl Wirth worked this out for me in email. The credentials I was using to sync the library didn't have permission to see that area of the depot.

This is Not A Bug, but I'll let someone else close it because I don't know what the workflow is like in this Jira

kwirth@perforce.com (JIRA)

unread,
Oct 1, 2019, 4:29:02 AM10/1/19
to jenkinsc...@googlegroups.com
Karl Wirth resolved as Not A Defect
 

Lack of permissions on the library will cause the library version to be seen as '-1':

If you encounter this problem try the following command from master and slave to test that the build user has the correct permissions to the library:

     p4 -u BuildUser -p Server:Port changes -m1 //depot/myLibrary/...@now'

Change By: Karl Wirth
Status: Open Resolved
Resolution: Not A Defect

kwirth@perforce.com (JIRA)

unread,
Oct 1, 2019, 4:31:04 AM10/1/19
to jenkinsc...@googlegroups.com
Lack of permissions on the library will cause the library version to be seen as '-1'
:

!image-2019-10-01-09-28-02-321
on the library definition page under 'Default Version' . png!

If you encounter this problem try the following command from master and slave to test that the build user has the correct permissions to the library:

     p4 -u _*BuildUser*_ -p _*Server:Port*_ changes -m1 *//depot/myLibrary/...{color:#339900}@now{color}*'

kwirth@perforce.com (JIRA)

unread,
Oct 1, 2019, 4:32:02 AM10/1/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages