PAL Error v 2.0.5

Oct 25, 2010 at 4:06 PM

When I try to analyze a log containing SQL Server performance counters I receive the following on Windows XP 32 bit.  I see others have had similar errors but I haven't been able to find the solution:

All counter stats is set to true. Loading all counters in perfmon log into the t
hreshold file as new analyses. This may take several minutes.
Getting the counter list from the perfmon log...Done
Importing the counter list as new threshold analysesDone
WARNING: Please post errors or problems with this tool to the PAL web site
located at http://www.codeplex.com/PAL with the following error message and a
brief description of what you were trying to do. Thank you.
Exception calling "Substring" with "2" argument(s): "Index and length must refe
r to a location within the string.
Parameter name: length"
At C:\Program Files\PAL\PAL v2.0.5\PAL.ps1:1033 char:35
+     $Char = $sCounterObject.Substring <<<< (0,1)
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : DotNetMethodException


C:\Program Files\PAL\PAL v2.0.5>

Contents of PAL.log:

**********************
Windows PowerShell Transcript Start
Start time: 20101025110254
Username  : XXXX

Machine   : XXXX (Microsoft Windows NT 5.1.2600 Service Pack 3)
**********************
Transcript started, output file is C:\DOCUME~1\xxxx\LOCALS~1\Temp\PAL.log
PAL v2.0.5 (http://www.codeplex.com/PAL)
Written by: Clint Huffman (clinth@microsoft.com) and other contributors.
Last Modified: 09/30/2010 00:34:30
The information and actions by this tool is provided "as is" and is intended for information purposes only. The authors and contributors of this tool take no responsibility for damages or losses incurred by use of this tool.

SCRIPT ARGUMENTS:
-Log C:\Program Files\PAL\PAL v2.0.5\PAL_Microsoft_SQL_Server_2005_2008.csv
-ThresholdFile C:\Program Files\PAL\PAL v2.0.5\SQLServer.xml
-Interval AUTO
-OutputDir [My Documents]\PAL Reports
-IsOutputHtml True
-HtmlOutputFileName [LogFileName]_PAL_ANALYSIS_[DateTimeStamp].htm
-AllCounterStats True
-IsOutputXml False
-XmlOutputFileName [LogFileName]_PAL_ANALYSIS_[DateTimeStamp].xml
-BeginTime
-EndTime


Creating session working directory...
Creating directory "C:\DOCUME~1\xxxx\LOCALS~1\Temp\{c469dafa-e8a6-4021-b718-6bd3ba935321}"
Creating file "C:\Documents and Settings\xxxx\My Documents\PAL Reports\PAL_Microsoft_SQL_Server_2005_2008_PAL_ANALYSIS_2010-10-25_11-02-54.htm"
Creating directory "C:\Documents and Settings\xxxx\My Documents\PAL Reports\PAL_Microsoft_SQL_Server_2005_2008_PAL_ANALYSIS_2010-10-25_11-02-54\"

Threshold File Load History:
C:\Program Files\PAL\PAL v2.0.5\SQLServer.xml
QuickSystemOverview.xml

Generating the counter list to filter on...Done
Removing duplicate counter expressions from counter list...Done

All counter stats is set to true. Loading all counters in perfmon log into the threshold file as new analyses. This may take several minutes.
Getting the counter list from the perfmon log...Done
Importing the counter list as new threshold analysesDone
WARNING: Please post errors or problems with this tool to the PAL web site
located at http://www.codeplex.com/PAL with the following error message and a
brief description of what you were trying to do. Thank you.
Exception calling "Substring" with "2" argument(s): "Index and length must refe
r to a location within the string.
Parameter name: length"
At C:\Program Files\PAL\PAL v2.0.5\PAL.ps1:1033 char:35
+     $Char = $sCounterObject.Substring <<<< (0,1)
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : DotNetMethodException
 
**********************
Windows PowerShell Transcript End
End time: 20101025110309
**********************

 

Coordinator
Nov 3, 2010 at 3:39 AM

This is typically caused by using a non-English US locale. Are you using a non-English US locale?

Nov 3, 2010 at 2:12 PM

I shouldn't be, no.

Coordinator
Nov 5, 2010 at 7:53 AM

Can you send me the counter log file, so I can debug it? My guess is that there might be some corruption in the CSV file.

Nov 30, 2010 at 5:31 AM

I'm getting the same error and we're using non-English US locale.  Is there a workaround for this?

 

Exception calling "Substring" with "2" argument(s): "Index and length must refer to a location within the string. Parameter name: length"
At C:\Program Files\PAL\PAL v2.0.5\PAL.ps1:1033 char:35
+     $Char = $sCounterObject.Substring <<<< (0,1)
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE
   xception
    + FullyQualifiedErrorId : DotNetMethodException

 

Processing the sample counter log file works fine.

Coordinator
Dec 16, 2010 at 9:21 PM

It might be a counter path that is unexpected. Sometimes counter developers will have very odd characters in the counter path. Can you send me the counter log? My email address is clinth@microsoft.com

Jan 14, 2011 at 10:43 PM

I am also unable to solve this.

This is the command line:

PowerShell.exe -File "C:\Program Files\PAL\PAL v2.0.5\PAL.ps1" -LOG "d:\temp\performance\FILESERVER1\log1.csv" -THRESHOLDFILE "C:\Program Files\PAL\PAL v2.0.5\ActiveDirectory.xml" -INTERVAL "3600" -ISOUTPUTHTML True -ISOUTPUTXML False -OUTPUTDIR d:\temp -HTMLOUTPUTFILENAME "201012_FILESERVER1_3.html" -NumberOfProcessors 1 -ThreeGBSwitch False -SixtyFourBit False -TotalMemory 4 -KernelDumpOnCDrive True

This is the output:

Transcript started, output file is C:\DOCUME~1\cam_s\LOCALS~1\Temp\PAL.log
PAL v2.0.5 (http://www.codeplex.com/PAL)
Written by: Clint Huffman (clinth@microsoft.com) and other contributors.
Last Modified: 09/30/2010 01:34:30
The information and actions by this tool is provided "as is" and is intended for information purposes only. The authors and contributors of this tool take no responsibility for damages or losses incurred by use of this tool.

SCRIPT ARGUMENTS:
-Log d:\temp\performance\FILESERVER1\log1.csv
-ThresholdFile C:\Program Files\PAL\PAL v2.0.5\ActiveDirectory.xml
-Interval 3600
-OutputDir d:\temp
-IsOutputHtml True
-HtmlOutputFileName 201012_FILESERVER1_3.html
-AllCounterStats False
-IsOutputXml False
-XmlOutputFileName [LogFileName]_PAL_ANALYSIS_[DateTimeStamp]_[GUID].xml
-BeginTime
-EndTime


Creating session working directory...
Creating directory "C:\DOCUME~1\cam_s\LOCALS~1\Temp\{63c90173-d663-440c-bd30-4e639efe2a27}"

Threshold File Load History:
C:\Program Files\PAL\PAL v2.0.5\ActiveDirectory.xml
SystemOverview.xml
QuickSystemOverview.xml

Generating the counter list to filter on...Done
Removing duplicate counter expressions from counter list...Done

WARNING: Please post errors or problems with this tool to the PAL web site located at http://www.codeplex.com/PAL with the following error message and a
brief description of what you were trying to do. Thank you.
Exception calling "Substring" with "2" argument(s): "Index and length must refer to a location within the string.
Parameter name: length"
At C:\Program Files\PAL\PAL v2.0.5\PAL.ps1:1033 char:35
+     $Char = $sCounterObject.Substring <<<< (0,1)
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : DotNetMethodException

I can send the log file if needed.

Is there a secret to getting this going?

Coordinator
Jan 18, 2011 at 8:11 PM

Hi cam_s,

I am not able to reproduce this issue. Can you send me the CSV log you are using, so I can debug it? My email address is clinth@microsoft.com.

Thank you,

Jan 19, 2011 at 7:24 PM

CSV file sent by email.

Coordinator
Jan 19, 2011 at 10:22 PM

Regarding, cam_s's CSV file, I fixed this just now and quietly replaced the v2.0.6 build. As of now, please download v2.0.6 and reinstall PAL. Sorry for the inconvenience.

Jan 21, 2011 at 5:21 PM

Thanks for looking into this, Clint. I found that there is a bug in the Windows Performance Monitor, at least for some versions of Windows. It seems that if the performance monitor has something entered in the Comment field, the comment appears in the CSV file as an additional column name and data in each data row, and the data can be partial (i.e. opening double quote without a closing quote). The old PAL 2.0.6 actually works if I edit the CSV file and remove the extra stuff. But it's good that you modified the code to compensate for this.

Coordinator
Jan 26, 2011 at 8:29 PM

Exactly right, cam_s. I found it very odd that the comment was in the same row as the counter names. The fix I added was to check each counter name to make sure it is in the correct format.