Project

General

Profile

Actions

Bug #14264

closed

uuid.hive is not present afet an install or an upgradie ofrudder agent to latest 4.1.x, 4.3.x and 5.0.x on rpm system purges the uuid.hive

Added by Nicolas CHARLES almost 6 years ago. Updated over 5 years ago.

Status:
Rejected
Priority:
N/A
Category:
Documentation
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
Getting started - demo | first install | Technique editor and level 1 Techniques
Effort required:
Priority:
92
Name check:
Fix check:
Regression:

Description

I had a sles12 with an old agent (4.0)
I upgraded to latest version, and after that, the inventory failed because there were no /opt/rudder/etc/uuid.hive

no error at upgrade

Chargement des données du dépôt...
Lecture des paquets installés...
Résolution des dépendances des paquets...

The following package is going to be upgraded:
  rudder-agent

The following package is not supported by its vendor:
  rudder-agent

1 package to upgrade.
Taille de téléchargement totale : 6,1 MiB. Déjà en cache : 0 B. Après
l'opération, 100,0 MiB d'espace disque sera libéré.
Continuer ? [o/n/? affiche toutes les options] (o): o
Récupération de package rudder-agent-1398866025:5.0.5.release-1.SLES.12.x86_64
                                        (1/1),   6,1 MiB (  6,1 MiB décompressé)
Récupération : rudder-agent-5.0.5.release-1.SLES.12.x86_64.rpm ...........[fait]
Vérification des conflits de fichiers : ..................................[fait]
(1/1) Installation : rudder-agent - 1398866025:5.0.5.release-1.SLES.12 ...[fait]
Sortie rpm supplémentaire:
warning: /etc/cron.d/rudder-agent saved as /etc/cron.d/rudder-agent.rpmsave

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.

rudder                    0:off  1:off  2:off  3:off  4:off  5:off  6:off
ok: Rudder agent is now disabled.
ok: stop service rudder-agent succeeded
INFO: Ensuring correct permissions on the keys directory... Done.
ok: Rudder agent has been enabled but not started, wait for next cron run.
ok: start service rudder-agent succeeded
INFO: Scheduling an inventory during next run...
INFO: A back up copy of the /opt/rudder/etc/uuid.hive has been created in /var/backups/rudder
INFO: A back up copy of the /var/rudder/cfengine-community/policy_server.dat has been created in /var/backups/rudder
INFO: A back up copy of the /var/rudder/cfengine-community/ppkeys has been created in /var/backups/rudder

sles-12-64:~ # rudder agent inventory
Rudder agent 5.0.5.release
Node uuid: Not yet configured
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
Start execution with config [20190114-154026-799972db]

   error: Finished command related to promiser '/var/rudder/inventories' -- an error occurred, returned 26
   error: Transformer '/var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.sign' => '/opt/rudder/bin/curl -L -k -1 -f -s --proxy '' --user rudder:rudder -T /var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.sign https://orchestrateur-3.labo.normation.com/inventory-updates/' returned error
   error: Finished command related to promiser '/var/rudder/inventories' -- an error occurred, returned 26
   error: Transformer '/var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.gz' => '/opt/rudder/bin/curl -L -k -1 -f -s --proxy '' --user rudder:rudder -T /var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.gz https://orchestrateur-3.labo.normation.com/inventory-updates/' returned error
M| State         Technique                 Component                 Key                Message
E| error         Inventory                 inventory                                    Could not send the inventory
   error: Method 'sendInventory' failed in some repairs
   error: Method 'doInventory_always' failed in some repairs

rudder agent check restored the uuid, but it still prevented the inventory from being set

Rudder agent 5.0.5.release
Node uuid: b8dcd41d-be6f-40e5-9b4f-f494fdeda113
Start execution with config [20190114-154026-799972db]

   error: Finished command related to promiser '/var/rudder/inventories' -- an error occurred, returned 26
   error: Transformer '/var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.sign' => '/opt/rudder/bin/curl -L -k -1 -f -s --proxy '' --user rudder:rudder -T /var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.sign https://orchestrateur-3.labo.normation.com/inventory-updates/' returned error
   error: Finished command related to promiser '/var/rudder/inventories' -- an error occurred, returned 26
   error: Transformer '/var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.gz' => '/opt/rudder/bin/curl -L -k -1 -f -s --proxy '' --user rudder:rudder -T /var/rudder/inventories/sles-12-64-${rudder_roles.uuid}.ocs.gz https://orchestrateur-3.labo.normation.com/inventory-updates/' returned error
