Project

General

Profile

Actions

Bug #2588

closed

Tag name of serialised object are not consistant in different Rudder parts

Added by Jonathan CLARKE almost 12 years ago. Updated almost 12 years ago.

Status:
Released
Priority:
1
Category:
Web - Maintenance
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

On a freshly installed Rudder 2.4 nightly snapshot, when I try to import archives from the Administration > Archives screen, I get an error in the UI:

After trying a "Global Archives" restore, I see this in the webapp's log on disk:

23:48:04.578 [qtp1401888126-66] INFO  com.normation.rudder.repository.xml.ItemArchiveManagerImpl - Importing full archive with id 'd1e71dc5902a5d725c4bbf59061760a2a9cec7d8'
23:48:04.578 [qtp1401888126-66] INFO  com.normation.rudder.repository.xml.ItemArchiveManagerImpl - Importing rules archive with id 'd1e71dc5902a5d725c4bbf59061760a2a9cec7d8'
23:48:04.750 [qtp1401888126-66] INFO  com.normation.rudder.repository.xml.ItemArchiveManagerImpl - Importing technique library archive with id 'd1e71dc5902a5d725c4bbf59061760a2a9cec7d8'
23:48:04.759 [qtp1401888126-66] ERROR com.normation.rudder.web.snippet.administration.Archives - Error when importing groups, Directive library and Rules. <- Error when unserializing category for file 'directives/category.xml' <- Entry type is not a policyLibraryCategory: <activeTechniqueCategory fileFormat="2">
  <id>Active Techniques</id>
  <displayName>Root of active techniques's library</displayName>
  <description>
    This is the root category for active techniques. It contains subcategories, actives techniques and directives
  </description>
  <isSystem>true</isSystem>
</activeTechniqueCategory>
23:48:04.760 [qtp1401888126-66] ERROR com.normation.rudder.web.snippet.administration.Archives - 

When trying to restore just groups, I see this:

23:49:00.147 [qtp1401888126-67] INFO  com.normation.rudder.repository.xml.ItemArchiveManagerImpl - Importing groups archive with id '29bd20f64e19a69c8a877544572dac577f84d8f3'
23:49:00.149 [qtp1401888126-67] ERROR com.normation.rudder.web.snippet.administration.Archives - Error when importing groups. <- No file were found at path 'groups/category.xml'
23:49:00.149 [qtp1401888126-67] ERROR com.normation.rudder.web.snippet.administration.Archives - 

And when trying to restore just Directives, I see this:

23:48:56.974 [qtp1401888126-63] INFO  com.normation.rudder.repository.xml.ItemArchiveManagerImpl - Importing technique library archive with id '29bd20f64e19a69c8a877544572dac577f84d8f3'
23:48:56.977 [qtp1401888126-63] ERROR com.normation.rudder.web.snippet.administration.Archives - Error when importing Directive library. <- The directory 'directives/' does not contain 'directives/category.xml' or 'directives/activeTechniqueSettings.xml' and should not have been considered
23:48:56.977 [qtp1401888126-63] ERROR com.normation.rudder.web.snippet.administration.Archives - 

This may be several different bugs, I don't know - if so feel free to create extra tickets.


Files

1.png (13.1 KB) 1.png Jonathan CLARKE, 2012-06-14 23:52

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #2544: On Rules archive management, trying to use "Restore Rules" doesn't restore anythingRejectedFrançois ARMAND2012-06-07Actions
Related to Rudder - Bug #2592: On first application start, root directive category is not exported in XML, causing bug in next importReleasedFrançois ARMAND2012-06-18Actions
Actions #1

Updated by François ARMAND almost 12 years ago

  • Status changed from 2 to In progress
Actions #2

Updated by François ARMAND almost 12 years ago

So, it seems that the archiving does not serialize the root Category, and so the error.
Looking to it.

Actions #3

Updated by François ARMAND almost 12 years ago

Well, the previous comment seems to be something else, see: #2592

Actions #4

Updated by François ARMAND almost 12 years ago

  • Subject changed from Importing Groups, Directives or global archives does not work to Tag name of serialised object are not consistant in different Rudder parts

OK, so, as we used plain text XML tag names at different plance of the application, non all evolves accordingly to all refactoring.

For example, in the serialization class, we can see:

  def serialise(uptc:ActiveTechniqueCategory):  Elem = {
    XmlUtils.trim {
      <activeTechniqueCategory fileFormat={xmlVersion}>
       ....

And on the unserialization part:

      uptc             <- {
                            if(entry.label ==  "policyLibraryCategory") Full(entry)
                            else Failure("Entry type is not a policyLibraryCategory: " + entry)
                          }

That's BAD !!!

Actions #5

Updated by François ARMAND almost 12 years ago

  • Status changed from In progress 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 Released

This looks valid, thank you Francois !

Actions

Also available in: Atom PDF