Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58949

If job fails in cleanup further triggering fails

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Do
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins 2.176.1
      P4-Plugin 1.10.3
    • Similar Issues:

      Description

       Reproduction Steps:

      • Created Triggered Pipeline AutoClean job
      • Add Trigger to Perforce server
      • Submit a file to trigger path.
      • Job runs.
      • Allow it to run to completion.
      • Submit a file to trigger path.
      • Jobs runs.
      • Press X on job before it gets to the sync stage. Result of job will be ABORTED.
      • Submit a file to trigger path.
      • Job DOES NOT run.

      Check Perforce P4 Trigger Log. It shows

      Last Perforce Change
      P4: Polling on: master with:jenkins-master-00405042-TriggeredBuildFailsAfterAbort-0
      No previous build found...
      P4: Polling: No changes in previous build.
      P4: Polling error; no previous change.
      P4: No changes
      

      Job will not run again until a manual build is performed.

       

      Example Jenkinsfile (in editor is OK):

      pipeline {
       agent {
        label 'docker-slave'
       }
       stages {
        stage("Get Sources") {
         steps {
          script {
             p4sync charset: 'none', credential: 'JenkinsMaster', populate: autoClean(delete: true, modtime: true, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: false, replace: true, tidy: false), source: depotSource('''//depot/test/...''')
             }
          }
         }
         stage("Invoke Builds") {
          steps {
             println "Build code here."
          }
         }
        }
       }
      

      Have attached the 'build.xml' of the aborted build and console log. Build.xml is missing TagAction.

       Additionally:

      If I manually strip TagAction from a build.xml then reboot the Jenkins machine all future polling is also broken. However so far I cannot abort a polled job at the correct time to cause the build.xml to be missing TagAction.

        Attachments

        1. build.xml
          7 kB
        2. log
          6 kB

          Activity

          Hide
          p4karl Karl Wirth added a comment -

          Note: Cause on customers site was manually aborted job.

          Show
          p4karl Karl Wirth added a comment - Note: Cause on customers site was manually aborted job.
          Hide
          p4karl Karl Wirth added a comment -

          Need to retest after changes in 10.0.1.4

          Show
          p4karl Karl Wirth added a comment - Need to retest after changes in 10.0.1.4
          Hide
          p4karl Karl Wirth added a comment -

          Tested and bug still seen. Additional changes going in at the moment so retest in 1 week.

          Show
          p4karl Karl Wirth added a comment - Tested and bug still seen. Additional changes going in at the moment so retest in 1 week.
          Hide
          p4paul Paul Allen added a comment -

          The P4 Trigger is a top level endpoint in Jenkins and wakes up all Subscribed Jenkins jobs, checks for changes then scheduled a build.  If the previous run failed or was aborted then no changes are recorded so further polling or in this case triggers will fail. A 'Build Now' would correct the state and all would be back to normal.

          Ideally we could carry the previous built changes forward, or change the logic to search the previous builds.  Perhaps recording the 'head' change would be enough for failed/aborted builds, but that might not be ideal in all circumstances. 

          Show
          p4paul Paul Allen added a comment - The P4 Trigger is a top level endpoint in Jenkins and wakes up all Subscribed Jenkins jobs, checks for changes then scheduled a build.  If the previous run failed or was aborted then no changes are recorded so further polling or in this case triggers will fail. A 'Build Now' would correct the state and all would be back to normal. Ideally we could carry the previous built changes forward, or change the logic to search the previous builds.  Perhaps recording the 'head' change would be enough for failed/aborted builds, but that might not be ideal in all circumstances. 
          Hide
          cbopardikar Charusheela Bopardikar added a comment -

          Workaround is available and possible fix may not be appropriate in all circumstances.

          Show
          cbopardikar Charusheela Bopardikar added a comment - Workaround is available and possible fix may not be appropriate in all circumstances.

            People

            • Assignee:
              cbopardikar Charusheela Bopardikar
              Reporter:
              p4karl Karl Wirth
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: