I’ve started to keep track of the weird errors that I encounter when authoring management packs in Visual Studio.



Severity Code Description Project File Line Suppression State
Error The “PackageToBundle” task failed unexpectedly.
Microsoft.Deployment.WindowsInstaller.BadQuerySyntaxException: SQL query syntax invalid or unsupported.
at Microsoft.Deployment.WindowsInstaller.Database.OpenView(String sqlFormat, Object[] args)
at Microsoft.EnterpriseManagement.Packaging.DataAccess.Insert(String query, Object[] args)
at Microsoft.EnterpriseManagement.Packaging.ConstructorTaskAddFeatures.PublishFeature(String parentFeature, Guid guid, List1 usedFeatures) at Microsoft.EnterpriseManagement.Packaging.ConstructorTaskAddFeatures.RunTask() at Microsoft.EnterpriseManagement.Packaging.ConstructorEngine.Build(IList1 managementPacks, IDictionary`2 resources)
at Microsoft.EnterpriseManagement.Packaging.ManagementPackMsiBundleWriter.Write(ManagementPackBundle package, String bundleName)
at Microsoft.SystemCenter.Authoring.Build.PackageToBundle.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() M365.Supplemental.License.SkuNames.Addendum C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets 316


This was caused by using a single quote ‘ in a DisplayString Description field. Double quote seems to be just fine. Single quote causes the build to puke.




Severity        Code        Description        Project        File        Line        Suppression State
Error                The configuration specified for Module DS is not valid.
: Incorrect expression specified: $Target/Host/Host/Host/Property[Name=”VDS.RadiantLogic.7x.ServerRole”]/ConfigPath. Unable to resolve this expression. Check the expression for errors. (Hints:  Check for correct character casing (upper case/lower case), mismatched “$” signs, double quotes(“), square brackets “[” or “]”). Here is a sample expression: $Target/Host/Property[Type=”Windows!Microsoft.Windows.Computer”]/NetworkName$
   (Path = ADI.RadiantLogic.7x.Datasource.DB.SQL.Discovery/DS)        ADI.RadiantLogic.7x        C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets        283


This can happen if you used an MPElement expression instead of a Target expression (‘Name’ vs ‘Type’). The expression is not recognized as a proper expression path. The context will determine which one is appropriate.
Example 1: $Target/Host/Host/Host/Property[Name=”VDS.RadiantLogic.7x.ServerRole”]/ConfigPath
Example 2: $Target/Host/Host/Host/Property[Type=”VDS.RadiantLogic.7x.ServerRole”]/ConfigPath$




System.AdminItem.Library
 
Severity        Code        Description        Project        File        Line        Suppression State
Error                Verification of Monitor Configuration with MonitorType schema for Monitor SQLJobLevelAlerting.SQL20XXAgentJobLastRunState.Monitor failed.
: Could not load management pack [ID=System.AdminItem.Library, KeyToken=31bf3856ad364e35, Version=7.5.8500.0]. The management pack was not found in the store.
An object of class ManagementPack with name System.AdminItem.Library was not found.   (Path = SQLJobLevelAlerting.SQL20XXAgentJobLastRunState.Monitor)        SQLJobLevelAlerting        HealthModel\Monitors.mptg.mpx        6        
Error                The AlertParameter value specified is not valid: $Target/Host/Host/Property[Type=”MSQLWD!Microsoft.SQLServer.Windows.DBEngine”]/NetworkName$.
: Could not load management pack [ID=System.AdminItem.Library, KeyToken=31bf3856ad364e35, Version=7.5.8500.0]. The management pack was not found in the store.
An object of class ManagementPack with name System.AdminItem.Library was not found.   (Path = SQLJobLevelAlerting.SQL20XXAgentJobLastRunState.Monitor)        SQLJobLevelAlerting        HealthModel\Monitors.mptg.mpx        6

This typically happens when you’ve screwed up the path of a variable. Perhaps too many “Host/” or wrong class referenced for the property.
Example: $Target/Host/Host/Property[Type=”MSQLWD!Microsoft.SQLServer.Windows.DBEngine”]/NetworkName$




Severity        Code        Description        Project        File        Line        Suppression State
Error                Detected malicious verification code when verifying element of type Microsoft.EnterpriseManagement.Configuration.ManagementPackProbeActionModuleType with inner exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.EnterpriseManagement.Configuration.Verification.VerifyOverrideableParameter.Verify(SchemaHelper helper, ManagementPackConfigurationSchemaType schema, IList`1 overrideableparams)
   at Microsoft.EnterpriseManagement.Configuration.ManagementPackModuleType.Verify(VerificationContext context)
   at Microsoft.EnterpriseManagement.Configuration.Verification.VerificationEngine.VerifyCollectionItems(Object context)   (Path = AgentPerformancePlus)        AgentPerformancePlus        Kevin’s\SCOM.Management.10.19.10349.0_CUSTOM.mpx        3985


This typically happens when you’ve screwed up the spelling of a parameter OR forgot a dollar $ on a parameter.
Example:

Leave a Reply

Your email address will not be published. Required fields are marked *