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

Broken jobs after upgrade to 1.651.2 security update

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • github-oauth-plugin
    • Ubuntu 14.04, 15.04, 15.10
      Windows Server 2012 R2

      After upgrading to 1.651.2 security update, jobs are getting this error:

      FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
      java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
      	at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:644)
      	at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1049)
      	at hudson.model.User.get(User.java:395)
      	at hudson.model.User.get(User.java:364)
      	at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:374)
      	at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:435)
      	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:350)
      	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:346)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:672)
      	at hudson.model.Run.execute(Run.java:1763)
      	at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      

      Also, in the "Manage Old Data" section, I see very suspicious stuff:

      hudson.matrix.MatrixRun	   Team » carbon-c-relay » precise #2	1.653	
      hudson.matrix.MatrixBuild  Team » proj #22	1.653	
      hudson.model.FreeStyleBuild	Team » other #255	1.653
      

      Why is there any data in 1.653 format if I'm using 1.651.2 (and upgraded from 1.651.1)?

      Is there any archive with old debian packages to be able to downgrade? All our jobs are broken now. Thanks!

          [JENKINS-34775] Broken jobs after upgrade to 1.651.2 security update

          Leandro Lucarella created issue -

          I could find the old version in http://pkg.jenkins-ci.org/debian-stable/ and reverted and all works fine with 1.651.1.

          Leandro Lucarella added a comment - I could find the old version in http://pkg.jenkins-ci.org/debian-stable/ and reverted and all works fine with 1.651.1.

          Marco Krikke added a comment -

          Same issue here, downgrading Jenkins resolved the issue. After upgrading to 2.3, I did not update any plugins. The only change was related to the Github Pull Request Builder (adding the -Dhudson.model.ParametersAction.safeParameters parameter, see JENKINS-34762).

          In which step in the job do you see this error? For me, it seems related to updating the commit status by the Github Pull Request builder plugin (test results are recorded).

          00:04:23.555 Total time: 4 mins 15.361 secs
          00:04:24.812 Build step 'Invoke Gradle script' changed build result to SUCCESS
          00:04:24.820 [workspace] $ /bin/sh -xe /tmp/hudson3135090572493614307.sh
          00:04:24.824 + find . -name TEST-*.xml -type f -exec touch {} ;
          00:04:53.112 Recording test results
          00:04:54.418 FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
          00:04:54.419 java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
          00:04:54.419 	at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:639)
          00:04:54.419 	at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1048)
          00:04:54.419 	at hudson.model.User.get(User.java:394)
          00:04:54.419 	at hudson.model.User.get(User.java:363)
          00:04:54.419 	at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:374)
          00:04:54.419 	at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:435)
          00:04:54.419 	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:350)
          00:04:54.419 	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:346)
          00:04:54.419 	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:672)
          00:04:54.419 	at hudson.model.Run.execute(Run.java:1763)
          00:04:54.419 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          00:04:54.419 	at hudson.model.ResourceController.execute(ResourceController.java:98)
          00:04:54.419 	at hudson.model.Executor.run(Executor.java:410)
          00:04:54.722 Setting status of xxx to FAILURE with url https://xxx/job/xxx/4095/ and message: 'Build failed
          00:04:54.722  '
          00:04:55.165 Finished: FAILURE
          

          Marco Krikke added a comment - Same issue here, downgrading Jenkins resolved the issue. After upgrading to 2.3, I did not update any plugins. The only change was related to the Github Pull Request Builder (adding the -Dhudson.model.ParametersAction.safeParameters parameter, see JENKINS-34762 ). In which step in the job do you see this error? For me, it seems related to updating the commit status by the Github Pull Request builder plugin (test results are recorded). 00:04:23.555 Total time: 4 mins 15.361 secs 00:04:24.812 Build step 'Invoke Gradle script' changed build result to SUCCESS 00:04:24.820 [workspace] $ /bin/sh -xe /tmp/hudson3135090572493614307.sh 00:04:24.824 + find . -name TEST-*.xml -type f -exec touch {} ; 00:04:53.112 Recording test results 00:04:54.418 FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken 00:04:54.419 java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken 00:04:54.419 at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:639) 00:04:54.419 at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1048) 00:04:54.419 at hudson.model.User.get(User.java:394) 00:04:54.419 at hudson.model.User.get(User.java:363) 00:04:54.419 at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:374) 00:04:54.419 at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:435) 00:04:54.419 at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:350) 00:04:54.419 at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:346) 00:04:54.419 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:672) 00:04:54.419 at hudson.model.Run.execute(Run.java:1763) 00:04:54.419 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 00:04:54.419 at hudson.model.ResourceController.execute(ResourceController.java:98) 00:04:54.419 at hudson.model.Executor.run(Executor.java:410) 00:04:54.722 Setting status of xxx to FAILURE with url https: //xxx/job/xxx/4095/ and message: 'Build failed 00:04:54.722 ' 00:04:55.165 Finished: FAILURE

          Leandro Lucarella added a comment - - edited

          After recording artefact’s fingerprints:

          Recording test results
          Archiving artifacts
          Recording fingerprints
          FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
          java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
          	at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:644)
          	at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1049)
          ...
          
          

          The step after recording fingerprints in the job there is the Chuck Norris plugin and that's the last step in the job.

          Leandro Lucarella added a comment - - edited After recording artefact’s fingerprints: Recording test results Archiving artifacts Recording fingerprints FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:644) at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1049) ... The step after recording fingerprints in the job there is the Chuck Norris plugin and that's the last step in the job.

          Marco Krikke added a comment -

          Are you running a Pull Request job using the Github Pull Request Builder plugin? Not sure when that plugin sets the commit status, but that might be the last step in the build?

          Marco Krikke added a comment - Are you running a Pull Request job using the Github Pull Request Builder plugin? Not sure when that plugin sets the commit status, but that might be the last step in the build?

          Yes, I am, so it could be that.

          Leandro Lucarella added a comment - Yes, I am, so it could be that.
          Marco Krikke made changes -
          Component/s New: ghprb-plugin [ 17227 ]

          Marco Krikke added a comment -

          janinko any clue if this is related to the ghprb-plugin? Thanks.

          Marco Krikke added a comment - janinko any clue if this is related to the ghprb-plugin? Thanks.

          Nick Lykins added a comment - - edited

          We were seeing the same thing on our system after upgrading to Jenkins 2.3. A downgrade back to 2.2 resolved the issue. It was concerning though since we saw the problem occurring in some build jobs but not other ones. I can confirm, in cases where it happened, it was associated with the "setting commit status" build step. The failures were happening in cases where the builds were kicked off by an upstream pull request job. Note, this was happening on a Windows build machine, so the issue doesn't seem to be platform specific.

          14:25:11 Setting commit status on GitHub for https://github.com/***
          14:25:11 Archiving artifacts
          14:25:12 FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
          14:25:12 java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken
          14:25:12 	at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:639)
          14:25:12 	at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1048)
          14:25:12 	at hudson.model.User.get(User.java:394)
          14:25:12 	at hudson.model.User.get(User.java:363)
          14:25:12 	at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:374)
          14:25:12 	at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:435)
          14:25:12 	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:350)
          14:25:12 	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:672)
          14:25:12 	at hudson.model.Run.execute(Run.java:1763)
          14:25:12 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          14:25:12 	at hudson.model.ResourceController.execute(ResourceController.java:98)
          14:25:12 	at hudson.model.Executor.run(Executor.java:410)??
          

          Nick Lykins added a comment - - edited We were seeing the same thing on our system after upgrading to Jenkins 2.3. A downgrade back to 2.2 resolved the issue. It was concerning though since we saw the problem occurring in some build jobs but not other ones. I can confirm, in cases where it happened, it was associated with the "setting commit status" build step. The failures were happening in cases where the builds were kicked off by an upstream pull request job. Note, this was happening on a Windows build machine, so the issue doesn't seem to be platform specific. 14:25:11 Setting commit status on GitHub for https: //github.com/*** 14:25:11 Archiving artifacts 14:25:12 FATAL: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken 14:25:12 java.lang.ClassCastException: org.acegisecurity.providers.UsernamePasswordAuthenticationToken cannot be cast to org.jenkinsci.plugins.GithubAuthenticationToken 14:25:12 at org.jenkinsci.plugins.GithubSecurityRealm.loadUserByUsername(GithubSecurityRealm.java:639) 14:25:12 at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1048) 14:25:12 at hudson.model.User.get(User.java:394) 14:25:12 at hudson.model.User.get(User.java:363) 14:25:12 at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:374) 14:25:12 at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:435) 14:25:12 at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:350) 14:25:12 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:672) 14:25:12 at hudson.model.Run.execute(Run.java:1763) 14:25:12 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 14:25:12 at hudson.model.ResourceController.execute(ResourceController.java:98) 14:25:12 at hudson.model.Executor.run(Executor.java:410)??

          Shawn Baker added a comment -

          I'm seeing this issue too, and I upgraded from 1.625.3 to 1.651.2. Same old data messages with something about 1.653 as the version. It looked fishy, so I reverted back to 1.625.3.

          Shawn Baker added a comment - I'm seeing this issue too, and I upgraded from 1.625.3 to 1.651.2. Same old data messages with something about 1.653 as the version. It looked fishy, so I reverted back to 1.625.3.

            sag47 Sam Gleske
            lucasocio Leandro Lucarella
            Votes:
            26 Vote for this issue
            Watchers:
            44 Start watching this issue

              Created:
              Updated:
              Resolved: