Project

General

Profile

Actions

Bug #3039

closed

This is not possible to edit an Services management Directive after a migration from 2.4.0~beta4 to 2 4.0~rc1

Added by Nicolas PERRON almost 12 years ago. Updated about 11 years ago.

Status:
Released
Priority:
1 (highest)
Assignee:
Nicolas PERRON
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

As #3038, the upgrade of Rudder on a SLES 11 SP1 from 2.4.0~beta4 to 2.4.0~rc1 lead to an error when trying to edit a Directive based on Services Management Technique with these conditions:
  • There are several Directives from Services Management
  • All of these Directives are at version 1.1 (the last version from 2.4.0~beta4)
  • Before to update manually the Techniques from packages of Rudder 2.4.0~beta4 to 2.4.0~rc1, fix the metadata.xml of Enforce A File Content by replacing tag <POLICY> by <TECHNIQUE> (#3027)
After a complete upgrade of Rudder and Techniques (commit new Techniques and restart Rudder or reload techniques on the WebUI):
  • Using Rules with Directives based on Services Management Technique will work
  • Trying to edit a Directive based on Services Management Technique will lead to:
    • A message in the WebUI "The server cannot be contacted at this time"
    • A message in the webapp logs:
      "[...] Java.NoSuchElementException: [...] Key not found: 1.2 [...]" 
      

The only way to be able to edit Directives is to remove the version 1.2 from the Techniques:

cd /var/rudder/configuration-repository/techniques/systemSettings/process/servicesManagement
git rm -r 1.2/
git commit -m "Remove 'Services Management' v1.2 Technique temporarily" 


Related issues 2 (0 open2 closed)

Related to Rudder - Bug #3198: Sometimes, accepting a new version of a Policy Template fails in Rudder 2.3RejectedNicolas CHARLES2013-01-15Actions
Has duplicate Rudder - Bug #3038: This is not possible to edit an Enforce a File Content Directive after a migration from 2.4.0~beta4 to 2 4.0~rc1 (with a fix about v3.1 which contains a wrong metada.xml)Rejected2012-11-27Actions
Actions #1

Updated by François ARMAND almost 12 years ago

  • Status changed from New to Discussion
  • Assignee set to François ARMAND

Some more information are needed for that:

  • the full stack trace that contains "[...] Java.NoSuchElementException: [...] Key not found: 1.2 [...]"
  • does trying to CREATE a new Directive for that Technique works ?
  • does removing the Technique version 1.2 and then add it again make it works again ?
Actions #2

Updated by François ARMAND almost 12 years ago

  • Assignee changed from François ARMAND to Nicolas PERRON
Actions #3

Updated by François ARMAND almost 12 years ago

Information from #3038 seems to show that something went wrong in the registration process of the Technique version, and so adding the version again should also solve the problem.

Actions #4

Updated by François ARMAND almost 12 years ago

So, the bug, or at least something exhibiting the same behaviour, can be manually forged with the following steps:

  • choose a Technique with several versions (or create a new version of a Technique on the configuration-repository/techniques directory for that technique, with cp -r TheTechnique/1.0 TheTechniqe/1.99, and then git add TheTechnique/1.99 and git commit and in Rudder, reload Technique Library) ;
  • in the LDAP tree, go to the activeTechnique entry for that technique: DN: activeTechniqueId=XXXXXXXXXX,techniqueCategoryId=....,techniqueCategoryId=Active Techniques,ou=Rudder,cn=rudder-configuration
  • modify the attribute acceptationTimestamp to remove a "key":"timestamp"
    • for exemple, change {"1.0":"20120918133146.958Z","1.1":"20121129150426.437Z"} into {"1.0":"20120918133146.958Z"}
  • now, in Rudder Directive screen, select the Technique => error.

So, if it is the same bug, we can conclude three things:

  • the workaround in comment 3 should work reliably, as it force Rudder to write back correctly the acceptationTimestamp attribute;
  • there is a Scala bug; we should guard again such inconsistent state to report an error and degrade nicely;
  • something in the migration process override the acceptationTimestamp attribute.

Regarding that last hypothesis, it could be good to know what is overriding the attribute, and why, because even if it only revealed a bug here, perhaps that migration step is not exactly doing what we thought it was doing.

Actions #5

Updated by François ARMAND almost 12 years ago

  • Status changed from Discussion to Pending technical review
  • % Done changed from 0 to 100
Actions #6

Updated by Nicolas CHARLES almost 12 years ago

  • Status changed from Pending technical review to Discussion

This commit looks valid, thank you for your workaround Francois

Actions #7

Updated by Nicolas PERRON almost 12 years ago

François ARMAND wrote:

So, the bug, or at least something exhibiting the same behaviour, can be manually forged with the following steps:

  • choose a Technique with several versions (or create a new version of a Technique on the configuration-repository/techniques directory for that technique, with cp -r TheTechnique/1.0 TheTechniqe/1.99, and then git add TheTechnique/1.99 and git commit and in Rudder, reload Technique Library) ;
  • in the LDAP tree, go to the activeTechnique entry for that technique: DN: activeTechniqueId=XXXXXXXXXX,techniqueCategoryId=....,techniqueCategoryId=Active Techniques,ou=Rudder,cn=rudder-configuration
  • modify the attribute acceptationTimestamp to remove a "key":"timestamp"
    • for exemple, change {"1.0":"20120918133146.958Z","1.1":"20121129150426.437Z"} into {"1.0":"20120918133146.958Z"}
  • now, in Rudder Directive screen, select the Technique => error.

So, if it is the same bug, we can conclude three things:

  • the workaround in comment 3 should work reliably, as it force Rudder to write back correctly the acceptationTimestamp attribute;
  • there is a Scala bug; we should guard again such inconsistent state to report an error and degrade nicely;
  • something in the migration process override the acceptationTimestamp attribute.

Regarding that last hypothesis, it could be good to know what is overriding the attribute, and why, because even if it only revealed a bug here, perhaps that migration step is not exactly doing what we thought it was doing.

After analysing the upgrade process, I didn't see anything which could modify the attribute activeTechniqueLibrary, except for the migration from 2.3 to 2.4 because of the renaming of this attribute.

Actions #8

Updated by François ARMAND almost 12 years ago

  • Status changed from Discussion to Pending technical review

OK, so I'm going to close that one, as I don't really see how we could go further.

Actions #9

Updated by François ARMAND almost 12 years ago

  • Status changed from Pending technical review to Released

Technical review was done by NCH in GitHub.

Actions #10

Updated by Jonathan CLARKE almost 12 years ago

  • Status changed from Released to Pending release
Actions #11

Updated by Jonathan CLARKE almost 12 years ago

  • Status changed from Pending release to Released
Actions

Also available in: Atom PDF