Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

The import process leaves XML files orphaned over time. #2550

Open
tabad opened this issue May 14, 2018 · 1 comment
Open

The import process leaves XML files orphaned over time. #2550

tabad opened this issue May 14, 2018 · 1 comment
Labels
Milestone

Comments

@tabad
Copy link

tabad commented May 14, 2018

The environment

  • Red Hat Enterprise Linux Server release 7.3 (Maipo)
    • GLPI v9.2.3
      • FusionInventory for GLPI v9.2+2.0
      • ...and other plugins

This is the information about system installation and configuration.

Note#1: It's very probably this bug exists in previous FI4G versions.

Note#2: This issue has relationship with issues Asset import XML file is not deleted when the asset is delete permanently(#2549) and Incorrect structure under '/glpi/files/_plugins/fusioninventory' (#2034).

The issue

Whatever asset imported inside GLPI by FI4G (a computer, a network device, a network printer, etc.) has associated a XML file under the files/_plugins/fusioninventory/xml directory that contains information (information that is sent by FIA) about it. This is an example of files/_plugins/fusioninventory/xml for three assets.

[root@ilab glpi]# tree files/_plugins/fusioninventory/xml/
files/_plugins/fusioninventory/xml/
├── computer
│   └── 0
│       └── 1.xml
├── networkequipment
│   └── 1
│       └── 17.xml
└── printer
    └── 2
        └── 23.xml

As I commented in issue Asset import XML file is not deleted when the asset is delete permanently(#2549), this tree structure is true for new FI4G installations (v9.2+2.0 and above). If your system is the result of successive update processes then you probably have a more similar structure to this one, with XML files without .xml extension.

files/_plugins/fusioninventory/xml/
├── computer
│   └── 0
│       └── 1.xml      <---(* FI4G v9.2+2.0)
│       └── 2          <---(* Before FI4G v9.2+2.0)
├── networkequipment   <---(* FI4G v9.2+2.0)
│   └── 1
│       └── 17.xml     <---(* FI4G v9.2+2.0)
├── NetworkEquipment   <---(* Before FI4G v9.2+2.0)
│   └── 22
│       └── 229        <---(* Before FI4G v9.2+2.0)
├── printer            <---(* FI4G v9.2+2.0)
│   └── 2
│       └── 23.xml     <---(* FI4G v9.2+2.0)
└── Printer            <---(* Before FI4G v9.2+2.0)
    └── 994
        └── 9941       <---(* Before FI4G v9.2+2.0)

Take a look to my comment in issue Incorrect structure under '/glpi/files/_plugins/fusioninventory' (#2034) to know how to workaround this hodgepodge of directories and files.

Even if issues #2549 and #2034 are resolved there is another one regarding XML files without .xml extension. Let's assume the following case in a recently system updated to GLPI v9.2.3 and FI4G v9.2+2.2.

files/_plugins/fusioninventory/xml/
└── computer
    └── 0
        └── 1

The files/_plugins/fusioninventory/xml/computer/0/1 file is the import XML file of computer with Id=0, which has not yet been inventoried with the new system. When the computer is re-inventoried the following happens.

files/_plugins/fusioninventory/xml/
└── computer
    └── 0
        └── 1          <---(* orphaned XML file)
        └── 1.xml      <---(* FI4G v9.2+2.0)

Computer with Id=0 is linked with files/_plugins/fusioninventory/xml/computer/0/1.xml and files/_plugins/fusioninventory/xml/computer/0/1 remains orphaned.

FI4G should remove the current (old) import XML file before to import (and to create) the new one. In this case, the files/_plugins/fusioninventory/xml/computer/0/1 file should have been deleted.

Regards,

@ddurieux ddurieux added the bug label May 14, 2018
@ddurieux ddurieux added this to the 9.2+2.1 milestone May 14, 2018
@tabad
Copy link
Author

tabad commented Oct 10, 2018

Hello,

Is there or have you any news about this issue?

Thanks in advance,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants