"Key of File" inspector broken in 9.5 and 9.5.1 on Windows 7 / 2008

The “Key of File” inspector is broken in 9.5.0 as well. If the total length of the key/value line is more than 65 characters (plus CR/LF), the key is not returned at all.

 q: lines of files "c:\test\test.ini"
A: 
A: [TEST]
A: 
A: var1=value1
A: var2=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var3=a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var4=a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var5=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var6=a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-variable-name-with-shorter-value1=total-length-67-aaaaaaab
T: 0.661 ms
I: plural file line

/* the "variables" inspector is truncating the last character "b" from the results. */
    q: variables of files "c:\test\test.ini"
    A: [TEST].var1=value
    A: [TEST].var2=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    A: [TEST].var3=a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    A: [TEST].var4=a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    A: [TEST].var5=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    A: [TEST].var6=a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaa
    A: [TEST].a-long-variable-name-with-shorter-value1=total-length-67-aaaaaaa
    T: 0.286 ms
    I: plural string

/* obtain key names for all keys */
q: ((following text of last "." of preceding text of first "=" of it) of variables of it) of files "c:\test\test.ini"
A: var1
A: var2
A: var3
A: var4
A: var5
A: var6
A: a-long-variable-name-with-shorter-value1
T: 0.455 ms
I: plural substring

    /* the lines for 'var3' and 'var4' are too long and will not be returned.
       The missing "a-long-variable-name-with-shorter-value1' shows its the whole line length, not just the length of the value, messing it up
 */
        q: keys(  (following text of last "." of preceding text of first "=" of it) of variables of it) of files "c:\test\test.ini"
        A: value1
        A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
        A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
        A: a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
        T: 2.575 ms
        I: plural string

q: key "var2" of file "c:\test\test.ini"
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
T: 0.630 ms
I: singular string

q: key "var3" of file "c:\test\test.ini"
E: Singular expression refers to nonexistent object.
1 Like

PMR 19474,004,000 opened on this.

The “Key of File” inspector is critical to how my infrastructure operates - I push down CSV files that are manipulated into INI files, and those INI values are used to determine correct values for a lot of per-system / per-environment configurations.

So…any advice on running 9.5 Servers/Consoles with 9.2 Relays & Agents (including the agent on the Consoles)? Or do I need to start thinking about a whole system downgrade?

1 Like

Related: RESOLVED: "Variables of File" inspector broken in 9.5 and 9.5.1 (fixed in 9.5.2)

Go ahead and use 9.2 relays & agents with 9.5 server. I wouldn’t worry about this configuration.

We just released the 9.5.1 Patch and this is one of the areas worked on. Can you validate if 9.5.1 fixes your issue?

2 Likes

Also as you’ve opened a PMR please update the PMR. I did the tests in the report and the 9.5.1 release should address the issues.

1 Like

Excellent thank you! will be checking it tomorrow morning.

1 Like

I’m afraid this is still not working for me in 9.5.1.9. This one’s affecting Windows agents only, Linux isn’t a problem at 9.5.0.311.

Any advice on downgrading the Agent to 9.2.7 on Servers, Relays, and Consoles that are running the 9.5.0 and 9.5.1 server components?

The information provided in the PMR when I ran the tests shows that 9.5.1 does have the fix so we can’t reproduce the issue. Can you provide some better logic on how to test it to the PMR?

Here is my test with a 9.5.1.9 Fixlet Debugger which works correctly

q: version of client
A: 9.5.1.9

q: lines of file  "e:\test\test.ini" 
A: [TEST]                                                                       
A:  
A: var1=value1                                                                  
A: var2=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab             
A: var3=a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab            
A: var4=a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab           
A: var5=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab             
A: var6=a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab              
A: a-long-variable-name-with-shorter-value1=total-length-67-aaaaaaab  

q: variables of files "e:\test\test.ini" 
A: [TEST].var1=value
A: [TEST].var2=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var3=a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var4=a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var5=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var6=a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].a-long-variable-name-with-shorter-value1=total-length-67-aaaaaaa

q: ((following text of last "." of preceding text of first "=" of it) of
variables of it) of files "e:\test\test.ini"  
A: var1
A: var2
A: var3
A: var4
A: var5
A: var6
A: a-long-variable-name-with-shorter-value1

q: keys(  (following text of last "." of preceding text of first "=" of it) of
variables of it) of files "e:\test\test.ini"
A: value1
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: total-length-67-aaaaaaab

q: key "var2" of file "e:\test\test.ini"
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab

q: key "var3" of file "e:\test\test.ini"
A: a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
1 Like

Hmm I’ll be checking again tomorrow, but I was still having both issues with a console client / agent upgraded to 9.5.1.9. In the PMR I posted an Analysis I’m using now to check results from various client versions & OS mixes. I uploaded a sample of my larger INI file as well.

For my validation test I’m attaching the .ini to the Master Action Site, and the Analysis checks various properties such as taking a sha1 of the results of these queries on the file. I can say that both Linux and Windows are dropping the last character of the values for “variables of file” and that only Windows seems affected by the 65-character length from “key [string] of file”.

