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

ActiveDirectory.updateUserCache uncaughtException

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.176.2
      active-directory:2.16

      Updated plugins using install_plugins.sh (the docker model).

       

      Upon startup, seeing the following the in the logs when user logs in. Login is successful however.

       

      hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException
      SEVERE: A thread (ActiveDirectory.updateUserCache 1/332) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.
      java.lang.NullPointerException
         at hudson.Util.fileToPath(Util.java:1501)
         at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)
         at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)
         at hudson.model.User.putUserFolderIfAbsent(User.java:806)
         at hudson.model.User.constructUserConfigFile(User.java:802)
         at hudson.model.User.save(User.java:796)
         at hudson.model.User.addProperty(User.java:336)
         at hudson.plugins.active_directory.ActiveDirectoryUserDetail.updateUserInfo(ActiveDirectoryUserDetail.java:213)
         at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider$2.run(ActiveDirectoryUnixAuthenticationProvider.java:462)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
         at java.lang.Thread.run(Thread.java:748) 

          [JENKINS-58940] ActiveDirectory.updateUserCache uncaughtException

          Ian Williams created issue -
          Ian Williams made changes -
          Description Original: Updated plugins using install_plugins.sh (the docker model).

           

          Upon startup, seeing the following the in the logs when user logs in. Login is successful however.

           hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException

          SEVERE: A thread (ActiveDirectory.updateUserCache [#1]/332) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.

          {{java.lang.NullPointerException}}{{        at hudson.Util.fileToPath(Util.java:1501)}}{{        at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)}}{{        at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)}}{{        at hudson.model.User.putUserFolderIfAbsent(User.java:806)}}{{        at hudson.model.User.constructUserConfigFile(User.java:802)}}{{        at hudson.model.User.save(User.java:796)}}{{        at hudson.model.User.addProperty(User.java:336)}}{{        at hudson.plugins.active_directory.ActiveDirectoryUserDetail.updateUserInfo(ActiveDirectoryUserDetail.java:213)}}{{        at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider$2.run(ActiveDirectoryUnixAuthenticationProvider.java:462)}}{{        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}{{        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}{{        at java.lang.Thread.run(Thread.java:748)}}

           
          New: Updated plugins using install_plugins.sh (the docker model).

           

          Upon startup, seeing the following the in the logs when user logs in. Login is successful however.

           

          {{hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException}}
          {{SEVERE: A thread (ActiveDirectory.updateUserCache [#1]/332) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.}}
          {{java.lang.NullPointerException}}
          {{   at hudson.Util.fileToPath(Util.java:1501)}}
          {{   at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)}}
          {{   at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)}}
          {{   at hudson.model.User.putUserFolderIfAbsent(User.java:806)}}
          {{   at hudson.model.User.constructUserConfigFile(User.java:802)}}
          {{   at hudson.model.User.save(User.java:796)}}
          {{   at hudson.model.User.addProperty(User.java:336)}}
          {{   at hudson.plugins.active_directory.ActiveDirectoryUserDetail.updateUserInfo(ActiveDirectoryUserDetail.java:213)}}
          {{   at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider$2.run(ActiveDirectoryUnixAuthenticationProvider.java:462)}}
          {{   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
          {{   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
          {{   at java.lang.Thread.run(Thread.java:748) }}
          Ian Williams made changes -
          Description Original: Updated plugins using install_plugins.sh (the docker model).

           

          Upon startup, seeing the following the in the logs when user logs in. Login is successful however.

           

          {{hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException}}
          {{SEVERE: A thread (ActiveDirectory.updateUserCache [#1]/332) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.}}
          {{java.lang.NullPointerException}}
          {{   at hudson.Util.fileToPath(Util.java:1501)}}
          {{   at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)}}
          {{   at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)}}
          {{   at hudson.model.User.putUserFolderIfAbsent(User.java:806)}}
          {{   at hudson.model.User.constructUserConfigFile(User.java:802)}}
          {{   at hudson.model.User.save(User.java:796)}}
          {{   at hudson.model.User.addProperty(User.java:336)}}
          {{   at hudson.plugins.active_directory.ActiveDirectoryUserDetail.updateUserInfo(ActiveDirectoryUserDetail.java:213)}}
          {{   at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider$2.run(ActiveDirectoryUnixAuthenticationProvider.java:462)}}
          {{   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
          {{   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
          {{   at java.lang.Thread.run(Thread.java:748) }}
          New: Updated plugins using install_plugins.sh (the docker model).

           

          Upon startup, seeing the following the in the logs when user logs in. Login is successful however.

           

          {{hudson.init.impl.InstallUncaughtExceptionHandler$DefaultUncaughtExceptionHandler uncaughtException}}
           {{SEVERE: A thread (ActiveDirectory.updateUserCache [#1]/332) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.}}
           {{java.lang.NullPointerException}}
           {{   at hudson.Util.fileToPath(Util.java:1501)}}
           {{   at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)}}
           {{   at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)}}
           {{   at hudson.model.User.putUserFolderIfAbsent(User.java:806)}}
           {{   at hudson.model.User.constructUserConfigFile(User.java:802)}}
           {{   at hudson.model.User.save(User.java:796)}}
           {{   at hudson.model.User.addProperty(User.java:336)}}
           {{   at hudson.plugins.active_directory.ActiveDirectoryUserDetail.updateUserInfo(ActiveDirectoryUserDetail.java:213)}}
           {{   at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider$2.run(ActiveDirectoryUnixAuthenticationProvider.java:462)}}
           {{   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)}}
           {{   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)}}
           {{   at java.lang.Thread.run(Thread.java:748) }}
          Ian Williams made changes -
          Issue Type Original: Improvement [ 4 ] New: Bug [ 1 ]
          Ian Williams made changes -
          Attachment New: active_dir.dump.txt [ 48335 ]

          Michelle Pogado added a comment - - edited

          Experiencing the same exact issue.

          Environment:

          Jenkins 2.189
          Active Directory Plugin 2.16
          CentOS 7
          

          *Plugins updated via the Plugin Manager UI

          Update:
          Tried downgrading AD Plugin from 2.16 to 2.14 and still getting the exact same stack trace above.
          Are there any workarounds for this?

          Michelle Pogado added a comment - - edited Experiencing the same exact issue. Environment: Jenkins 2.189 Active Directory Plugin 2.16 CentOS 7 *Plugins updated via the Plugin Manager UI Update: Tried downgrading AD Plugin from 2.16 to 2.14 and still getting the exact same stack trace above. Are there any workarounds for this?

          Paulius Bulotas added a comment - - edited

          2.176.3, after updating bunch of plugins, I get NPE when logging in or saving user preferences:

           java.lang.NullPointerException
           at hudson.Util.fileToPath(Util.java:1501)
           at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)
           at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)
           at hudson.model.User.putUserFolderIfAbsent(User.java:806)
           at hudson.model.User.constructUserConfigFile(User.java:802)
           at hudson.model.User.save(User.java:796)
           at hudson.model.User.doConfigSubmit(User.java:868)
          

          And we are using LDAP, CentOS 7 with SELinux enabled.

          Paulius Bulotas added a comment - - edited 2.176.3, after updating bunch of plugins, I get NPE when logging in or saving user preferences: java.lang.NullPointerException at hudson.Util.fileToPath(Util.java:1501) at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145) at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92) at hudson.model.User.putUserFolderIfAbsent(User.java:806) at hudson.model.User.constructUserConfigFile(User.java:802) at hudson.model.User.save(User.java:796) at hudson.model.User.doConfigSubmit(User.java:868) And we are using LDAP, CentOS 7 with SELinux enabled.

          Different stacktrace in the begining, ends the same:

          There were no failing Constraints! The build will be marked as SUCCESS
          FATAL: java.lang.NullPointerException
          java.lang.NullPointerException
          	at hudson.Util.fileToPath(Util.java:1501)
          	at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)
          	at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)
          	at hudson.model.User.putUserFolderIfAbsent(User.java:806)
          	at hudson.model.User.constructUserConfigFile(User.java:802)
          	at hudson.model.User.save(User.java:796)
          	at hudson.model.User.addProperty(User.java:336)
          	at hudson.security.LDAPSecurityRealm.updateUserDetails(LDAPSecurityRealm.java:835)
          	at hudson.security.LDAPSecurityRealm.updateUserDetails(LDAPSecurityRealm.java:796)
          	at hudson.security.LDAPSecurityRealm.loadUserByUsername(LDAPSecurityRealm.java:786)
          	at jenkins.security.UserDetailsCache$Retriever.call(UserDetailsCache.java:172)
          	at jenkins.security.UserDetailsCache$Retriever.call(UserDetailsCache.java:161)
          	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4767)
          	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3568)
          	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350)
          	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2313)
          	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2228)
          Caused: com.google.common.util.concurrent.UncheckedExecutionException
          	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2234)
          	at com.google.common.cache.LocalCache.get(LocalCache.java:3965)
          	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4764)
          	at jenkins.security.UserDetailsCache.loadUserByUsername(UserDetailsCache.java:127)
          	at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1239)
          	at hudson.model.User$CanonicalIdResolver.resolve(User.java:1180)
          	at hudson.model.User.get(User.java:505)
          	at hudson.model.User.get(User.java:475)
          	at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:398)
          	at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:466)
          	at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:137)
          	at hudson.model.AbstractBuild.calculateCulprits(AbstractBuild.java:341)
          	at jenkins.scm.RunWithSCM.getCulprits(RunWithSCM.java:95)
          	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:330)
          	at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:132)
          	at hudson.model.AbstractBuild.calculateCulprits(AbstractBuild.java:341)
          	at jenkins.scm.RunWithSCM.getCulprits(RunWithSCM.java:95)
          	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:330)
          	at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:132)
          	at hudson.model.AbstractBuild.calculateCulprits(AbstractBuild.java:341)
          	at jenkins.scm.RunWithSCM.getCulprits(RunWithSCM.java:95)
          	at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:330)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:639)
          	at hudson.model.Run.execute(Run.java:1843)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          

          Paulius Bulotas added a comment - Different stacktrace in the begining, ends the same: There were no failing Constraints! The build will be marked as SUCCESS FATAL: java.lang.NullPointerException java.lang.NullPointerException at hudson.Util.fileToPath(Util.java:1501) at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145) at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92) at hudson.model.User.putUserFolderIfAbsent(User.java:806) at hudson.model.User.constructUserConfigFile(User.java:802) at hudson.model.User.save(User.java:796) at hudson.model.User.addProperty(User.java:336) at hudson.security.LDAPSecurityRealm.updateUserDetails(LDAPSecurityRealm.java:835) at hudson.security.LDAPSecurityRealm.updateUserDetails(LDAPSecurityRealm.java:796) at hudson.security.LDAPSecurityRealm.loadUserByUsername(LDAPSecurityRealm.java:786) at jenkins.security.UserDetailsCache$Retriever.call(UserDetailsCache.java:172) at jenkins.security.UserDetailsCache$Retriever.call(UserDetailsCache.java:161) at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4767) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3568) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2313) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2228) Caused: com.google.common.util.concurrent.UncheckedExecutionException at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2234) at com.google.common.cache.LocalCache.get(LocalCache.java:3965) at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4764) at jenkins.security.UserDetailsCache.loadUserByUsername(UserDetailsCache.java:127) at hudson.model.User$UserIDCanonicalIdResolver.resolveCanonicalId(User.java:1239) at hudson.model.User$CanonicalIdResolver.resolve(User.java:1180) at hudson.model.User.get(User.java:505) at hudson.model.User.get(User.java:475) at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:398) at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:466) at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:137) at hudson.model.AbstractBuild.calculateCulprits(AbstractBuild.java:341) at jenkins.scm.RunWithSCM.getCulprits(RunWithSCM.java:95) at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:330) at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:132) at hudson.model.AbstractBuild.calculateCulprits(AbstractBuild.java:341) at jenkins.scm.RunWithSCM.getCulprits(RunWithSCM.java:95) at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:330) at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:132) at hudson.model.AbstractBuild.calculateCulprits(AbstractBuild.java:341) at jenkins.scm.RunWithSCM.getCulprits(RunWithSCM.java:95) at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:330) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:639) at hudson.model.Run.execute(Run.java:1843) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)

          Another one:

          java.lang.NullPointerException
          	at hudson.Util.fileToPath(Util.java:1501)
          	at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145)
          	at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92)
          	at hudson.model.User.putUserFolderIfAbsent(User.java:806)
          	at hudson.model.User.constructUserConfigFile(User.java:802)
          	at hudson.model.User.save(User.java:796)
          	at hudson.model.User.addProperty(User.java:336)
          	at hudson.plugins.git.GitChangeSet.setMail(GitChangeSet.java:416)
          	at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:407)
          	at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:466)
          	at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:137)
          

          Paulius Bulotas added a comment - Another one: java.lang.NullPointerException at hudson.Util.fileToPath(Util.java:1501) at hudson.model.UserIdMapper.createDirectoryForNewUser(UserIdMapper.java:145) at hudson.model.UserIdMapper.putIfAbsent(UserIdMapper.java:92) at hudson.model.User.putUserFolderIfAbsent(User.java:806) at hudson.model.User.constructUserConfigFile(User.java:802) at hudson.model.User.save(User.java:796) at hudson.model.User.addProperty(User.java:336) at hudson.plugins.git.GitChangeSet.setMail(GitChangeSet.java:416) at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:407) at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:466) at jenkins.scm.RunWithSCM.calculateCulprits(RunWithSCM.java:137)

          Weirdly, on my instances, I had that issue and the bug was caused by the update of the `Prometheus Metrics` plugin from 2.0.0 to 2.0.6

          Julien Duchesne added a comment - Weirdly, on my instances, I had that issue and the bug was caused by the update of the `Prometheus Metrics` plugin from 2.0.0 to 2.0.6

            fbelzunc FĂ©lix Belzunce Arcos
            ianw Ian Williams
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: