Project

General

Profile

Actions

Bug #1986

closed

Variable in subsection of a multi-valued section are not saved

Added by François ARMAND about 13 years ago. Updated about 13 years ago.

Status:
Released
Priority:
1 (highest)
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

When a PI has a multivalued section which contains sub-section, nothing works correctly for these subsections:

  • if we [add another] iteration of the multivalued section, subsection are not correctly initialized: variable values are copied from the first iteration in place of being initialized with their default values ;
  • when the PI is saved, no variable value are saved (so the number of iteration is not kept, and the variable get back there default values).
Actions #1

Updated by François ARMAND about 13 years ago

  • Subject changed from Variable in subsection of mulvalued section are not saved to Variable in subsection of a multi-valued section are not saved
Actions #2

Updated by François ARMAND about 13 years ago

In fact, variable values seem to be saved if there is only one iteration of the multivalued section, what is even stranger.

Actions #3

Updated by François ARMAND about 13 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 0 to 100
Actions #4

Updated by François ARMAND about 13 years ago

  • Status changed from Pending technical review to In progress

Still buggy: some user get that stacktrace when migrating PT:

12:13:17.008 [qtp132616134-69] ERROR net.liftweb.http.LiftRules -
Exception being returned to browser when processing
Req(List(F1156879332915ROANI4), Map(F1156879332915ROANI4 -> List(true)),
ParsePath(List(ajax_request, F11568793328985U0P
TE, index),,true,true), /rudder, PostRequest,
Full(application/x-www-form-urlencoded; charset=UTF-8))
java.lang.UnsupportedOperationException: empty.head
        at scala.collection.immutable.Vector.head(Vector.scala:171) ~[scala-library-2.9.0-1.jar:na]
        at com.normation.rudder.web.services.Section2FieldService.createSectionField(Section2FieldService.scala:126)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService$$anonfun$5.apply(Section2FieldService.scala:164)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService$$anonfun$5.apply(Section2FieldService.scala:161)~[classes/:na]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.immutable.List.foreach(List.scala:45)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.immutable.List.map(List.scala:45)~[scala-library-2.9.0-1.jar:na]
        at com.normation.rudder.web.services.Section2FieldService.com$normation$rudder$web$services$Section2FieldService$$createSingleSectionField(Section2FieldService.scala:161)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService.createSectionField(Section2FieldService.scala:126)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService$$anonfun$5.apply(Section2FieldService.scala:164)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService$$anonfun$5.apply(Section2FieldService.scala:161)~[classes/:na]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.immutable.List.foreach(List.scala:45)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)~[scala-library-2.9.0-1.jar:na]
        at scala.collection.immutable.List.map(List.scala:45)~[scala-library-2.9.0-1.jar:na]
        at com.normation.rudder.web.services.Section2FieldService.com$normation$rudder$web$services$Section2FieldService$$createSingleSectionField(Section2FieldService.scala:161)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService.createSectionField(Section2FieldService.scala:126)~[classes/:na]
        at com.normation.rudder.web.services.Section2FieldService.initPolicyEditor(Section2FieldService.scala:81)~[classes/:na]
        at com.normation.rudder.web.services.PolicyEditorServiceImpl$$anonfun$get$2.apply(PolicyEditorService.scala:99)~[classes/:na]
        at com.normation.rudder.web.services.PolicyEditorServiceImpl$$anonfun$get$2.apply(PolicyEditorService.scala:96)~[classes/:na]
        at net.liftweb.common.Full.flatMap(Box.scala:493)~[lift-common_2.9.0-1-2.4-M3.1.jar:2.4-M3.1]
        at com.normation.rudder.web.services.PolicyEditorServiceImpl.get(PolicyEditorService.scala:96)~[classes/:na]
        at com.normation.rudder.web.components.PolicyInstanceEditForm.<init>(PolicyInstanceEditForm.scala:126)~[classes/:na]
        at com.normation.rudder.web.snippet.PolicyInstanceManagement.com$normation$rudder$web$snippet$PolicyInstanceManagement$$updatePolicyInstanceSettingFormComponent(PolicyInstancManagement.scala:341)~[classes/:na]
        at com.normation.rudder.web.snippet.PolicyInstanceManagement.com$normation$rudder$web$snippet$PolicyInstanceManagement$$displayPolicyInstanceDetails(PolicyInstanceManagement.scala:328)~[classes/:na]
        at com.normation.rudder.web.snippet.PolicyInstanceManagement$$anon$2.com$normation$rudder$web$snippet$PolicyInstanceManagement$$anon$$onClickNode(PolicyInstanceManagement.scala:394)~[classes/:na]
