Project

General

Profile

Bug #9829

Agent inventory generation invalid if hostname is not defined

Added by Romuald Bouvard 9 months ago. Updated 4 months ago.

Status:
Released
Priority:
3
Category:
Initial promises & sys tech
Target version:
Target version (plugin):
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Getting started - demo | first install | level 1 Techniques
Effort required:
Priority:
51

Description

Dear support,

I'm testing the version of RUDDER 4.0 and the AGENT 4.0.2

I've an issue when i'm generating a reporting by :

rudder agent inventory

Start execution with config [0]

M| State Technique Component Key Message
E| error Inventory inventory Generated inventory has been detected as invalid

  1. Summary #####################################################################
    1 components verified in 2 directives
    => 1 components in Enforce mode
    -> 1 error
    execution time: 10.33s

Can you please help me with this ?

thanks
Romuald

Associated revisions

Revision 188a91ad
Added by Benoît PECCATTE 5 months ago

Fixes #9829: Agent inventory generation invalid if hostname is not defined

History

#1 Updated by Nicolas CHARLES 9 months ago

  • Category set to Initial promises & sys tech
  • Target version set to 4.0.3

Hello Romuald,

Thank you for your ticket.
To troubleshoot this issue, could you please tell us:
  • which operating system are you using
  • send us the verbose output of the agent (caution, it may contain sensitive information like IP address/hostname of the node and Rudder server, so you may need to sanitize it) obtained with command "rudder agent inventory -v"

Thank you !

#2 Updated by Romuald Bouvard 8 months ago

Hello Nicolas,

sorry for my late answer. I solved the issue by edited the /etc/hosts file then replace the localhost by the hostname of my device --

thanks
Romuald

#3 Updated by Nicolas CHARLES 8 months ago

  • Subject changed from Agent inventory to Agent inventory generation invalid if hostname is not defined
  • Assignee set to Benoît PECCATTE

Thank you for this ticket Romuald,

Benoit, do you know why the inventory would be deemed invalid ?

#4 Updated by Vincent MEMBRÉ 7 months ago

  • Target version changed from 4.0.3 to 4.0.4

#5 Updated by Benoît PECCATTE 7 months ago

  • Found in version (s) 4.0.2 added

#6 Updated by Benoît PECCATTE 7 months ago

  • Found in version(s) old deleted (4.0.2)

#7 Updated by Benoît PECCATTE 6 months ago

  • Severity set to Minor - inconvenience | misleading | easy workaround
  • User visibility set to Operational - other Techniques | Technique editor | Rudder settings
  • Priority set to 16

#8 Updated by Vincent MEMBRÉ 5 months ago

  • Target version changed from 4.0.4 to 4.0.5

#9 Updated by Jonathan CLARKE 5 months ago

  • Assignee deleted (Benoît PECCATTE)

#10 Updated by Jonathan CLARKE 5 months ago

  • Severity changed from Minor - inconvenience | misleading | easy workaround to Major - prevents use of part of Rudder | no simple workaround
  • User visibility changed from Operational - other Techniques | Technique editor | Rudder settings to Getting started - demo | first install | level 1 Techniques
  • Priority changed from 16 to 51

Nicolas CHARLES wrote:

Thank you for this ticket Romuald,

Benoit, do you know why the inventory would be deemed invalid ?

As the ticket subject says, because the hostname is invalid. The code that checks this is here: https://github.com/Normation/rudder-techniques/blob/master/techniques/system/inventory/1.0/test-inventory.pl.st#L35

There are two problems here really:

  1. The fact that we need a real hostname to go forward - probably not an easy constraint to work around
  2. The fact that the error message is not actionable, and a new user would have no idea how to fix this - this is probably what we should focus on

Requalifying the priority of this.

#11 Updated by Benoît PECCATTE 5 months ago

We check many things for validity, the precise message is however lost by cfengine.
The error message you get when an inventory is invalid is

  • WARNING Generated inventory is not valid, as it is missing mandatory fields. *
  • Not sending it to the Rudder Server *
  • You can check the invalid inventory in ${g.rudder_var_tmp}/inventory/ *

We should add more information.

In the case when the hostname is not properly set however we cannot do better than telling the user to change it or put it in the hosts file.

#12 Updated by Benoît PECCATTE 5 months ago

  • Status changed from New to In progress
  • Assignee set to Benoît PECCATTE

#13 Updated by Benoît PECCATTE 5 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Benoît PECCATTE to Alexis MOUSSET
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1138

#14 Updated by Benoît PECCATTE 5 months ago

  • Status changed from Pending technical review to Pending release

#15 Updated by Vincent MEMBRÉ 4 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.0.5 and 4.1.2 which were released today.

Also available in: Atom PDF