Import process fails at ProcessCSPMetadataJsonBlob step after editing Reader\ManageSoft\Computer.xml with the Inventory Adapter Studio
Description
If the Inventory Adapter Studio is used to open and save the file inventory import reader file C:\ProgramData\Flexera Software\Compliance\ImportProcedures\Inventory\Reader\ManageSoft\Computer.xml, subsequent executions of the inventory import process may fail at the ProcessCSPMetadataJsonBlob step with the following error:
ProcessCSPMetadataJsonBlob (Execute on FNMP) Completed with error in 0 seconds. Released application lock Reader_b64a1b04-703b-4dbe-9e3d-36c5089e4911_Computer_ALL ERROR: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null. Parameter name: path2 at System.IO.Path.Combine(String path1, String path2) at ManageSoft.Compliance.Importer.Procedures.ManageSoft.CloudServiceInstanceData.Process(String fileName, IExecutionContext context) [...]
Replication Steps
- Open the ManageSoft adapter in the Inventory Adapter Studio.
- Expand the Computer object and select the step ProcessCSPMetadataJsonBlob.
- Click on Save from the tool bar.
- Run the import process to read data from a FlexNet Manager Suite inventory database.
Cause
This error occurs because the Inventory Adapter Studio is unable to correctly open and save details contained within the Reader\ManageSoft\Computer.xml reader file.
In particular, the following XML structure in this file is not preserved:
<Reader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="ExecuteOnTarget" Name="ProcessCSPMetadataJsonBlob" Order="980" Assembly="ManageSoft.Compliance.Importer.Procedures.ManageSoft" Class="ManageSoft.Compliance.Importer.Procedures.ManageSoft.CloudServiceInstanceData" Method="Process"> <Parameter xmlns:q1="http://www.w3.org/2001/XMLSchema" d1p1:type="q1:string" xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance">CSPJsonParser.xml</Parameter> </Reader>
The Inventory Adapter Studio incorrectly saves this structure as:
<Reader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="ExecuteOnTarget" Name="ProcessCSPMetadataJsonBlob" Order="980" Assembly="ManageSoft.Compliance.Importer.Procedures.ManageSoft" Class="ManageSoft.Compliance.Importer.Procedures.ManageSoft.CloudServiceInstanceData" Method="Process" DeclareVariables="true"><![CDATA[CSPJsonParser.xml]]></Reader>
Workaround
Avoid using the Inventory Adapter Studio to edit the Reader\ManageSoft\Computer.xml file. Instead, edit the file directly using a text editor.
Alternatively, after saving the file using the Inventory Adapter Studio, edit the file using a text editor and re-instate the original XML structure detailed above.