Project

General

Profile

Actions

Bug #9841

closed

Error parsing inventory

Added by Janos Mattyasovszky about 8 years ago. Updated almost 8 years ago.

Status:
Released
Priority:
N/A
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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 1 (0 open1 closed)

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 serverReleasedBenoît PECCATTE2016-03-08Actions
Actions #1

Updated by Nicolas CHARLES about 8 years 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
Actions #2

Updated by Nicolas CHARLES about 8 years 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 ?

Actions #3

Updated by Nicolas CHARLES about 8 years 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 ?

Actions #4

Updated by Nicolas CHARLES about 8 years 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

Actions #5

Updated by Nicolas CHARLES about 8 years 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

Actions #6

Updated by Janos Mattyasovszky about 8 years 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" 
Actions #7

Updated by Janos Mattyasovszky about 8 years 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 :-} )

Actions #8

Updated by Nicolas CHARLES about 8 years ago

  • Category set to System techniques
  • Target version set to 3.1.18
Actions #9

Updated by Nicolas CHARLES about 8 years ago

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

Updated by Nicolas CHARLES about 8 years 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
Actions #11

Updated by Nicolas CHARLES almost 8 years ago

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

Updated by Vincent MEMBRÉ almost 8 years 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.

Actions

Also available in: Atom PDF