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

After build failure, polling stops with "P4: Polling error; no previous change."

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins 2.263.3 (Windows)
      P4 Plugin 1.11.2
    • Similar Issues:

      Description

      Sometimes when a job fails, it will stop polling Perforce for new changes and need to be manually kicked. This obviously greatly affects our CI pipeline.

      This is found in the p4 polling log:

      Started on Feb 2, 2021, 9:54:00 AM
      Executor number at runtime: 0
      P4: Polling on: master with:Mainline-EC2AMAZ-AAAAAAA
      P4: Polling: No changes in previous build.
      P4: Polling error; no previous change.
      Done. Took 5 ms
      No changes
      

      When this happens, the previous build will not have any changes listed, despite its p4 polling log declaring that it found changes. Perhaps the job is failing to record what changes it found?

      Here is our pipeline. Of special note, we use a "staticSpec()" workspace and specify a custom "syncID" attribute. This is because we have multiple jobs sharing a same workspace per node (to take advantage of build object caching).

      node('mainline') {
          stage('Sync') {
              dir ("C:\\Mainline") {
                  checkout perforce(
                      credential: 'P4Account',
                      filter: [
                          pathFilter('//depot/tests'),
                          pathFilter('//depot/docs'),
                      ],
                      populate: syncOnly(
                          force: false, have: true, modtime: false,
                          parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'],
                          pin: '', quiet: true, revert: false
                      ),
                      workspace: staticSpec(
                          charset: 'none',
                          name: "Mainline-${env.COMPUTERNAME}",
                          syncID: "Mainline-${env.COMPUTERNAME}-${env.JOB_NAME}",
                          pinHost: false
                      )
                  )
              }
          }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            p4karl Karl Wirth added a comment -

            Hi Adrien Siebert , Jay Spang - Think  have reproduced this so thanks for highlighting it.

            Reproduction Steps:

            ++(1) Start a temporary slave at a Linux or Windows command line using Java. For example:

            java -jar agent.jar -jnlpUrl http://JENKINS-SERVER:8080/computer/LinuxDesktop/slave-agent.jnlp -workDir "/filestore/jenkins_node/root"

            (2) Create a polled freestyle job that builds the path "//depot/test/..." that only runs on slave above. Add a build step that sleeps for 60 seconds.

            (3) Manually build job.

            (4) Submit a file to "//depot/test/...".

            (5) Poll job. This creates a build. Let the build finish.

            (6) Submit a second file to "//depot/test/...".

            (7) Poll job. This creates a build.

            (8) Kill the java process above during the 60 second sleep build step.

            (9) Submit a third file to "//depot/test/...".

            (10) Poll job. No job builds. Polling log importantly says "P4: Polling: No changes in previous build." Does not mention succesful build.

             

            Workaround: Must manually build the job to create a new job with valid syncID.

             

            Below is some of the important build information. Build 11 failed, Build 10 worked. Note that there is no TagAction block in failed build.

            /var/lib/jenkins/jobs/FreestyleBoring# cat nextBuildNumber 
            12
            
            
            /var/lib/jenkins/jobs/FreestyleBoring# cat scm-polling.log 
            Started on Feb 23, 2021 3:49:28 PM
            Executor number at runtime: 0
            P4: Polling on: master with:jenkins-master-FreestyleBoring-0
            No previous build found...
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            Done. Took 1 ms
            No changes
            
            /var/lib/jenkins/jobs/FreestyleBoring# cd builds/
            /var/lib/jenkins/jobs/FreestyleBoring/builds# ls -al
            total 56
            drwxr-xr-x 13 jenkins jenkins 4096 Feb 23 15:49 .
            drwxr-xr-x  3 jenkins jenkins 4096 Feb 23 15:48 ..
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 11 16:43 1
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 23 15:47 10
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 23 15:49 11
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 11 16:45 2
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 12 11:17 3
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 12 11:18 4
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 12 11:29 5
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 12 11:34 6
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 23 15:25 7
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 23 15:40 8
            drwxr-xr-x  2 jenkins jenkins 4096 Feb 23 15:47 9
            -rw-r--r--  1 jenkins jenkins    0 Feb 11 16:43 legacyIds
            -rw-r--r--  1 jenkins jenkins  129 Feb 23 15:49 permalinks
            
            /var/lib/jenkins/jobs/FreestyleBoring/builds# cat permalinks 
            lastCompletedBuild 11
            lastFailedBuild 11
            lastStableBuild 10
            lastSuccessfulBuild 10
            lastUnstableBuild -1
            lastUnsuccessfulBuild 11
            
            /var/lib/jenkins/jobs/FreestyleBoring/builds# cat 11/build.xml
            <?xml version='1.1' encoding='UTF-8'?>
            <build>
              <actions>
                <hudson.model.CauseAction>
                  <causeBag class="linked-hash-map">
                    <entry>
                      <hudson.triggers.SCMTrigger_-SCMTriggerCause/>
                      <int>1</int>
                    </entry>
                  </causeBag>
                </hudson.model.CauseAction>
                <hudson.triggers.SCMTrigger_-BuildAction/>
                <com.cloudbees.plugins.credentials.builds.CredentialsParameterBinder plugin="credentials@2.3.11">
                  <boundCredentials class="concurrent-hash-map"/>
                </com.cloudbees.plugins.credentials.builds.CredentialsParameterBinder>
              </actions>
              <queueId>14497</queueId>
              <timestamp>1614095330297</timestamp>
              <startTime>1614095330300</startTime>
              <result>FAILURE</result>
              <duration>24072</duration>
              <charset>UTF-8</charset>
              <keepLog>false</keepLog>
              <builtOn>LinuxDesktop</builtOn>
              <workspace>/filestoreSSD/Vagrant/Swarm/20.1/jenkins_node/root/workspace/FreestyleBoring</workspace>
              <hudsonVersion>2.235.1</hudsonVersion>
              <scm class="hudson.scm.NullChangeLogParser"/>
              <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
            </build>
            
            Show
            p4karl Karl Wirth added a comment - Hi Adrien Siebert , Jay Spang - Think  have reproduced this so thanks for highlighting it. Reproduction Steps: ++(1) Start a temporary slave at a Linux or Windows command line using Java. For example: java -jar agent.jar -jnlpUrl http: //JENKINS-SERVER:8080/computer/LinuxDesktop/slave-agent.jnlp -workDir "/filestore/jenkins_node/root" (2) Create a polled freestyle job that builds the path "//depot/test/..." that only runs on slave above. Add a build step that sleeps for 60 seconds. (3) Manually build job. (4) Submit a file to "//depot/test/...". (5) Poll job. This creates a build. Let the build finish. (6) Submit a second file to "//depot/test/...". (7) Poll job. This creates a build. (8) Kill the java process above during the 60 second sleep build step. (9) Submit a third file to "//depot/test/...". (10) Poll job. No job builds. Polling log importantly says "P4: Polling: No changes in previous build ." Does not mention succesful build.   Workaround: Must manually build the job to create a new job with valid syncID.   Below is some of the important build information. Build 11 failed, Build 10 worked. Note that there is no TagAction block in failed build. / var /lib/jenkins/jobs/FreestyleBoring# cat nextBuildNumber 12 / var /lib/jenkins/jobs/FreestyleBoring# cat scm-polling.log Started on Feb 23, 2021 3:49:28 PM Executor number at runtime: 0 P4: Polling on: master with:jenkins-master-FreestyleBoring-0 No previous build found... P4: Polling: No changes in previous build. P4: Polling error; no previous change. Done. Took 1 ms No changes / var /lib/jenkins/jobs/FreestyleBoring# cd builds/ / var /lib/jenkins/jobs/FreestyleBoring/builds# ls -al total 56 drwxr-xr-x 13 jenkins jenkins 4096 Feb 23 15:49 . drwxr-xr-x 3 jenkins jenkins 4096 Feb 23 15:48 .. drwxr-xr-x 2 jenkins jenkins 4096 Feb 11 16:43 1 drwxr-xr-x 2 jenkins jenkins 4096 Feb 23 15:47 10 drwxr-xr-x 2 jenkins jenkins 4096 Feb 23 15:49 11 drwxr-xr-x 2 jenkins jenkins 4096 Feb 11 16:45 2 drwxr-xr-x 2 jenkins jenkins 4096 Feb 12 11:17 3 drwxr-xr-x 2 jenkins jenkins 4096 Feb 12 11:18 4 drwxr-xr-x 2 jenkins jenkins 4096 Feb 12 11:29 5 drwxr-xr-x 2 jenkins jenkins 4096 Feb 12 11:34 6 drwxr-xr-x 2 jenkins jenkins 4096 Feb 23 15:25 7 drwxr-xr-x 2 jenkins jenkins 4096 Feb 23 15:40 8 drwxr-xr-x 2 jenkins jenkins 4096 Feb 23 15:47 9 -rw-r--r-- 1 jenkins jenkins 0 Feb 11 16:43 legacyIds -rw-r--r-- 1 jenkins jenkins 129 Feb 23 15:49 permalinks / var /lib/jenkins/jobs/FreestyleBoring/builds# cat permalinks lastCompletedBuild 11 lastFailedBuild 11 lastStableBuild 10 lastSuccessfulBuild 10 lastUnstableBuild -1 lastUnsuccessfulBuild 11 / var /lib/jenkins/jobs/FreestyleBoring/builds# cat 11/build.xml <?xml version= '1.1' encoding= 'UTF-8' ?> <build> <actions> <hudson.model.CauseAction> <causeBag class= "linked-hash-map" > <entry> <hudson.triggers.SCMTrigger_-SCMTriggerCause/> < int >1</ int > </entry> </causeBag> </hudson.model.CauseAction> <hudson.triggers.SCMTrigger_-BuildAction/> <com.cloudbees.plugins.credentials.builds.CredentialsParameterBinder plugin= "credentials@2.3.11" > <boundCredentials class= "concurrent-hash-map" /> </com.cloudbees.plugins.credentials.builds.CredentialsParameterBinder> </actions> <queueId>14497</queueId> <timestamp>1614095330297</timestamp> <startTime>1614095330300</startTime> <result>FAILURE</result> <duration>24072</duration> <charset>UTF-8</charset> <keepLog> false </keepLog> <builtOn>LinuxDesktop</builtOn> <workspace>/filestoreSSD/Vagrant/Swarm/20.1/jenkins_node/root/workspace/FreestyleBoring</workspace> <hudsonVersion>2.235.1</hudsonVersion> <scm class= "hudson.scm.NullChangeLogParser" /> <culprits class= "com.google.common.collect.EmptyImmutableSortedSet" /> </build>
            Hide
            jazzyjayx Jay Spang added a comment -

            Hey Karl Wirth, I just had someone on my team complain about this bug, so I wanted to see if there was any progress made in resolving it?

            We have the workaround/mitigation implemented, but it's still causing a bit of pain with our dev team.

            Show
            jazzyjayx Jay Spang added a comment - Hey Karl Wirth , I just had someone on my team complain about this bug, so I wanted to see if there was any progress made in resolving it? We have the workaround/mitigation implemented, but it's still causing a bit of pain with our dev team.
            Hide
            p4karl Karl Wirth added a comment -

            Hi Jay Spang - Thanks for the update. Will highlight this to the product managers.

            Show
            p4karl Karl Wirth added a comment - Hi Jay Spang - Thanks for the update. Will highlight this to the product managers.
            Hide
            jazzyjayx Jay Spang added a comment -

            Hey Karl Wirth any update on getting this prioritized? This burned us again today.

            Show
            jazzyjayx Jay Spang added a comment - Hey Karl Wirth any update on getting this prioritized? This burned us again today.
            Hide
            bsmoyers Brian added a comment -

            +1 we're hitting this issue now also after converting from the old p4 plugin.  We've seen jobs that were previously polling correctly begin to fail polling after a failed job (from forced jenkins master restart).  

            Show
            bsmoyers Brian added a comment - +1 we're hitting this issue now also after converting from the old p4 plugin.  We've seen jobs that were previously polling correctly begin to fail polling after a failed job (from forced jenkins master restart).  

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jayspang Jay Spang
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: