Project

General

Profile

Actions

Bug #19632

closed

Incorrect pattern matching leads to error in inventory parsing

Added by François ARMAND over 3 years ago. Updated about 3 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Nodes & inventories
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

An unchecked error was produced.
scala.MatchError: Some(localhost) (of class scala.Some)
at com.normation.inventory.provisioning.fusion.FusionReportUnmarshaller.getHostname(FusionReportUnmarshaller.scala:267)
at com.normation.inventory.provisioning.fusion.FusionReportUnmarshaller.fromXmlDoc(FusionReportUnmarshaller.scala:113)
at com.normation.inventory.services.provisioning.PipelinedReportUnmarshaller.$anonfun$fromXmlDoc$3(ReportUnmarshaller.scala:122)
at zio.internal.FiberContext.evaluateNow(FiberContext.scala:916)
at zio.internal.FiberContext.$anonfun$evaluateLater$1(FiberContext.scala:778)
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)
Fiber:Id(1627651696616,191) was supposed to continue to:
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryInternal(InventoryProcessor.scala:237)
a future continuation at zio.ZIO.run(ZIO.scala:1640)
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryInternal(InventoryProcessor.scala:231)
a future continuation at com.normation.errors$IOChainError$.chainError(ZioCommons.scala:202)
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryInternal(InventoryProcessor.scala:251)
a future continuation at zio.ZIO.run(ZIO.scala:1640)
a future continuation at zio.Semaphore.withPermits(Semaphore.scala:61)
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryInternal(InventoryProcessor.scala:253)
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryInternal(InventoryProcessor.scala:283)
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryInternal(InventoryProcessor.scala:299)
a future continuation at com.normation.rudder.inventory.InventoryProcessor.saveInventoryBlocking(InventoryProcessor.scala:193)
a future continuation at zio.ZIO$.zio$ZIO$$_succeedRight(ZIO.scala:4121)
a future continuation at com.normation.rudder.inventory.ProcessFile.sendToProcessorBlocking(InventoryFileWatcher.scala:484)
a future continuation at com.normation.rudder.inventory.ProcessFile.sendToProcessorBlocking(InventoryFileWatcher.scala:499)
a future continuation at com.normation.rudder.inventory.ProcessFile.saveInventoryBufferProcessing(InventoryFileWatcher.scala:409)
a future continuation at zio.ZIO.forever(ZIO.scala:686)
a future continuation at zio.ZIO.forever(ZIO.scala:686)
Fiber:Id(1627651696616,191) execution trace:
at com.normation.inventory.services.provisioning.PipelinedReportUnmarshaller.fromXmlDoc(ReportUnmarshaller.scala:122)
at com.normation.errors$IOChainError$.chainError(ZioCommons.scala:202)
at com.normation.inventory.provisioning.fusion.PreUnmarshallCheckConsistency.checkSecurityToken(PreUnmarshallCheckConsistency.scala:256)
at com.normation.errors$IOChainError$.chainError(ZioCommons.scala:202)
at com.normation.inventory.provisioning.fusion.PreUnmarshallCheckConsistency.checkSecurityToken(PreUnmarshallCheckConsistency.scala:252)
at zio.syntax$ToZio.succeed(syntax.scala:9)
at zio.ZIO$.foldLeft(ZIO.scala:2787)
at com.normation.inventory.provisioning.fusion.PreUnmarshallCheckConsistency.checkAgentType(PreUnmarshallCheckConsistency.scala:245)
at com.normation.inventory.provisioning.fusion.PreUnmarshallCheckConsistency.checkAgentType(PreUnmarshallCheckConsistency.scala:241)
at zio.syntax$ToZio.succeed(syntax.scala:9)
at zio.ZIO$.foldLeft(ZIO.scala:2787)
at com.normation.inventory.provisioning.fusion.PreUnmarshallCheckConsistency.checkKernelVersion(PreUnmarshallCheckConsistency.scala:207)
at com.normation.inventory.provisioning.fusion.PreUnmarshallCheckConsistency.checkKernelVersion(PreUnmarshallCheckConsistency.scala:205)
at zio.syntax$ToZio.succeed(syntax.scala:9)
at zio.ZIO$.foldLeft(ZIO.scala:2787)
at zio.syntax$ToZio.succeed(syntax.scala:9)
at com.normation.inventory

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #19755: Inventories are not processed by Rudder 6.2RejectedActions
Actions #1

Updated by François ARMAND over 3 years ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
Actions #2

Updated by François ARMAND over 3 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Elaad FURREEDAN
  • Pull Request set to https://github.com/Normation/rudder/pull/3754
Actions #3

Updated by François ARMAND over 3 years ago

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

Updated by Nicolas CHARLES over 3 years ago

  • Related to Bug #19755: Inventories are not processed by Rudder 6.2 added
Actions #5

Updated by François ARMAND about 3 years ago

  • Fix check changed from To do to Checked

Now it correctly refuse an inventory with hostname for hostname:

[2021-09-02 22:30:29+0200] INFO  inventory-processing - Watch new inventory file 'agent1-0070e491-d451-49c3-a5cc-cc48409e3080.ocs' with signature available: process.
[2021-09-02 22:30:29+0200] ERROR inventory-processing - Error when trying to process inventory 'agent1-0070e491-d451-49c3-a5cc-cc48409e3080.ocs'; cause was: Can't parse the input inventory, aborting; cause was: Can not parse the given report, abort; cause was: Inconsistency: Hostname could not be found in inventory (RUDDER/HOSTNAME [localhost] and OPERATINGSYSTEM/FQDN [localhost] are missing or invalid: hostname can't be one of 'localhost','127.0.0.1','::1'
Actions #6

Updated by Vincent MEMBRÉ about 3 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 6.1.16 and 6.2.10 which were released today.

Actions

Also available in: Atom PDF