Repository navigation
Missing properties #32
Description
Edit: I would like to add, this could very well be user error, so please point it out if so!
Thanks so much for writing and sharing this!! Found that installing via Chef cookbook just wouldn't do anything (2008R2), so tried the manual version here to troubleshoot. (2012R2)
When I first tried to run the startup script on 2008R2:
PS C:\Windows\system32> Import-Module graphite-powershell
Import-Module : The 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\graphite-powershell\graphite-powershell.psd1' m
odule cannot be imported because its manifest contains one or more members that are not valid. The valid manifest membe
rs are ('ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description
', 'PowerShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'Process
orArchitecture', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredA
ssemblies', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport').
Remove the members that are not valid ('RootModule'), then try to import the module again.
At line:1 char:14
+ Import-Module <<<< graphite-powershell
+ CategoryInfo : InvalidData: (C:\Windows\syst...powershell.psd1:String) [Import-Module], InvalidOperatio
nException
+ FullyQualifiedErrorId : Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.ImportModuleCommandGoogling gave me a fix:
# This is the PSD1 file...
# Script module or binary module file associated with this manifest.
OLD: RootModule = 'Graphite-Powershell.psm1'
NEW: ModuleToProcess = 'Graphite-Powershell.psm1'Now that it's actually running...I get a bunch of these:
PS C:\GraphitePowershellFunctions> start-statstographite -verbose
The property 'NodeHostName' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\graphite-powershell\Functions\Internal.ps1:40 char:5
+ $Config.NodeHostName = $xmlfile.Configuration.Graphite.NodeHostName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict<snip, a lot of these>
The property 'SendUsingUDP' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\graphite-powershell\Functions\Internal.ps1:52 char:5
+ [bool]$Config.SendUsingUDP = [System.Convert]::ToBoolean($xmlfile.Configurat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
The property 'MSSQLMetics' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\graphite-powershell\Functions\Internal.ps1:93 char:5
+ $Config.MSSQLMetricPath = $xmlfile.Configuration.MSSQLMetics.MetricPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict<snip, a lot of these>
I found the first one is resolved by modifying the config XML:
OLD: $env:COMPUTERNAME
NEW: $env:COMPUTERNAME
The 2nd (IIRC) was resolved by adding in the 'SendUsingUDP' config option.
The 3rd is clearly a typo: 'MSSQLMetics'.
After finally getting it started and letting it run for a while, started getting these: (snipped)
The property 'MSSQLMetics' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\graphite-powershell\Functions\Internal.ps1:96 char:5
+ [int]$Config.MSSQLConnectTimeout = $xmlfile.Configuration.MSSQLMetics.SQLCon ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
The property 'MSSQLMetics' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\graphite-powershell\Functions\Internal.ps1:97 char:5
+ [int]$Config.MSSQLQueryTimeout = $xmlfile.Configuration.MSSQLMetics.SQLQuery ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
The property 'MSSQLMetics' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\graphite-powershell\Functions\Internal.ps1:102 char:28
+ foreach ($sqlServer in $xmlfile.Configuration.MSSQLMetics.SQLServers.SQLServ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrictAgain, looks like something from the XML file. Interestingly, your main readme has a similar typo: MSSQLMetics Configuration Section
I think I can get it working enough for my purposes (guessing this is just a case of missing stuff from the config file - even though you'd think it wasn't required), just thought I'd let you know it was slightly broken.
Activity
christrotter commentedon Dec 3, 2014
Yup, added this to my config XML and the last errors are gone.
I was then getting errors like this:
I simply modified that write-output (SQLmetrics section) from $samplePath to $sample. Seems less angry.
One last issue now:
This is all due to the start script not ignoring the fact that I am not using SQL metrics. If it could just ignore that...most of this would be a moot point. Hope this helps clear it up!
MattHodge commentedon Dec 5, 2014
Thanks for the detailed post @christrotter .. I will try and handle this a little better in the code.
christrotter commentedon Dec 5, 2014
I don't recall the documentation mentioning this, and I'll post this over in the Chef cookbook page as well, but the service install is dependent on two things:
In retrospect, it seems clear that the Chef cookbook is solely designed to simplify the service installation, and not function as a complete package.
Function will not throw error if a user decides to delete the <MSSQLM…
MattHodge commentedon Feb 25, 2015
Fixed in Graphite-PowerShell v1.2.1.
Thanks for reporting the issue!
MattHodge commentedon Feb 25, 2015
v1.2.1 had a bug, please grab Graphite-PowerShell v1.2.2 instead.
ghostsquad commentedon Mar 7, 2015
this fix will mask configuration errors. You should just CHECK if the mysql section exists, and if it does, pull in the configurations. I don't think this should be wrapped in a try/catch at all.