Project

General

Profile

Bug #9841

Error parsing inventory

Added by Janos Mattyasovszky 12 months ago. Updated 10 months ago.

Status:
Released
Priority:
N/A
Category:
Initial promises & sys tech
Target version:
Target version (plugin):
Severity:
User visibility:
Effort required:
Priority:

Description

Any idea what this could be caused by?

[2016-12-22 08:40:36] INFO  com.normation.inventory.provisioning.endpoint.FusionReportEndpoint - New input inventory: 'badhost-xxxxxx-4ed5-11e5-a7c9-yyyyyyy.ocs'
[2016-12-22 08:40:36] ERROR com.normation.inventory.provisioning.endpoint.FusionReportEndpoint - Error when trying to parse inventory <- Can't parse the input
 inventory, aborting <- Error when post processing report with 'post_process_inventory:check_consistency', abort <- Missing rudder policy server attribute 'PO
LICY_SERVER' in report. This attribute is mandatory and must contains node local administrator login. <- Missing XML element: 'POLICY_SERVER'.

What it contains that is similar to this is:

    <RUDDER>
      <AGENT>
        <AGENT_NAME>cfengine-community</AGENT_NAME>
        <CFENGINE_KEY>-----BEGIN RSA PUBLIC KEY-----
MIIBCAKCAQEAxe/CgVpJpOwg9mqmyGzitOSTJgMFcwDUODt2a9ye6mqcQnfa/gK+
w+lCz5tuffNcG1Ip/YhB+GzqrtMPent6VYysjcAIwX3RO7zRyYbOqiCiBP+EWXcX
qIbZG29i0RHUwZgGvZcj5Mg/Gjc10j/RpYugGnCcO61a2Hq1LQd/tGid60G8i9eb
8ACqwb1h4HODeblYoXdJ5weUjCjmfpmGQ++0SsboYvnnpvCL/vXm0jn2xXTbF9ub
QUlura0bNV0u1IMWaTyTYjP9O+VrwCFrKi2Hdbt5eXNg6xKne0U/jHXrbNL5Hqih
WcleVRwFIBxHGssAths5oZjiJQA9WepN7QIBIw==
-----END RSA PUBLIC KEY-----
        </CFENGINE_KEY>
        <OWNER>root</OWNER>
        <POLICY_SERVER_HOSTNAME>policy-server-of-badnode.fqdn</POLICY_SERVER_HOSTNAME>
        <POLICY_SERVER_UUID /></AGENT>
      <HOSTNAME>badserver.fqdn</HOSTNAME>
      <UUID>xxxxxx-4ed5-11e5-a7c9-yyyyyyy</UUID>
    </RUDDER>

Agent on node is 2.11.11.release-1.SLES.11
Root server is rudder-webapp-3.1.11.release-1.SLES.11


Related issues

Related to Rudder - Bug #8045: Using Rudder server 3.x + rudder agent 2.11.x, a node doesn't properly detect its change of relay server Released 2016-03-08

Associated revisions

Revision c8b6e916
Added by Nicolas CHARLES 12 months ago

Fixes #9841: Error parsing inventory

History

#1 Updated by Nicolas CHARLES 12 months ago

  • Related to Bug #8045: Using Rudder server 3.x + rudder agent 2.11.x, a node doesn't properly detect its change of relay server added

#2 Updated by Nicolas CHARLES 12 months ago

Hi Janos,

Thank you for this ticket
Tag POLICY_SERVER_UUID is empty. In 2.11, it is read from /var/rudder/tmp/uuid.txt
However, message is about tag POLICY_SERVER, added by promises in add_information_to_inventory, only if class uuiddefined is defined, so only if command /usr/sbin/dmidecode -s system-uuid could be run
Do you have dmidecode on the system ?

#3 Updated by Nicolas CHARLES 12 months ago

Also, do you have a non empty file in /var/rudder/cfengine-community/rudder-server-uuid.txt ?
Do you have the TAG POLICY_SERVER in the inventory file ?

#4 Updated by Nicolas CHARLES 12 months ago

As seen on IRC: this is a xen DomU system, so the UUID is computed differently.
Could you check that the following command returns something
/bin/xenstore-read vm

