Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Sunday, July 3, 2011

CRM error when opening a form due to invalid role

One of my clients was running into a particularly nasty issue earlier this week. They were unable to open any kinds of forms related to contacts, opportunities, or accounts. Trying to do so gave a generic error - it wouldn't even start to open.

After some investigation, it turns out they had deleted a role which had been assigned access to several forms. For whatever reason, CRM did not clean this up, and it left a bad reference in the customizations. This led to an odd error; anyone who had access to the form was able to open their forms without issue. Anyone who did *not* have access to the form would be given a generic error when opening any other form for the same entity. Unfortunately, attempting to reassign the security for the form or import a copy with the role stripped out generates errors - it appears that we have a circular error!

Luckily there is still a way to fix this. Simply perform the following:
  1. Open up the form with the bad assignment and save a copy.
  2. On the copy, set up assignment as normal.
  3. Delete the old form.
  4. Rename the copied form to be the same as the old form.
This will forcibly remove all references to the bad role, and allow users access to the system again! Note that if a dev/QA system is in place, the next push to the live server will create another copy of the form due to a GUID mismatch. In this case, be sure to delete the correct form.

Friday, February 25, 2011

Error Accessing CRM 2011 Online Plugin-Registration Tool

This can be a frustrating error when trying to access CRM 2011 Online via the plugin registration tool:


Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

Server stack trace:
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message)
   at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)
   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateLiveIdInternal(ClientCredentials clientCredentials, SecurityTokenResponse deviceToken, String keyType)
   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateDevice(ClientCredentials clientCredentials)
   at Microsoft.Xrm.Sdk.Client.DiscoveryServiceConfiguration.AuthenticateDevice(ClientCredentials clientCredentials)
   at PluginRegistrationTool.CrmConnection.get_DiscoveryService() in C:\Projects\CRM 2011 SDK\sdk\tools\pluginregistration\CrmConnection.cs:line 272
   at PluginRegistrationTool.CrmConnection.RetrieveOrganizations() in C:\Projects\CRM 2011 SDK\sdk\tools\pluginregistration\CrmConnection.cs:line 367
   at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con) in C:\Projects\CRM 2011 SDK\sdk\tools\pluginregistration\ConnectionsForm.cs:line 940
Inner Exception: System.ServiceModel.FaultException: Invalid Request

Luckily, there is a pretty simple fix. Open up your %userprofile%\LiveDeviceID\ folder, and delete LiveDevice.xml (back it up in case something goes wrong!).

Restart the plugin registration tool, and it should now connect properly!