Project

General

Profile

Actions

Bug #2003

closed

Select in PT editor throws exception if item name are not found

Added by François ARMAND over 12 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
2
Assignee:
-
Category:
Web - Config management
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

If a <select> is configured in a PT, and a value not available in its list of item was saved at some point in the PI, then the SelectField editor failed with an exception.

In the following example, the select is defined like that:

<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>

And the exception is:

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 #1

Updated by François ARMAND over 12 years ago

  • Status changed from In progress to Discussion
  • Target version changed from 2.3.2 to 18

Change to 2.4-ideas, as it seems:

  • that <SELECT> are extremely rarely used in PT lib (0 time until now)
  • it happens only when a PT is modified without upgrading its version, that is more likely a development task than an user one.
Actions #2

Updated by François ARMAND over 12 years ago

  • Target version changed from 18 to 24
Actions #3

Updated by Jonathan CLARKE almost 12 years ago

  • Target version changed from 24 to Ideas (not version specific)
Actions #4

Updated by François ARMAND over 11 years ago

  • Status changed from Discussion to 8
  • Assignee deleted (François ARMAND)
Actions #5

Updated by Benoît PECCATTE about 9 years ago

  • Status changed from 8 to New
Actions #6

Updated by Benoît PECCATTE over 7 years ago

  • Status changed from New to Rejected

This is not relevant for users and doesn't seem to happen anymore.

Actions

Also available in: Atom PDF