Thursday, 31 July 2008

"Invalid Domain Name" error when registering plug-ins

On a couple of occasions recently I've had an error "Invalid domain name. Domain name is either invalid or unreachable" when registering a plug-in with the RegisterSolutionRequest.

It looks to me like this is a spurious message, possibly caused by a timeout. My reasons for thinking this are:
- I get the message on a VPC image which is the CRM server, SQL server and domain controller. If the domain was really unreachable, that would mean AD or DNS were not working and I'd expect other problems.
- The message does not always occur. Registering exactly the same solution and steps normally works fine. It's not a persistent error.
- It only occurs for me when registering a large number of steps, which again is consistent with it being a timeout issue.

So, my general recommendation if getting this error is to try again, possibly registering fewer steps at a time. If I find out any moe on this, I'll post it here.

Update - 4 Aug 08
It seems an alternative reason for this error is if the RegisterSolutionRequest (or similar request) is submitted by code that is running as one of the built-in accounts - e.g. NetworkService. I could image how this occurs, as these accounts are identified as e.g. NT AUTHORITY\NetworkService, and the platform code may be looking for a domain called 'NT AUTHORITY'.

Only members of the Deployment Administrators role can register plug-ins, and it appears that CRM only allows user accounts to be added to this role (the dialog for adding users does give the option to add built-in security principals). Therefore it looks like it's not possible to register plug-ins via one of the built-in accounts - an example of this would be via code that itself is running in a plug-in

2 comments:

Anonymous said...

Hi David,

I got the same error when I was trying to register a pluginstep using the Microsoft.Crm.Sdk namespace. The error message in the user interface showed an "Invalid Argument" error, but the log file had the same error message you have reported.

As I attempted to create a pluginstep from within a plugin, the error could be generated because the code was executing under the identity of the network service acccount, which is not a member of the domain ordinary CRM users are in.

Apparently, Microsoft did not design plugins to be registered by plugins.

Best regards,

Henk van Boeijen
Lead software developer
CRM Partners - the Netherlands

David Jennaway said...

Henk

Thanks for the comment. I've had a look at this, and updated the post accordingly (see update 4 Aug 08)

David