Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Deployment Manager: Unable to cast object of type 'System.DBNull' to type 'System.String'

Posted on by 210

Hello. I am administering a CRM 4.0 server. I have been experiencing issues accessing the Deployment Manager where I have run into errors. Initially, I could not access the Deployment Manager since I was not recognized as a Deployment Administrator. So in SQL Server I ran the following query to return the Deployment Administrators: 

SELECT s.securityRoleid, s.systemuserid,u.name FROM dbo.SystemUserRoles s, SystemUser u WHERE s.systemuserid=u.id

and got the below output:

securityRoleid  systemuserid name
19CFBC8D-77ED-459E-9909-1BF1CC1B0430 D6A7A6EC-2D99-E711-AA9C-000C29FAA355 mydomain\someuser1
19CFBC8D-77ED-459E-9909-1BF1CC1B0430 1F421E02-209D-E711-B436-000C29FAA355 mydomain\someuser2
19CFBC8D-77ED-459E-9909-1BF1CC1B0430 BB84832F-23F5-E711-B6E4-000C29FAA355 NULL

Both of these users are no longer part of my organisation. So after activating the user account in Active Directory, I tried logging into the CRM 4.0 server using someuser1 then opened Deployment Manager. However, I experienced the following error message (also experienced the same issue with someuser2): 

FX:{1ac9de3e-24ae-480d-9e15-65386b76e433}

Unable to cast object of type 'System.DBNull' to type 'System.String'.

Exception type:
System.InvalidCastException

Exception stack trace:
at Microsoft.Crm.Admin.AdminService.ConfigDBSecurity.SystemUserData.get_Name()
at Microsoft.Crm.Tools.Admin.SystemUserNode..ctor(SystemUserData systemUserData)
at Microsoft.Crm.Tools.Admin.SystemUserListView.OnBuildSubNodes()
at Microsoft.Crm.Tools.Admin.SystemUserListView.OnInitialize(AsyncStatus status)
at Microsoft.ManagementConsole.View.ProcessRequest(Request request)
at Microsoft.ManagementConsole.ViewMessageClient.ProcessRequest(Request request)
at Microsoft.ManagementConsole.Internal.IMessageClient.ProcessRequest(Request request)
at Microsoft.ManagementConsole.Executive.RequestStatus.BeginRequest(IMessageClient messageClient, RequestInfo requestInfo)
at Microsoft.ManagementConsole.Executive.SnapInRequestOperation.ProcessRequest()
at Microsoft.ManagementConsole.Executive.Operation.OnThreadTransfer(SimpleOperationCallback callback)

This post indicates a solution to the above problem which occurs where a user in the system does not have a firstname or lastname. I checked the two Deployment Administrators (someuser1 and someuser2) in Users in the CRM 4.0 web interface, but both their firstname and lastname are filled. Is there another place where this needs to be filled in? I also noticed that the third user from the above SQL output has a name field in the database that is NULL. Could this be the cause of the problem?


  

  • Suggested answer
    synthesis Profile Picture
    synthesis 210 on at
    RE: Deployment Manager: Unable to cast object of type 'System.DBNull' to type 'System.String'

    The posts that I came across mention that the cause of the error was a user with a blank firstname/lastname. This was not the case with my situation where after searching for a blank firstname/lastname, I did not find any matching users.

    I ended up finding out the cause of the error, which was the row containing NULL which appeared in the third row in my original post. The problem was that the SystemUserRoles table contained a row, which did not have a corresponding row in the SystemUser table. After deleting this row with the below SQL query, I was able to access Deployment Manager without experiencing the error:

    DELETE FROM dbo.SystemUserRoles WHERE SystemUserId='BB84832F-23F5-E711-B6E4-000C29FAA355';

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Deployment Manager: Unable to cast object of type 'System.DBNull' to type 'System.String'

    Hi partner,

    This error may be caused by some user without a firstname or lastname.

    Here is a similar thread for you.

    community.dynamics.com/.../393492

    Best Regards,

    Leo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans