Actions
Bug #9610
closedNull pointer exception when changing policy mode on the Directive screen
Status:
Released
Priority:
1 (highest)
Assignee:
Category:
Web - Compliance & node report
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
Global policy mode is "enforce, not overridable"
On a directive screen, if I change a directive from "Use global mode" to "Audit", then save, then change back to "Use global mode", I get the following stacktrace
[2016-11-03 08:16:52] ERROR net.liftweb.http.LiftRules - Exception being returned to browser when processing /ajax_request/F521541584802IIAGHP-b0/ java.lang.NullPointerException: null at com.normation.rudder.domain.policies.PolicyMode$$anonfun$1.apply(PolicyMode.scala:51) at com.normation.rudder.domain.policies.PolicyMode$$anonfun$1.apply(PolicyMode.scala:51) at scala.collection.immutable.Set$Set2.find(Set.scala:137) at com.normation.rudder.domain.policies.PolicyMode$.parse(PolicyMode.scala:51) at com.normation.rudder.domain.policies.PolicyMode$.parseDefault(PolicyMode.scala:63) at com.normation.rudder.repository.ldap.LDAPDiffMapper$$anonfun$modChangeRecords2DirectiveSaveDiff$2$$anonfun$apply$12.apply(LDAPDiffMapper.scala:237) at com.normation.rudder.repository.ldap.LDAPDiffMapper$$anonfun$modChangeRecords2DirectiveSaveDiff$2$$anonfun$apply$12.apply(LDAPDiffMapper.scala:213) at com.normation.utils.Control$$anonfun$pipeline$1.apply(Control.scala:146) at com.normation.utils.Control$$anonfun$pipeline$1.apply(Control.scala:143) at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57) at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66) at scala.collection.mutable.WrappedArray.foldLeft(WrappedArray.scala:35) at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:151) at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:104) at com.normation.utils.Control$.pipeline(Control.scala:143) at com.normation.rudder.repository.ldap.LDAPDiffMapper$$anonfun$modChangeRecords2DirectiveSaveDiff$2.apply(LDAPDiffMapper.scala:213) at com.normation.rudder.repository.ldap.LDAPDiffMapper$$anonfun$modChangeRecords2DirectiveSaveDiff$2.apply(LDAPDiffMapper.scala:212) at net.liftweb.common.Full.flatMap(Box.scala:612) at com.normation.rudder.repository.ldap.LDAPDiffMapper.modChangeRecords2DirectiveSaveDiff(LDAPDiffMapper.scala:212) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88$$anonfun$apply$90$$anonfun$apply$94$$anonfun$apply$96.apply(LDAPDirectiveRepository.scala:608) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88$$anonfun$apply$90$$anonfun$apply$94$$anonfun$apply$96.apply(LDAPDirectiveRepository.scala:607) at net.liftweb.common.Full.flatMap(Box.scala:612) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88$$anonfun$apply$90$$anonfun$apply$94.apply(LDAPDirectiveRepository.scala:607) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88$$anonfun$apply$90$$anonfun$apply$94.apply(LDAPDirectiveRepository.scala:605) at net.liftweb.common.Full.flatMap(Box.scala:612) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88$$anonfun$apply$90.apply(LDAPDirectiveRepository.scala:605) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88$$anonfun$apply$90.apply(LDAPDirectiveRepository.scala:603) at net.liftweb.common.Full.flatMap(Box.scala:612) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88.apply(LDAPDirectiveRepository.scala:603) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86$$anonfun$apply$88.apply(LDAPDirectiveRepository.scala:598) at net.liftweb.common.Full.flatMap(Box.scala:612) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86.apply(LDAPDirectiveRepository.scala:598) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83$$anonfun$apply$86.apply(LDAPDirectiveRepository.scala:568) at net.liftweb.common.Full.flatMap(Box.scala:612) at com.normation.rudder.repository.ldap.WoLDAPDirectiveRepository$$anonfun$internalSaveDirective$1$$anonfun$apply$83.apply(LDAPDirectiveRepository.scala:568)
Actions