[JIRA] (JENKINS-60447) Optionally ignore reconcile permissions errors

5 views
Skip to first unread message

kwirth@perforce.com (JIRA)

unread,
Dec 11, 2019, 11:38:03 AM12/11/19
to jenkinsc...@googlegroups.com
Karl Wirth created an issue
 
Jenkins / Improvement JENKINS-60447
Optionally ignore reconcile permissions errors
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: p4-plugin
Created: 2019-12-11 16:37
Environment: p4-plugin 1.10.7
Jenkins 2.176.1
Priority: Major Major
Reporter: Karl Wirth

If you are using Perforce server version 20141 or earlier P4jenkins uses a memory intensive version of 'p4 reconcile'. This older version skips permissions errors. For example:

P4 Task: tidying workspace to match have list.
... p4 reconcile -n -a -e -d -l -f /var/lib/jenkins/workspace/AutoCleanAnd___ +
Not able to delete: /var/lib/jenkins/workspace/AutoCleanAndSync/submit/cfg/prod_Release.cfg
duration: (68ms)

If you are using a later version of P4D a new streaming reconcile is used that is faster and uses less memory. In this implementation permissions errors fail the build. For example:

P4 Task: cleaning workspace to match have list
.... p4 reconcile -f -w /var/lib/jenkins/workspace/AutoCleanAndSync/
... +P4 Task: attempt: 1 ERROR: P4: Task Exception: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException:
 hudson.AbortException: P4JAVA: Error(s): operating system will not 
allow deletion of file /var/lib/jenkins/workspace/AutoCleanAndSync/submit/cfg/prod_Release.cfg on client.Finished: FAILURE

Please add a flag that allows the old behavior to be used or the permissions error to be ignored.

 

Reproduction Steps:

 

(1) Create a freestyle job that syncs a file on Linux.

(2) Use the following shell script as a build step:

mkdir -p $WORKSPACE/submit/cfg
echo "test edit" > $WORKSPACE/submit/cfg/prod_Release.cfg
chmod ugo-w $WORKSPACE/submit/cfg
ls -la $WORKSPACE/submit
ls -la $WORKSPACE/submit/cfg

(3) Run the build.

(4) Run the build again. Error will be seen.

Note: P4 will successfully delete the file but would throw error messages if it needed to update any of the files in this directory. Therefore I have also raised a P4Java bug.

$ p4 reconcile -w -f ...
//depot/permissions/submit/cfg/prod_Release.cfg#none - deleted as /filestoreSSD/18.2/ws/permissions/submit/cfg/prod_Release.cfg
//depot/permissions/toplevel/tst#1 - refreshing /filestoreSSD/Vagrant/Swarm/18.2/ws/permissions/toplevel/tst
open for write: /18.2/ws/permissions/toplevel/tmp.19271.140538254619008.94: Permission denied

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Dec 11, 2019, 11:48:03 AM12/11/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Labels: P4_A P4_VERIFY
Reply all
Reply to author
Forward
0 new messages