Occasional contributor

Failed to import inventory devices with error message 'Invalid length parameter passed to the LEFT or SUBSTRING function.

Hey All!

Did you guys ever faced that error on reconcile before? I am pretty sure I saw them in the Cloud Edition but, of course, Flexera always fix it. I am interested to know how to fix it on the on-premise solution as well. Any clues where to start?

Thanks!

Leo

3 Replies
Shining star

Re: Failed to import inventory devices with error message 'Invalid length parameter passed to the LEFT or SUBSTRING function.

Hi Leonardo,

I would always start with the log file from the inventory import. It usually gives the specific step in which the error occurred.

From there I would take the SQL code and run it manually from the SQL Server Management Studio. In some cases, when statements consume temp data, prerequisite queries need to be run before the actual statement can be executed.

Ideally, if you start breaking down the statement, you should find the specific line in code and hopefully the responsible data as well.

Sounds to me like it tries to separate data from a string, but the charater for "cutting" cannot be found. Like with DomainName\Username.

Best regards,

Markward

Softline Group is Europe's leading independent expert in Software Asset Management.
Flexera
Flexera

Re: Failed to import inventory devices with error message 'Invalid length parameter passed to the LEFT or SUBSTRING function.

Markward is correct, the couple of times we've seen this is where the query is not able to split out a string.

In addition to what Markward suggested, the other 2 bits of information that would be useful here are:

  1. FNMS version you see this on
  2. Which adapter is running at the time

For number 2, you can find this in the log that Markward suggested.

 

I can see a couple of older bugs (most recent was fixed in 2017 R2 and that was for the App-V standalone adapter) so the information above will help confirm if it's an issue that has been resolved already in later versions or not.

(Anything expressed here is my own view and not necessarily that of my employer, Flexera)
If the solution provided has helped, please mark it as such as this helps everyone to know what works.
Occasional contributor

Re: Failed to import inventory devices with error message 'Invalid length parameter passed to the LEFT or SUBSTRING function.

Hey Guys!

Just to give you a feedback on this, the problem solved when I reviewed the DATABASE configurations and found that the Database was not with compatibility level set to "SQL Server 2014 (120)". After changing this and giving a couple of days, the system worked as intended.

Cheers!