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

Jenkins authentication failes with "cannot be cast to hudson.model.UserProperty"

    Details

    • Similar Issues:

      Description

      We are noticing below error right after logging into Jenkins, which authenticates with LDAP accounts through Crowd (test authentication work fine in Crowd)

      Stack trace
      java.lang.ClassCastException: hudson.plugins.cigame.model.ScoreHistoryEntry cannot be cast to hudson.model.UserProperty
      at hudson.model.User.getProperty(User.java:261)
      at hudson.model.User.load(User.java:171)
      at hudson.model.User.<init>(User.java:128)
      at hudson.model.User.getOrCreate(User.java:412)
      at hudson.model.User.getAll(User.java:479)
      at hudson.model.User$FullNameIdResolver.resolveCanonicalId(User.java:913)
      at hudson.model.User.get(User.java:358)
      at hudson.model.User.get(User.java:331)
      at hudson.model.User.get(User.java:441)
      at jenkins.security.LastGrantedAuthoritiesProperty$SecurityListenerImpl.loggedIn(LastGrantedAuthoritiesProperty.java:103)
      at jenkins.security.SecurityListener.fireLoggedIn(SecurityListener.java:117)
      at hudson.security.AuthenticationProcessingFilter2.onSuccessfulAuthentication(AuthenticationProcessingFilter2.java:91)
      at org.acegisecurity.ui.AbstractProcessingFilter.successfulAuthentication(AbstractProcessingFilter.java:486)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:266)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:86)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at de.theit.jenkins.crowd.CrowdServletFilter.doFilter(CrowdServletFilter.java:195)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

          Hide
          jamiep Jamie Penman-Smithson added a comment - - edited

          I managed to fix this manually by editing the users/_USERNAME_/config.xml.

          In my case the problem was that several <scoreHistoryEntry/> elements were not within the correct hierarchy.

          If you find any <ScoreHistoryEntry/> elements:

                  <hudson.plugins.cigame.model.ScoreHistoryEntry>
                    <score>1.0</score>
                    <accountableRuns/>
                  </hudson.plugins.cigame.model.ScoreHistoryEntry>
          

          ...which are not within the <scoreHistoryEntries/> block:

              <hudson.plugins.cigame.UserScoreProperty plugin="ci-game@1.26">
                <score>7.0</score>
                <isNotParticipatingInGame>false</isNotParticipatingInGame>
                <scoreHistoryEntries class="linked-list">
                  <!-- All ScoreHistoryEntry elements should be here -->
                  <hudson.plugins.cigame.model.ScoreHistoryEntry>
                    <score>1.0</score>
                    <accountableRuns/>
                  </hudson.plugins.cigame.model.ScoreHistoryEntry>
          

          ...then moving them into this block should correct the problem.

          Backing up the config.xml beforehand is probably a good idea

          Show
          jamiep Jamie Penman-Smithson added a comment - - edited I managed to fix this manually by editing the users/_ USERNAME _/config.xml . In my case the problem was that several <scoreHistoryEntry/> elements were not within the correct hierarchy. If you find any <ScoreHistoryEntry/> elements: <hudson.plugins.cigame.model.ScoreHistoryEntry> <score>1.0</score> <accountableRuns/> </hudson.plugins.cigame.model.ScoreHistoryEntry> ...which are not within the <scoreHistoryEntries/> block: <hudson.plugins.cigame.UserScoreProperty plugin="ci-game@1.26"> <score>7.0</score> <isNotParticipatingInGame>false</isNotParticipatingInGame> <scoreHistoryEntries class="linked-list"> <!-- All ScoreHistoryEntry elements should be here --> <hudson.plugins.cigame.model.ScoreHistoryEntry> <score>1.0</score> <accountableRuns/> </hudson.plugins.cigame.model.ScoreHistoryEntry> ...then moving them into this block should correct the problem. Backing up the config.xml beforehand is probably a good idea
          Hide
          jamiep Jamie Penman-Smithson added a comment -

          I only had this happen to two users and once I'd fixed the config manually the problem didn't reoccur. I suspect the problem might be caused by an upgrade of the config provider plugin but I can't be certain.

          Show
          jamiep Jamie Penman-Smithson added a comment - I only had this happen to two users and once I'd fixed the config manually the problem didn't reoccur. I suspect the problem might be caused by an upgrade of the config provider plugin but I can't be certain.

            People

            • Assignee:
              Unassigned
              Reporter:
              vhari vamsi hari
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: