jenkinsci / jenkinsci/active-directory-plugin
[JENKINS-58940] ActiveDirectory.updateUserCache uncaughtException
- Dominant language
- Java
- Stars
- 53
- Forks
- 115
- PR merge metrics
- No merged PRs in 30d
Description
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)
---
Originally reported by ianw, imported from: ActiveDirectory.updateUserCache uncaughtException
fbelzunc
Raw content of original issue
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)
environment
```
Jenkins 2.176.2
active-directory:2.16
```
1 attachment
- [active_dir.dump.txt](https://issues.jenkins.io/secure/attachment/48335/active_dir.dump.txt)
Contributor guide
Research direction
Reproduce the startup/login flow described for Jenkins 2.176.2 with active-directory 2.16, then trace ActiveDirectoryUserDetail.updateUserInfo at line 213 and ActiveDirectoryUnixAuthenticationProvider$2.run at line 462. Compare the call chain through User.addProperty, User.save, UserIdMapper, and Util.fileToPath. Done means the login flow no longer produces the uncaught NullPointerException in the logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100