sasikumar_r
Level 7

All the Inventory files are going in to InvalidFormat Folder

Jump to solution

Hi All,

We are on a multitenant, on one specific tenant all the incoming ndi files are getting moved to invalid format folder.   Ndi file has the tenant information on the filename. tried importing manually but still no luck.  Below is the error received. Could someone please assist us on this.

C:\Program Files (x86)\Flexera Software\FlexNet Manager Platform\Importers\bin>mgsimport.exe -t inventories -d C:\Support\tempfolder -e
Starting Importer...
Processing 1 files
Processing file C:\Support\tempfolder\[ABCDEFGHQ3JJQ6]_system on abcd at 20220513T151903 (Full).ndi.gz:


EXCEPTION:
--------------------
System.NullReferenceException: Object reference not set to an instance of an object.
at ManageSoft.Directory.Impl.DirectoryBinder.BindToComputerAndUser(IManageSoftDatabaseLayer databaseLayer, String computerName, String computerDomain, String computerFlatDomain, String computerUID, DirectoryEntry computerObject, String userName, String userDomain, String userUID, Boolean useUniqueNames, Int32& computerID, Int32& computerOUID, Int32& userID, Int32& userOUID, String agentID, String agentVersion)
at ManageSoft.Inventory.Importer.DatabaseImport.Begin(InventoryImportSession session)
at ManageSoft.Inventory.Importer.Implementation.RootNodeProcessor.HandleElement()
at ManageSoft.Inventory.Importer.Implementation.BaseElementNodeProcessor.Process(InventoryImportSession session)
at ManageSoft.Inventory.Importer.InventoryImporter.Import(String importType, Stream inputStream, Boolean isGzipped, String sourceIdentifier, String targetFilename, MGSLicenseTermCheckResult licenseCheckResult, ImportProcessingStats& stats, IDispatcherPreferences preferences)
----
Type: 'System.NullReferenceException'
Message: 'Object reference not set to an instance of an object.'
Source: 'ManageSoft.Directory.Logic'
--StackTrace:--
at ManageSoft.Directory.Impl.DirectoryBinder.BindToComputerAndUser(IManageSoftDatabaseLayer databaseLayer, String computerName, String computerDomain, String computerFlatDomain, String computerUID, DirectoryEntry computerObject, String userName, String userDomain, String userUID, Boolean useUniqueNames, Int32& computerID, Int32& computerOUID, Int32& userID, Int32& userOUID, String agentID, String agentVersion)
at ManageSoft.Inventory.Importer.DatabaseImport.Begin(InventoryImportSession session)
at ManageSoft.Inventory.Importer.Implementation.RootNodeProcessor.HandleElement()
at ManageSoft.Inventory.Importer.Implementation.BaseElementNodeProcessor.Process(InventoryImportSession session)
at ManageSoft.Inventory.Importer.InventoryImporter.Import(String importType, Stream inputStream, Boolean isGzipped, String sourceIdentifier, String targetFilename, MGSLicenseTermCheckResult licenseCheckResult, ImportProcessingStats& stats, IDispatcherPreferences preferences)
--------------------

File C:\Support\tempfolder\[ABCDEFGHQ3JJQ6]_system on abcd at 20220513T151903 (Full).ndi.gz:
: File content was in invalid format
File saved to C:\Support\tempfolder\BadLogs\invalidformat
All tasks are complete
Finished importing 1 files in 2.1s

---------------------------------------------------------------------------------------

0 Kudos
1 Solution
ChrisG
Community Manager Community Manager
Community Manager

An error message like this has been observed several times in the past on systems where the "SYSTEM" user record does not exist in the User view in the inventory database for the tenant in question. For example, this could occur if somebody mistakenly deleted user records directly in the database.

To check this, execute SQL statements like the following against the inventory database (ensuring the appropriate tenant UID is specified on the first line). The SELECT statement should return exactly 1 record in a correctly configured database.

EXEC dbo.SetTenantUID 'ABCDEFGHQ3JJQ6'

SELECT * FROM dbo.User WHERE UserCN = 'SYSTEM'

Try SQL statements like the following to add the missing SYSTEM user record if it isn't there:

EXEC dbo.SetTenantID NULL

DECLARE @TenantID SMALLINT

SELECT @TenantID = t.TenantID
FROM dbo.Tenant t
WHERE t.TenantUID = 'ABCDEFGHQ3JJQ6'

EXEC dbo.PopulateInitialDataForTenant @TenantID

 

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

View solution in original post

2 Replies
ChrisG
Community Manager Community Manager
Community Manager

An error message like this has been observed several times in the past on systems where the "SYSTEM" user record does not exist in the User view in the inventory database for the tenant in question. For example, this could occur if somebody mistakenly deleted user records directly in the database.

To check this, execute SQL statements like the following against the inventory database (ensuring the appropriate tenant UID is specified on the first line). The SELECT statement should return exactly 1 record in a correctly configured database.

EXEC dbo.SetTenantUID 'ABCDEFGHQ3JJQ6'

SELECT * FROM dbo.User WHERE UserCN = 'SYSTEM'

Try SQL statements like the following to add the missing SYSTEM user record if it isn't there:

EXEC dbo.SetTenantID NULL

DECLARE @TenantID SMALLINT

SELECT @TenantID = t.TenantID
FROM dbo.Tenant t
WHERE t.TenantUID = 'ABCDEFGHQ3JJQ6'

EXEC dbo.PopulateInitialDataForTenant @TenantID

 

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

Hi @ChrisG ,

Thank you for your answer! We have followed the steps mentioned which you have provided & it worked as usual 😊

We have recently cleaned up some staled user records from user db, seems like we have deleted the system record aswell. After restoring the system record the files are getting processed now.

Thank you so much once again for taking your time and answer my query which helped to fix the issue.🤝

Regards

Sasi