M| State         Technique                 Component                 Key                Message
E| error         Inventory                 inventory                                    Could not send the inventory
   error: Method 'sendInventory' failed in some repairs
   error: Method 'doInventory_always' failed in some repairs
info     Rudder agent was run on a subset of policies - not all policies were checked

somehow, the uuid_file is not read in bundle common rudder_roles


Related issues 3 (0 open3 closed)

Related to Rudder - Bug #14062: uuid.hive file should not be a rudder-agent package conf fileReleasedBenoît PECCATTEActions
Related to Rudder - Bug #14065: uuid.hive should not be a conffileReleasedAlexis MoussetActions
Related to Rudder - Bug #14616: During installation of the agent, when staring "rudder agent" service, there is numerous error about missing '/opt/rudder/etc/uuid.hive' fileReleasedBenoît PECCATTEActions
Actions #1

Updated by Vincent MEMBRÉ almost 6 years ago

  • Target version changed from 5.0.6 to 5.0.7
Actions #2

Updated by François ARMAND over 5 years ago

  • Target version changed from 5.0.7 to 5.0.9
Actions #3

Updated by Nicolas CHARLES over 5 years ago

  • Subject changed from Upgrading rudder agent from 4.0.7 to 5.0.5 purges the uuid.hive on sles12 to Upgrading rudder agent from 4.0.7 to 5.0.5 purges the uuid.hive on sles12 or 4.3.3 to 5.0.8 on centos7

It's most likely that it happens on most rpm systems

Actions #4

Updated by Nicolas CHARLES over 5 years ago

upgrade log on centos7

Taille totale des téléchargements : 7.7 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
rudder-agent-5.0.8.release-1.EL.7.x86_64.rpm                                                                                                                           | 7.7 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Mise à jour  : 1398866025:rudder-agent-5.0.8.release-1.EL.7.x86_64                                                                                                                      1/2 
warning: /etc/cron.d/rudder-agent saved as /etc/cron.d/rudder-agent.rpmsave
ok: Rudder agent is now disabled.
Warning: rudder-agent.service changed on disk. Run 'systemctl daemon-reload' to reload units.
ok: stop service rudder-agent succeeded
INFO: Ensuring correct permissions on the keys directory... Done.
ok: Rudder agent has been enabled but not started, wait for next cron run.
Warning: rudder-agent.service changed on disk. Run 'systemctl daemon-reload' to reload units.
ok: start service rudder-agent succeeded
INFO: Scheduling an inventory during next run...
INFO: A back up copy of the /opt/rudder/etc/uuid.hive has been created in /var/backups/rudder
INFO: A back up copy of the /var/rudder/cfengine-community/policy_server.dat has been created in /var/backups/rudder
INFO: A back up copy of the /var/rudder/cfengine-community/ppkeys has been created in /var/backups/rudder
  Nettoyage    : 1398866025:rudder-agent-4.3.3.release-1.EL.7.x86_64                                                                                                                      2/2 
  Vérification : 1398866025:rudder-agent-5.0.8.release-1.EL.7.x86_64                                                                                                                      1/2 
  Vérification : 1398866025:rudder-agent-4.3.3.release-1.EL.7.x86_64                                                                                                                      2/2 

Mis à jour :
  rudder-agent.x86_64 1398866025:5.0.8.release-1.EL.7                                                                                                                                         

Terminé !

first run is