inventory checks that it returns something like /vm/(.*), and extract the uuid based on what is captured. If something is captured, it will add the data in the inventory, otherwith, tag POLICY_SERVER won't be created

#5 Updated by Nicolas CHARLES 12 months ago

As discussed on IRC, error is:

09:46:02 < matya> ** was marked for editing but could not be opened
09:46:10 < matya> File '...' is bigger than the limit edit.max_file_size = 2159680 > 1024000 bytes

so rudder data could not be added by the agent

#6 Updated by Janos Mattyasovszky 12 months ago

Ok as we have just found out, it's because we have so many processes running on the system, the inventory exceeds the allowed max_file_size in the edit promise:

2016-12-22T09:45:35+0100     info: /default/doInventory/methods/'any'/default/addInformationsToInventory/files/'/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs'[0]: File '/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs' is bigger than the limit edit.max_file_size = 2159680 > 1024000 bytes
2016-12-22T09:45:35+0100    error: /default/doInventory/methods/'any'/default/addInformationsToInventory/files/'/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs'[0]: File '/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs' was marked for editing but could not be opened
2016-12-22T09:45:35+0100     info: /default/doInventory/methods/'any'/default/addInformationsToInventory/files/'/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs'[0]: File '/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs' is bigger than the limit edit.max_file_size = 2159680 > 1024000 bytes
2016-12-22T09:45:35+0100    error: /default/doInventory/methods/'any'/default/addInformationsToInventory/files/'/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs'[0]: File '/var/rudder/tmp/inventory/badserver-150a61ba-4ed5-11e5-a7c9-xxxxxxxx.ocs' was marked for editing but could not be opened
2016-12-22T09:45:35+0100    error: /default/doInventory/methods/'any'[0]: Method 'addInformationsToInventory' failed in some repairs

I have applied a local patch to the fusionAgent.cf, and now it works like a charm:

# diff -u fusionAgent.cf.orig fusionAgent.cf
--- fusionAgent.cf.orig 2016-12-22 09:54:31.000000000 +0100
+++ fusionAgent.cf 2016-12-22 09:54:52.000000000 +0100
@@ -429,18 +429,18 @@
       "${fusionAgent.inventory_path_edition}" 
         edit_line => add_information_to_inventory(${RUDDERUUID}, ${CFKEY}, ${USER}, ${polserv_uuid}),
         comment => "Adding basic informations to Rudder Inventory",
-        edit_defaults => def_no_backup;
+        edit_defaults => def_no_backup_size("10M");

       "${fusionAgent.inventory_path_edition}" 
         edit_line => add_users_information_to_inventory(@{addInformationsToInventory.users}),
         comment => "Adding user informations to Rudder Inventory",
-        edit_defaults => def_no_backup;
+        edit_defaults => def_no_backup_size("10M");

     uuiddefined.rudder_server_roles_dir_exists::
       "${fusionAgent.inventory_path_edition}" 
         edit_line  => add_server_roles_information_to_inventory("@{addInformationsToInventory.rudder_roles}"),
         comment => "Adding server roles informations to Rudder Inventory",
-        edit_defaults => def_no_backup;
+        edit_defaults => def_no_backup_size("10M");

     android::
       "${g.rudder_var_tmp}/inventory/.*.ocs" 

#7 Updated by Janos Mattyasovszky 12 months ago

I have just checked, the biggest inventory (which I've found in the inventories/failed dir) is about ~6MB big. I'd recommend using 25MB as size.
As you've mentioned, we are on the edge of 2017, so opening 25MB for editing should be reasonably safe (I mean, it's probably a much safer decision than all distros going to systemd :-} )

#8 Updated by Nicolas CHARLES 12 months ago

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

#9 Updated by Nicolas CHARLES 12 months ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES

#10 Updated by Nicolas CHARLES 12 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Alexis MOUSSET
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1095

#11 Updated by Nicolas CHARLES 12 months ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

#12 Updated by Vincent MEMBRÉ 10 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.18, 3.2.11, 4.0.3 and 4.1.0~beta3 which were released today.

Also available in: Atom PDF