-
Bug
-
Resolution: Fixed
-
Major
- Create pipeline job that uses pipeline script via SCM (using p4plugin):
pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } }
- Set the quiet period of job to 0.
- Start job twice
- One job will fail with following error:
Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE
If cannot reproduce - start job multiple times with some small time intervals between clicks. Clearly there is some race condition for access to JOB_NAME@script workspace directory - sometimes it succeeds, sometimes doesn't.
Please note that this is not a duplicate for JENKINS-45339, even though the reproduction is very similar. In JENKINS-45339 you should wait for input to start second build (i.e. wait for the pipeline script to be checked out before starting second build). Over here, the builds should be started right away, before it goes to "Declarative: Checkout SCM" stage.
I'm not entirely sure if the issue is unique for P4 Plugin - it may be the case that whole "Pipeline script from SCM" feature has architectural flaw. I think there should be multiple @script directories created, for every concurrent build. There are multiple @tmp dirs, but the @script is shared between concurrent builds.
[JENKINS-46090] Cannot run two parallel builds with SCM Jenkinsfile script
Description |
Original:
Create pipeline job that uses following JenkinsFile: {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} Perform following test: # Start job, wait until it asks for input, DO NOT PROCEED # Start the job again, it will go to input stage # Proceed on both builds (by entering text in console) # Start job again, wait until it asks for input, DO NOT PROCEED # Start the job again it will immeditaly FAIL, because file "~jenkins/workspace/p4plugin-repro-pipeline@2/this_should_be_cleaned_up" was not deleted during the checkout stage From now on, you can repeat steps 4 and 5, it will reproduce every time. Different wokspaces are used for the parralel jobs but 'WS@2' is not cleaned up in this scenario. |
New:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} |
Description |
Original:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} |
New:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} If cannot reproduce - start job multiple times with some small time intervals between clicks. Clearly there is some race condition for access to JOB_NAME@script workspace directory - sometimes it succeeds, sometimes doesn't. *I'm not entirely sure if the issue is unique for P4 Plugin* - it may be the case that whole Jenkins "Pipeline script from SCM" has architectural flaw. I think there should be multiple @script directories created, for every concurrent build. There are multiple @tmp dirs, but the @script is shared between concurrent builds. |
Description |
Original:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} If cannot reproduce - start job multiple times with some small time intervals between clicks. Clearly there is some race condition for access to JOB_NAME@script workspace directory - sometimes it succeeds, sometimes doesn't. *I'm not entirely sure if the issue is unique for P4 Plugin* - it may be the case that whole Jenkins "Pipeline script from SCM" has architectural flaw. I think there should be multiple @script directories created, for every concurrent build. There are multiple @tmp dirs, but the @script is shared between concurrent builds. |
New:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} If cannot reproduce - start job multiple times with some small time intervals between clicks. Clearly there is some race condition for access to JOB_NAME@script workspace directory - sometimes it succeeds, sometimes doesn't. Please note that *this is not a duplicate* for *I'm not entirely sure if the issue is unique for P4 Plugin* - it may be the case that whole Jenkins "Pipeline script from SCM" has architectural flaw. I think there should be multiple @script directories created, for every concurrent build. There are multiple @tmp dirs, but the @script is shared between concurrent builds. |
Description |
Original:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} If cannot reproduce - start job multiple times with some small time intervals between clicks. Clearly there is some race condition for access to JOB_NAME@script workspace directory - sometimes it succeeds, sometimes doesn't. Please note that *this is not a duplicate* for *I'm not entirely sure if the issue is unique for P4 Plugin* - it may be the case that whole Jenkins "Pipeline script from SCM" has architectural flaw. I think there should be multiple @script directories created, for every concurrent build. There are multiple @tmp dirs, but the @script is shared between concurrent builds. |
New:
# Create pipeline job that uses pipeline script via SCM (using p4plugin): {code:java} pipeline { agent { label 'master' } stages { stage("Repro") { steps { script { sh "pwd" sh "ls -l" sh "if [ -e this_should_be_cleaned_up ]; then false; else true; fi" input(message: "Fake input to reproduce, please DO NOT proceed, just start another build of this job", parameters: [booleanParam(defaultValue: false, description: "", name: "Mocked choice")]) sh "touch this_should_be_cleaned_up" } } } } } {code} # Set the quiet period of job to 0. # Start job twice # One job will fail with following error: {code} Lightweight checkout support not available, falling back to full checkout. Checking out PERFORCE_REPO_PATH //jenkins-${NODE_NAME}-${JOB_NAME}/... into /var/lib/jenkins/workspace/JOB_NAME@script to read Jenkinsfile.groovy ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 client -o jenkins-master-JOB_NAME + ... p4 client -i + ... client: jenkins-master-JOB_NAME ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + ... p4 counter change + ... p4 changes -m1 -ssubmitted //jenkins-master-JOB_NAME/... + Building on Node: master ... p4 client -o jenkins-master-JOB_NAME + ... p4 info + P4 Task: establishing connection. ... server: PERFORCE_SERVER ... node: NODE P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/JOB_NAME%40script/... + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/JOB_NAME%40script/...' is not under client's root '/var/lib/jenkins/workspace/JOB_NAME'. Finished: FAILURE {code} If cannot reproduce - start job multiple times with some small time intervals between clicks. Clearly there is some race condition for access to JOB_NAME@script workspace directory - sometimes it succeeds, sometimes doesn't. Please note that *this is not a duplicate* for *I'm not entirely sure if the issue is unique for P4 Plugin* - it may be the case that whole "Pipeline script from SCM" feature has architectural flaw. I think there should be multiple @script directories created, for every concurrent build. There are multiple @tmp dirs, but the @script is shared between concurrent builds. |
Rank | New: Ranked higher |
Labels | New: P4_SUPPORT |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |
I can reproduce this with lightweight checkout enabled as well.