Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Problem in dev environment restoring a database

$
0
0

We recently restored a test CRM Organization's database using SQL Server Management Studio.  We are using SQL Server 2014 and Dynamics CRM 2015 On Premises.  Upon trying to login, we received an error message: "An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support."

Before I go any further, let me detail the steps that were taken that lead up to this situation.

1.  I started with an existing development organization called Org1.  All that was in this database was some customizations and user accounts drawn from our domain.  Everything working normally.  In case it matters, Org1 was created from a backup of another organization, Org0.

2.  In SQL Server, I backed up Org1_MSCRM database.  I did not disable Org1 before making the backup in case that matters.

3.  In SQL Server, I restored the backup of Org1_MSCRM to Org2_MSCRM.  Org2_MSCRM did not exist prior to the restore operation, I simply specified it as the target in the restore database dialogue.  SQL Server restored Org1_MSCRM backup to Org2_MSCRM and attached the database automatically.  There was no indication of problems.

4.  In the Dynamics server, I used CRM Deployment Manager to import Org2 as an organization in our CRM instance.  I selected automatic mapping of users.  This succeeded.

5.  Next, I went to our domain controller / dns server and added a zone file for Org2.ourdomain.com and added the needed A record.

6.  I logged in to our Web Application Proxy server, and published Org2.ourdomain.com as a web application.

7.  I logged into our Active Directory Federation Services server, and manually updated Federation meta data by opening ADFS Management, right clicking on the Internet Facing Deployment entry for our CRM server, and choosing Updated Federation Meta Data.  My newly imported Org2.ourdomain.com was listed as part of the newly updated meta data.

8.  When I try to login as the domain administrator, or any other user in Org2, I get the error message listed above.  So far this is only happening when restoring this particular backup.

Event Viewer on the CRM server is registering an ASP.NET error that coincides with a failed login into Org2.  The Event ID is 1309, the Event Code is 3005.  Basically it's an unhandled exception error, and the exception message states: "The user for which we are checking a privilege should be in the same org as the context provided"

I am wondering if I am doing something wrong in the backup step that's corrupting the database, but I really don't know.  Has anyone seen this error and know what's going on?  Ideally, I'd like to know what to do to prevent this problem but, barring that, finding a fix the problem after it occurs would help.  As it is, I can't trust our backup tool.  I have attached the full Event Viewer log entry below:

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 1/28/2016 2:06:41 PM
Event time (UTC): 1/28/2016 8:06:41 PM
Event ID: 96fe1bece03b426fa9012295a8de9c62
Event sequence: 363
Event occurrence: 6
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-130984818056918575
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\Program Files\Microsoft Dynamics CRM\CRMWeb\
    Machine name: CRMSRV
 
Process information:
    Process ID: 4064
    Process name: w3wp.exe
    Account name: OURDOMAIN\CRMAPPSERVICEACCOUNT
 
Exception information:
    Exception type: CrmException
    Exception message: The user for which we are checking a privilege should be in the same org as the context provided
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveMultipleCommand.Execute()
   at Microsoft.Crm.Application.Caching.CustomResourceLoader.GetCustomResources(IOrganizationContext context, Int32 cacheKey)
   at Microsoft.Crm.Application.Caching.CustomResourceLoader.LoadCacheData(Int32 key, IOrganizationContext context)
   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.CustomResourceManager.TryGetCultureString(String name, CultureInfo culture, Boolean getSystemString, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.CustomResourceManager.TryGetCultureString(String name, CultureInfo culture, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.BasicResourceManager.GetCultureString(String name, CultureInfo culture, IOrganizationContext context)
   at Microsoft.Crm.Controls.Header..ctor(Boolean isControlHeader)
   at Microsoft.Crm.Controls.BasicHeader..ctor()
   at Microsoft.Crm.Application.Controls.AppHeader..ctor()
   at ASP.default_aspx.__BuildControlcrmHeader()
   at ASP.default_aspx.__BuildControlTree(default_aspx __ctrl)
   at ASP.default_aspx.FrameworkInitialize()
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 
 
Request information:
    Request URL: org2.ourdomain.com/default.aspx
    Request path: /default.aspx
    User host address: <local ip address of ADFS server>
    User: OURDOMAIN\user.account
    Is authenticated: True
    Authentication Type: Federation
    Thread account name: OURDOMAIN\CRMAPPSERVICEACCOUNT
 
Thread information:
    Thread ID: 84
    Thread account name: OURDOMAIN\CRMAPPSERVICEACCOUNT
    Is impersonating: True
    Stack trace:    at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveMultipleCommand.Execute()
   at Microsoft.Crm.Application.Caching.CustomResourceLoader.GetCustomResources(IOrganizationContext context, Int32 cacheKey)
   at Microsoft.Crm.Application.Caching.CustomResourceLoader.LoadCacheData(Int32 key, IOrganizationContext context)
   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.CustomResourceManager.TryGetCultureString(String name, CultureInfo culture, Boolean getSystemString, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.CustomResourceManager.TryGetCultureString(String name, CultureInfo culture, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.BasicResourceManager.GetCultureString(String name, CultureInfo culture, IOrganizationContext context)
   at Microsoft.Crm.Controls.Header..ctor(Boolean isControlHeader)
   at Microsoft.Crm.Controls.BasicHeader..ctor()
   at Microsoft.Crm.Application.Controls.AppHeader..ctor()
   at ASP.default_aspx.__BuildControlcrmHeader()
   at ASP.default_aspx.__BuildControlTree(default_aspx __ctrl)
   at ASP.default_aspx.FrameworkInitialize()
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
 
Custom event details:


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>