And…now I just downloaded the fixlet debugger to my home computer (Windows 10 Home x64), no client installed at all, and I’m getting a mixed bag. The “keys” inspector is doing the right thing, but the “variables” inspector is still truncating the last character of the value (I see it’s doing the same in your post, removing the “b” from the end of the strings in the variables result)…

q: lines of file "c:\temp\test.ini"
A: [TEST]
A:  
A: var1=value1
A: var2=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var3=a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var4=a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var5=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: var6=a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-variable-name-with-shorter-value1=total-length-67-aaaaaaab
T: 0.549 ms
I: plural file line

q: variables of files "c:\temp\test.ini"
A: [TEST].var1=value
A: [TEST].var2=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var3=a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var4=a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var5=a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].var6=a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaa
A: [TEST].a-long-variable-name-with-shorter-value1=total-length-67-aaaaaaa
T: 0.226 ms
I: plural string

q: keys(  (following text of last "." of preceding text of first "=" of it) of variables of it) of files "c:\temp\test.ini"
A: value1
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: total-length-67-aaaaaaab
T: 2.090 ms
I: plural string

:confused:

After upgrading the client & console to 9.5.1.9, I can’t recall now whether I rebooted before continuing to test. Just thinking out loud here, but is there some kind of caching/optimization that could have been created in 9.5.0 and continue to be referenced after the upgrade?

Interesting, I am trying the same test on my Production VS Lab and getting mixed results:
Production at 9.2.6
q: keys( (following text of last “.” of preceding text of first “=” of it) of variables of it) of files "c:\temp\test.ini"
A: value1
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-66-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-67-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: total-length-67-aaaaaaab
T: 7.645 ms

LAB at 9.5.1.9
q: keys( (following text of last “.” of preceding text of first “=” of it) of variables of it) of files "c:\temp\test.ini"
A: value1
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-65-aaaaaaaaaaaaaaaaaaaaaaaaaaaaab
A: a-long-value-total-length-64-aaaaaaaaaaaaaaaaaaaaaaaaaaaab
T: 3.290 ms
My LAB only returned 3 out of 5 of the long-value… this might be a show stopper for a scheduled Production upgrade to 9.5.1 next week.

1 Like

Since this seems to be a bit harder to reproduce, here’s some more info based on a simpler INI file. Interestingly, this gives the bad result for “key of file” running under Windows 7 Enterprise SP1 x64 and on Windows Server 2008 R2, but works correctly under Windows 10 Enterprise (in the debugger anyway - I’m rolling out an updated client to a Win10 test client now) …

q: lines of file "c:\temp\simpletest.ini"
A: test1=value1
A: test2=a_much_longer_value_that_creates_a_line_longer_than_65_characters
A: MachineProfilePath=\\myserver\dfs\mygroup\myhome\Windows\ProfileW7
T: 0.394 ms
I: plural file line

q: key "test1" of file "c:\temp\simpletest.ini"
A: value1
T: 0.248 ms
I: singular string

q: key "test2" of file "c:\temp\simpletest.ini"
E: Singular expression refers to nonexistent object.

q: key "MachineProfilePath" of file "c:\temp\simpletest.ini"
E: Singular expression refers to nonexistent object.

I just tried these and got the following. Note we do use a Windows function for those platforms ( GetPrivateProfileString ) which may have a bug on some versions of the OS?

q: version of client
A: 9.5.1.9

q: operating system
A: Win2012R2 6.3.9600

q: lines of file "e:\test\test2.ini"
A: test1=value1
A: test2=a_much_longer_value_that_creates_a_line_longer_than_65_characters
A: MachineProfilePath=\\myserver\dfs\mygroup\myhome\Windows\ProfileW7

q: key "test1" of file "e:\test\test2.ini"
A: value1

q: key "test2" of file "e:\test\test2.ini"
A: a_much_longer_value_that_creates_a_line_longer_than_65_characters

q: key "MachineProfilePath" of file "e:\test\test2.ini"
A: \\myserver\dfs\mygroup\myhome\Windows\ProfileW7

A stab in the dark here, but your INI files, how are they created? A difference in 9.5 is that we are now using the “wide” interfaces to Windows so is your file ASCII or UTF16?

Maybe so…but my systems are only affected with BES Client 9.5.0 and 9.5.1. 9.2.1, 9.2.2, and 9.2.5 were not affected…

Yes, though as mentioned a different “variant” of the Windows function is now called due to the UNICODE calls we are making now

I’m creating them in Notepad++, it says the encoding is “UTF-8”. They look correct in Notepad.exe as well. I’ll try generating a new one with the BigFix client using “__createfile”.

I got the same results as @JasonWalker using the Fixlet Debugger version 9.5.1.9 on Windows 7 Professional SP1 X64. The first expression works, the last two fail.

Using the Fixlet Debugger version 9.2.7.63, all expressions succeed.

I used “local fixlet debugger evaluator” for both tests.

I created the simpletest.ini file using Notepad.

–Mark