OpsMgr 2007 solution: Console Exception in the UNIX/Linux Servers view–"Value cannot be null"


toolsignI recently worked on this issue and since I didn’t see the resulting solution published I thought it would be worth a mention here.

Symptoms

In this scenario, the Operations Manager 2007 R2 Cross Platform Agent with Cumulative Update 2 had been deployed to several Redhat Enterprise Linux servers.  Following the deployment, while checking the Health of the servers through the UNIX/Linux Servers view in the Administration Pane of the console the following error was received:

Value cannot be null
Parameter name: key

The following information was gathered when the operation was attempted.  The information may appear cryptic but provides context for the error.  The application will continue to run:

System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at Microsoft.SystemCenter.CrossPlatform.UI.Common.UnixComputerOperatingSystemHelper.JoinCollections(ReadOnlyCollection`1 managementServers, ReadOnlyCollection`1 unixcomputers, ReadOnlyCollection`1 operatingSystems)
   at Microsoft.SystemCenter.CrossPlatform.UI.Common.UnixComputerOperatingSystemHelper.GetUnixComputerOperatingSystemInstances(String criteria)
   at Microsoft.SystemCenter.CrossPlatform.UI.Administration.UnixAgentQuery.DoQuery(String criteria)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.DoQuery(String criteria, Nullable`1 lastModified)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.FullUpdateQuery(CacheSession session, IndexTable& indexTable, Boolean forceUpdate, DateTime queryTime)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalSyncQuery(CacheSession session, IndexTable indexTable, UpdateReason reason, UpdateType updateType)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalQuery(CacheSession session, UpdateReason reason)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.TryDoQuery(UpdateReason reason, CacheSession session)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.DoQueryJob(Object sender, ConsoleJobEventArgs args)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)

Cause

This was ultimately due to a NULL value for one of the objects in the related tables. 

Resolution

To begin with, the object with the NULL value must be identified.  The following SQL statement should return a list of objects from which you can parse for a NULL value in one of the fields.  The NULL value may correspond with a machine name Windows.Computer.

Please execute this query against the Root Management server (RMS) and any Management Severs (MS) servers until you find the offending NULL entry.  Simply replace the ‘fqdn.of.managementserver’ as noted below with the correct name:

SELECT [T].[Id], [T].[Name], [T].[Path], [T].[FullName], [T].[DisplayName], [T].[IsManaged], [T].[IsDeleted],
[T].[LastModified], [T].[TypedManagedEntityId], [T].[MonitoringClassId], [T].[TypedMonitoringObjectIsDeleted],
[T].[HealthState], [T].[StateLastModified], [T].[IsAvailable], [T].[AvailabilityLastModified], [T].[InMaintenanceMode],
[T].[MaintenanceModeLastModified], [PXH].[BaseManagedEntityId] AS [HealthServiceId],
[PXH].[DisplayName] AS [ProxyAgentPrincipalName] FROM dbo.ManagedEntityGenericView AS T
INNER JOIN dbo.ManagedType AS MT 
    ON MT.[BaseManagedTypeId] = ‘B4A14FFD-52C8-064F-C936-67616C245B35’
INNER JOIN dbo.BaseManagedEntity AS BME 
    ON
            BME.[BaseManagedEntityId] = T.[Id]
            AND BME.[BaseManagedTypeId] = MT.[ManagedTypeId]      
INNER JOIN dbo.Relationship AS R 
    ON R.[TargetEntityId] = T.[Id]
INNER JOIN dbo.BaseManagedEntity AS PXH 
    ON PXH.[BaseManagedEntityId] = R.[SourceEntityId]
WHERE ((
            T.[IsDeleted] = 0 AND T.[TypedMonitoringObjectIsDeleted] = 0 AND R.[IsDeleted] = 0 AND
            R.[RelationshipTypeId] = dbo.fn_ManagedTypeId_MicrosoftSystemCenterHealthServiceShouldManageEntity()
          ) AND (‘fqdn.of.managementserver’ = PXH.[DisplayName]))

In order to resolve the issue completely and in a supported manner, it was important to leverage the same underlying process by which an Agent is removed as that used by the Console when deleting an agent.  As a result, the following stored procedure was executed against the Operations Manager database using the GUID identified in the initial query above which contained the NULL value.

Cleanup process:

DECLARE @EntityId uniqueidentifier;
DECLARE @TimeGenerated datetime;

— change “GUID” to the ID of the invalid entity
SET @EntityId = ‘GUID’;
SET @TimeGenerated = getutcdate();

BEGIN TRANSACTION

EXEC dbo.p_TypedManagedEntityDelete @EntityId, @TimeGenerated;

COMMIT TRANSACTION

Hope this helps,

Nicholas Dodge | Senior Support Escalation Engineer

The App-V Team blog: http://blogs.technet.com/appv/
The WSUS Support Team blog: http://blogs.technet.com/sus/
The SCMDM Support Team blog: http://blogs.technet.com/mdm/
The ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
The SCOM 2007 Support Team blog: http://blogs.technet.com/operationsmgr/
The SCVMM Team blog: http://blogs.technet.com/scvmm/
The MED-V Team blog: http://blogs.technet.com/medv/
The DPM Team blog: http://blogs.technet.com/dpm/
The OOB Support Team blog: http://blogs.technet.com/oob/
The Opalis Team blog: http://blogs.technet.com/opalis

clip_image001 clip_image002

Comments (2)

  1. Bogdan Vosnjak says:

    Just came across this issue at the customer. Solution worked like a charm. Thanks a million!

  2. show box says:

    Thanks for the great info. I really loved this. I would like to apprentice at the same time as you amend your web site, how could i subscribe for a blog site?
    For more info on showbox please refer below sites:
    http://showboxandroids.com/showbox-apk/
    http://showboxappandroid.com/
    Latest version of Showbox App download for all android smart phones and tablets.
    http://movieboxappdownloads.com/ – It’s just 2 MB file you can easily get it on your android device without much trouble. Showbox app was well designed application for android to watch movies and TV shows, Cartoons and many more such things on your smartphone.
    For showbox on iOS (iPhone/iPad), please read below articles:
    http://showboxappk.com/showbox-for-ipad-download/
    http://showboxappk.com/showbox-for-iphone/
    Showbox for PC articles:
    http://showboxandroids.com/showbox-for-pc/
    http://showboxappandroid.com/showbox-for-pc-download/
    http://showboxforpcs.com/
    There are countless for PC clients as it is essentially easy to understand, simple to introduce, gives continuous administration, effectively reasonable. it is accessible at completely free of expense i.e., there will be no establishment charges and after establishment
    it doesn’t charge cash for watching films and recordings.
    http://www.showboxforipad.org/showbox-apk/ Not simply watching, it likewise offers alternative to download recordings and motion pictures. The accompanying are the strides that are to be taken after to introduce Showbox application on Android. The above
    all else thing to be done is, go to the Security Settings on your Android telephone, Scroll down and tap on ‘Obscure sources’.
    http://www.showboxforipad.org/
    http://movieboxappdownloads.com/moviebox-apk-android/
    http://movieboxappdownloads.com/download-moviebox-pc/
    Movie Box, an esteemed movies application in which you can find stacks of programs and films. The guide is given here to download Movie Box app to Android and to Apple iOS 9.0.2, iOS 8.4/8.3 and also for the lower versions without Jailbreak.
    http://showboxforiphone.org/
    Please do login to Showbox application with the help of Ymail. You can login in Ymail from here –
    http://ymaillogintips.com/
    Sign Up & Do registration for latest movies on Showbox application