Project

General

Profile

Actions

Bug #11384

closed

Bug #11326: chars are not escaped correctly in dsc techniques

Broken policy generation with internal error

Added by Alexis Mousset over 7 years ago. Updated over 7 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Fix check:
Regression:

Description

[2017-09-18 09:40:58] INFO  com.normation.rudder.services.policies.nodeconfig.NodeConfigurationServiceImpl - Configuration of following nodes were updated, their promises are going to be written: [7bd7d21a-1842-4ae3-a1cb-f9044cbdf5e6, fd368826-7c71-4261-8fd2-418d3e17e453, root]
[2017-09-18 09:40:58] DEBUG com.normation.rudder.services.policies.PromiseGenerationServiceImpl - Policy generation completed in 912 ms
[2017-09-18 09:40:58] ERROR com.normation.rudder.batch.AsyncDeploymentAgent$DeployerAgent - Error when updating policy, reason Cannot write configuration node <- Unexpected internal error near index 1
\
 ^
[2017-09-18 09:40:58] ERROR com.normation.rudder.batch.AsyncDeploymentAgent - Policy update error for process '7' at 2017-09-18 09:40:58: Cannot write configuration node
java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
 ^
    at java.util.regex.Pattern.error(Pattern.java:1955)
    at java.util.regex.Pattern.compile(Pattern.java:1702)
    at java.util.regex.Pattern.<init>(Pattern.java:1351)
    at java.util.regex.Pattern.compile(Pattern.java:1028)
    at java.lang.String.replaceAll(String.java:2223)
    at com.normation.rudder.services.policies.write.ParameterEntry$.escapeString(Cf3PolicyDraft.scala:263)
    at com.normation.rudder.services.policies.write.CfengineBundleVariables$.$anonfun$formatMethodsUsebundle$1(BuildBundleSequence.scala:449)
    at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
    at scala.collection.immutable.List.foreach(List.scala:389)
    at scala.collection.TraversableLike.map(TraversableLike.scala:234)
    at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
    at scala.collection.immutable.List.map(List.scala:295)
    at com.normation.rudder.services.policies.write.CfengineBundleVariables$.formatMethodsUsebundle(BuildBundleSequence.scala:449)
    at com.normation.rudder.services.policies.write.CfengineBundleVariables$.getBundleVariables(BuildBundleSequence.scala:375)
    at com.normation.rudder.services.policies.write.CFEngineAgentSpecificGeneration$.getBundleVariables(AgentSpecificLogic.scala:154)
    at com.normation.rudder.services.policies.write.WriteAllAgentSpecificFiles.getBundleVariables(AgentSpecificLogic.scala:131)
    at com.normation.rudder.services.policies.write.BuildBundleSequence.$anonfun$prepareBundleVars$9(BuildBundleSequence.scala:210)
    at net.liftweb.common.Full.flatMap(Box.scala:808)
    at com.normation.rudder.services.policies.write.BuildBundleSequence.prepareBundleVars(BuildBundleSequence.scala:207)
    at com.normation.rudder.services.policies.write.PrepareTemplateVariablesImpl.prepareBundleVars(PrepareTemplateVariables.scala:281)
    at com.normation.rudder.services.policies.write.PrepareTemplateVariablesImpl.prepareTemplateForAgentNodeConfiguration(PrepareTemplateVariables.scala:130)
    at com.normation.rudder.services.policies.write.Cf3PromisesFileWriterServiceImpl.$anonfun$writeTemplate$13(PolicyWriterService.scala:276)
    at com.normation.rudder.services.policies.write.Cf3PromisesFileWriterServiceImpl.$anonfun$parrallelSequence$2(PolicyWriterService.scala:178)
    at scala.util.Try$.apply(Try.scala:209)
    at monix.eval.Task.$anonfun$materialize$1(Task.scala:462)
    at monix.eval.Task$.monix$eval$Task$$loop$1(Task.scala:1704)
    at monix.eval.Task$.internalStartTrampolineRunLoop(Task.scala:1733)
    at monix.eval.Task$.$anonfun$internalRestartTrampolineAsync$1(Task.scala:1561)
    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)

Related issues 1 (0 open1 closed)

Has duplicate Rudder - Bug #11386: Invalid patternRejectedVincent MEMBRÉActions
Actions #1

Updated by Vincent MEMBRÉ over 7 years ago

Actions #2

Updated by Vincent MEMBRÉ over 7 years ago

  • Has duplicate deleted (Bug #11386: Invalid pattern)
Actions #3

Updated by Vincent MEMBRÉ over 7 years ago

  • Parent task set to #11326

Stupid java is stupid

replaceAll("\\","\\\\")

is invalid because first backslash is replace, then put in a regexp ...

You need to do "\\\\" to escape a backslash ... or do triple quote string ...

Actions #4

Updated by Vincent MEMBRÉ over 7 years ago

Actions #5

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from New to In progress
Actions #6

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder/pull/1738
Actions #7

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 4.2.0 to 4.2.0~rc2
Actions #8

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from Pending technical review to Pending release
Actions #9

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.2.0~rc1 which was released today.

Actions

Also available in: Atom PDF