-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Any.
Due to change:
c19867326551e3a3e711 => https://github.com/jenkinsci/jenkins/commit/c19867326551e3a3e711bfbb5e32c48c48257e02
...user configurations cannot any longer be saved correctly on certain Jenkins installations. When the user configuration is not saved/submitted correctly, the user cannot access private views anymore.
Due to this added check: +<j:if test="${d.enabled}">
certain (disabled) properties are skipped which generates post data similar to this one:
{"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@comain.com"}, "userProperty2": {"primaryViewName": ""}}
Please notice the absence of "userProperty1"
After this data has been posted all user's private views just generate an error like this:
javax.servlet.ServletException: java.lang.NullPointerException org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:597) org.kohsuke.stapler.Stapler.invoke(Stapler.java:640) org.kohsuke.stapler.MetaClass$7.doDispatch(MetaClass.java:242) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562 [cut]
And the views cannot be accessed. Even more strange is that the user's config.xml contains this:
<user>
<fullName>myname</fullName>
<properties>
<hudson.tasks.Mailer_-UserProperty>
<emailAddress></emailAddress>
</hudson.tasks.Mailer_-UserProperty>
<null/>
<hudson.model.MyViewsProperty>
[cut]
Please notice the <null/>
This is repeatable for every user in our system.
Now for the reeeeaally strange part. If I temper the post data from this:
{"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty2": {"primaryViewName": ""}}
to look like this:
{"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty1": {"primaryViewName": ""}}
The config is saved correctly and all private views becomes available again.
Even more strange: in the future, the user will be able to resave the configuration without tempering with the post data, and everything will work fine - even though future post-data will look exactly like the original post data (userProperty2).
It is of course a huge issue for us. Users cannot view their views until I form post tempered config data.
We are using LDAP for authentication
and view plugins like
Favorites
Nested views
Dashboard
Section view
Best Regards
Gustaf
[JENKINS-9062] Cannot save configurations for user under certain circumstances.
Description |
Original:
Due to change: c19867326551e3a3e711 => https://github.com/jenkinsci/jenkins/commit/c19867326551e3a3e711bfbb5e32c48c48257e02 ...user configurations cannot any longer be saved correctly on certain Jenkins installations. When the user configuration is not saved/submitted correctly, the user cannot access private views anymore. Due to this added check: +<j:if test="${d.enabled}"> certain (disabled) properties are skipped which generates post data similar to this one: {"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@comain.com"}, "userProperty2": {"primaryViewName": ""}} Please notice the absence of "userProperty1" After this data has been posted all user's private views just generate an error like this: javax.servlet.ServletException: java.lang.NullPointerException org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:597) org.kohsuke.stapler.Stapler.invoke(Stapler.java:640) org.kohsuke.stapler.MetaClass$7.doDispatch(MetaClass.java:242) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562 [cut] And the views cannot be accessed. Even more strange is that the user's config.xml contains this: <user> <fullName>myname</fullName> <properties> <hudson.tasks.Mailer_-UserProperty> <emailAddress></emailAddress> </hudson.tasks.Mailer_-UserProperty> <null/> <hudson.model.MyViewsProperty> [cut] Please notice the <null/>(!) This is repeatable for every user in our system. Now for the reeeeaally strange part. If I temper the post data from this: {"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty2": {"primaryViewName": ""}} to look like this: {"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty1": {"primaryViewName": ""}} The config is saved correctly and all private views becomes available again. Even more strange: in the future, the user will be able to resave the configuration _without_ tempering with the post data, and everything will work fine - even though future post-data will look exactly like the original post data (userProperty2). It is of course a huge issue for us. Users cannot view their views until I form post tempered config data. We are using LDAP for authentication and view plugins like Favorites Nested views Dashboard Section view Best Regards Gustaf |
New:
Due to change: c19867326551e3a3e711 => https://github.com/jenkinsci/jenkins/commit/c19867326551e3a3e711bfbb5e32c48c48257e02 ...user configurations cannot any longer be saved correctly on certain Jenkins installations. When the user configuration is not saved/submitted correctly, the user cannot access private views anymore. Due to this added check: +<j:if test="${d.enabled}"> certain (disabled) properties are skipped which generates post data similar to this one: {code}{"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@comain.com"}, "userProperty2": {"primaryViewName": ""}}{code} Please notice the absence of "userProperty1" After this data has been posted all user's private views just generate an error like this: {code}javax.servlet.ServletException: java.lang.NullPointerException org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:597) org.kohsuke.stapler.Stapler.invoke(Stapler.java:640) org.kohsuke.stapler.MetaClass$7.doDispatch(MetaClass.java:242) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562 [cut] {code} And the views cannot be accessed. Even more strange is that the user's config.xml contains this: {code} <user> <fullName>myname</fullName> <properties> <hudson.tasks.Mailer_-UserProperty> <emailAddress></emailAddress> </hudson.tasks.Mailer_-UserProperty> <null/> <hudson.model.MyViewsProperty> [cut] {code} Please notice the <null/>(!) This is repeatable for every user in our system. Now for the reeeeaally strange part. If I temper the post data from this: {code}{"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty2": {"primaryViewName": ""}}{code} to look like this: {code}{"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty1": {"primaryViewName": ""}}{code} The config is saved correctly and all private views becomes available again. Even more strange: in the future, the user will be able to resave the configuration _without_ tempering with the post data, and everything will work fine - even though future post-data will look exactly like the original post data (userProperty2). It is of course a huge issue for us. Users cannot view their views until I form post tempered config data. We are using LDAP for authentication and view plugins like Favorites Nested views Dashboard Section view Best Regards Gustaf |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 139207 ] | New: JNJira + In-Review [ 188393 ] |
Code changed in jenkins
User: Kohsuke Kawaguchi
Path:
changelog.html
core/src/main/java/hudson/model/User.java
test/src/test/java/hudson/model/UserPropertyTest.java
test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly
test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly
http://jenkins-ci.org/commit/jenkins/29dc1d5fa8e684e27034f717eb820ff53cdb14ea
Log:
[FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins
Compare: https://github.com/jenkinsci/jenkins/compare/36ddba6...29dc1d5