# rudder agent run -uI
Rudder agent 5.0.8.release
Node uuid: Not yet configured
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive'
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
R: FATAL: The UUID file /opt/rudder/etc/uuid.hive is missing. Please run 'rudder agent check' to generate a new one or restore it from a backup.
R: *********************************************************************************
* rudder-agent could not get an updated configuration from the policy server.   *
* This can be caused by:                                                        *
*   * an agent key that has been changed                                        *
*   * if this node is not accepted or deleted node on the Rudder root server    *
*   * if this node has changed policy server without sending a new inventory    *
* Any existing configuration policy will continue to be applied without change. *
*********************************************************************************
ok: Rudder agent promises were updated.
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
   error: CfReadFile: Could not examine file '/opt/rudder/etc/uuid.hive' (stat: No such file or directory)
Start execution with config [20190325-120558-c5b0e727]

Actions #5

Updated by Nicolas CHARLES over 5 years ago

  • Subject changed from Upgrading rudder agent from 4.0.7 to 5.0.5 purges the uuid.hive on sles12 or 4.3.3 to 5.0.8 on centos7 to Upgrading rudder agent from 4.x to 5.0.x purges the uuid.hive (at least from pre 4.3.3)
Actions #6

Updated by Nicolas CHARLES over 5 years ago

tried again, seems to be done at end of installation - this is clearly not happening during the preinst

Actions #7

Updated by Nicolas CHARLES over 5 years ago

  • Related to Bug #14062: uuid.hive file should not be a rudder-agent package conf file added
Actions #8

Updated by Nicolas CHARLES over 5 years ago

  • Related to Bug #14065: uuid.hive should not be a conffile added
Actions #9

Updated by Nicolas CHARLES over 5 years ago

  • Subject changed from Upgrading rudder agent from 4.x to 5.0.x purges the uuid.hive (at least from pre 4.3.3) to Upgrading rudder agent to latest 4.1.x, 4.3.x and 5.0.x on rpm system purges the uuid.hive

but at least, it is restored automatically

Actions #10

Updated by Nicolas CHARLES over 5 years ago

  • Target version changed from 5.0.9 to 4.1.21
Actions #11

Updated by Nicolas CHARLES over 5 years ago

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

Updated by Nicolas CHARLES over 5 years ago

  • Status changed from In progress to New
i don't know how to fix this, as https://www.ibm.com/developerworks/library/l-rpm2/index.html states that the script from new package are run first, the those of the old package, and then it removes all file not overwriten by new package
we could:
  1. touch /opt/rudder/etc/uuid.hive (probably not ideal)
  2. have a script that would be run at the end of the install of new package, that would backgroud and restore uuid.hive after several seconds
  3. leave it as it is - it happens only once (i tried to do two upgrades, and it did not happens at the second upgrade)
Actions #13

Updated by Nicolas CHARLES over 5 years ago

  • Subject changed from Upgrading rudder agent to latest 4.1.x, 4.3.x and 5.0.x on rpm system purges the uuid.hive to uuid.hive is not present afet an install or an upgradie ofrudder agent to latest 4.1.x, 4.3.x and 5.0.x on rpm system purges the uuid.hive
Actions #14

Updated by Nicolas CHARLES over 5 years ago

  • User visibility set to Getting started - demo | first install | Technique editor and level 1 Techniques
  • Priority changed from 0 to 92

a fresh install on 4.1 doesn't include the uuid.hive, it happens after

Actions #15

Updated by Nicolas CHARLES over 5 years ago

  • Category changed from Agent to Documentation

we'll document this

Actions #16

Updated by Nicolas CHARLES over 5 years ago

  • Status changed from New to In progress
Actions #17

Updated by Nicolas CHARLES over 5 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-doc/pull/574
Actions #18

Updated by Rudder Quality Assistant over 5 years ago

  • Assignee changed from Alexis Mousset to Nicolas CHARLES
Actions #19

Updated by Nicolas CHARLES over 5 years ago

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

Updated by Nicolas CHARLES over 5 years ago

  • Related to Bug #14616: During installation of the agent, when staring "rudder agent" service, there is numerous error about missing '/opt/rudder/etc/uuid.hive' file added
Actions #21

Updated by Nicolas CHARLES over 5 years ago

  • Status changed from Pending release to Rejected

actually, we don't need that, it's been fixed by https://issues.rudder.io/issues/14616

Actions

Also available in: Atom PDF