Actions #5

Updated by François ARMAND about 13 years ago

  • Status changed from In progress to Pending technical review
Actions #6

Updated by Nicolas PERRON about 13 years ago

  • Status changed from Pending technical review to In progress
  • % Done changed from 100 to 80

A PI use an attribute which has been renamed (setPerms => setPerm)

java.util.NoSuchElementException: key not found: setPerms
    at scala.collection.MapLike$class.default(MapLike.scala:224) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.immutable.Map$Map1.default(Map.scala:106) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.MapLike$class.apply(MapLike.scala:135) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.immutable.Map$Map1.apply(Map.scala:106) ~[scala-library-2.9.0-1.jar:na]
    at com.normation.rudder.web.model.SelectField$$anonfun$3.apply(PolicyFieldEditors.scala:145) ~[classes/:na]
    at com.normation.rudder.web.model.SelectField$$anonfun$3.apply(PolicyFieldEditors.scala:145) ~[classes/:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:33) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.mutable.WrappedArray.map(WrappedArray.scala:33) ~[scala-library-2.9.0-1.jar:na]
    at com.normation.rudder.web.model.SelectField.toForm(PolicyFieldEditors.scala:145) ~[classes/:na]
    at com.normation.rudder.web.model.SelectField.toForm(PolicyFieldEditors.scala:132) ~[classes/:na]
    at com.normation.rudder.web.model.PolicyField$class.toFormNodeSeq(PolicyEditor.scala:143) ~[classes/:na]
    at com.normation.rudder.web.model.SelectField.toFormNodeSeq(PolicyFieldEditors.scala:132) ~[classes/:na]
    at com.normation.rudder.web.model.SectionFieldImp$$anonfun$2.apply(PolicyEditor.scala:215) ~[classes/:na]
    at com.normation.rudder.web.model.SectionFieldImp$$anonfun$2.apply(PolicyEditor.scala:215) ~[classes/:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.immutable.List.map(List.scala:45) ~[scala-library-2.9.0-1.jar:na]
    at com.normation.rudder.web.model.SectionFieldImp.toFormNodeSeq(PolicyEditor.scala:215) ~[classes/:na]
    at com.normation.rudder.web.model.MultivaluedSectionField$$anonfun$com$normation$rudder$web$model$MultivaluedSectionField$$showFormEntry$1.apply(PolicyEditor.scala:360) ~[classes/:na]
    at com.normation.rudder.web.model.MultivaluedSectionField$$anonfun$com$normation$rudder$web$model$MultivaluedSectionField$$showFormEntry$1.apply(PolicyEditor.scala:360) ~[classes/:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library-2.9.0-1.jar:na]
    at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library-2.9.0-1.jar:na]

Actions #7

Updated by Nicolas PERRON about 13 years ago

It comes from a modification of policy.xml applied after that a PI has been created with the previous version of policy.xml

<SELECT>
  <NAME>USERDIRPERM_USER_SETPERM</NAME>
  <DESCRIPTION>Set automatically permissions on this user directory</DESCRIPTION>
  <ITEM>
    <VALUE>setPerm</VALUE>
    LABEL>Set permissions on user directory</LABEL>
  </ITEM>
</SELECT>

Actions #8

Updated by François ARMAND about 13 years ago

Nicolas PERRON wrote:

It comes from a modification of policy.xml applied after that a PI has been created with the previous version of policy.xml
[...]

Ok, it seems to be a full new bug deserving its own ticket.

Actions #9

Updated by François ARMAND about 13 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 80 to 100

Close this one, the bug for the exception: no such key is managed in #2003

Actions #10

Updated by Jonathan CLARKE about 13 years ago

  • Status changed from Pending technical review to Released
Actions

Also available in: Atom PDF