locked
Import Organization Fails RRS feed

  • Question

  • Getting the following error when trying to import an organization into CRM 4.0

    I've tried with Rollup 1 and Rollup 2.
    I have already maxed out the OLEDBTimeout(86400)  and ExtendedTimeout(1000000) Registry entries

    I've already enabled CRM Platform tracing and it doesn't provide any more information.  It is occuring when trying to publish reports after mapping the users

    Its pretty obvious its closing the connection but how/where and how do I fix????

    PublishReportsFromDatabase: Creating report in Reporting Services.  ReportId: {037829b7-6878-dd11-ba0e-000c29e252b8}, Name: Account Distribution
    Import Organization (Name=OrgName, Id=4d71c66d-e5f6-dd11-8b85-0050568a0d71) failed with Exception:
    System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
       at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
       at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
       at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
       at Microsoft.Crm.CrmDbConnection.SetTransactionIsolationLevel(IsolationLevel il)
       at Microsoft.Crm.CrmTransaction.RollbackTransaction(Boolean raiseException)
       at Microsoft.Crm.SqlExecutionContext.OnErrorRequest()
       at Microsoft.Crm.BusinessEntities.ExecutionContext.OnErrorRequest()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy), ErrorCode: -2147176447, InnerException: System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
       at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
       at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
       at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
       at Microsoft.Crm.CrmDbConnection.SetTransactionIsolationLevel(IsolationLevel il)
       at Microsoft.Crm.CrmTransaction.RollbackTransaction(Boolean raiseException)
       at Microsoft.Crm.SqlExecutionContext.OnErrorRequest()
       at Microsoft.Crm.BusinessEntities.ExecutionContext.OnErrorRequest()
       at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)

    Please help!

    Monday, February 9, 2009 10:57 PM

Answers

  • This was the line in my log file just before the Error.
    18:32:38|   Info| PublishReportsFromDatabase: Creating report in Reporting Services.  ReportId: {e9c074ee-297b-de11-b6f5-005056ae24fb}, Name: Case Summary Table

    To remove the reports from the database, delete them from the ReportBase table.
    Due to parent/child constraints, you will have to remove any child reports, so my SQL looked like this:


    --check report exists
    select * from reportbase where ReportId='e9c074ee-297b-de11-b6f5-005056ae24fb'
    --get any child reportIDs
    select reportid from reportbase where parentReportId='e9c074ee-297b-de11-b6f5-005056ae24fb'
    --delete first the child, then the main report
    delete from reportbase where ReportId='9A6BDB17-2A7B-DE11-B6F5-005056AE24FB'
    delete from reportbase where ReportId='e9c074ee-297b-de11-b6f5-005056ae24fb'
    Wednesday, January 13, 2010 8:35 AM
  • Did you backup and restore encryption keys on reporting DB and restore both reporting DB and ReportingDBTemp?

    I just went through a migration  from 1 domain to another and had issues with reports.

    I ended up removing encryption and recreating I think.  Got a warning about losing encrypted content but didn't think that mattered in my situation.
    • Proposed as answer by Jim Glass Jr Tuesday, February 24, 2009 10:10 PM
    • Marked as answer by Matt Parks Wednesday, May 6, 2009 10:22 PM
    Monday, February 9, 2009 11:24 PM

All replies

  • Did you backup and restore encryption keys on reporting DB and restore both reporting DB and ReportingDBTemp?

    I just went through a migration  from 1 domain to another and had issues with reports.

    I ended up removing encryption and recreating I think.  Got a warning about losing encrypted content but didn't think that mattered in my situation.
    • Proposed as answer by Jim Glass Jr Tuesday, February 24, 2009 10:10 PM
    • Marked as answer by Matt Parks Wednesday, May 6, 2009 10:22 PM
    Monday, February 9, 2009 11:24 PM
  • Wes,
    Did you end up getting this resolved?  I'm having the same problem and am not finding much information on this issue anywhere.
    Wednesday, February 18, 2009 9:44 PM
  • I'm having the same problem here:

    12:24:56|Verbose| Method exit: Microsoft.Crm.Tools.EDW.Framework.EDWToolCallbacks.Clear
    12:24:59|   Info| Import Organization (SelfNet)
    12:24:59|   Info| Organisatie bijwerken...
    12:25:12|   Info| Gebruikers bijwerken...
    12:25:15|  Error| Het importeren van de organisatie (naam=SelfNet, id=808a257b-ba3b-de11-962d-000c295b3233) is mislukt. Uitzonderingsfout:
    System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

    I updated the 2 values in the registry from 30 sec timeout to 9999 but still no luck. Any ideas?

    thanks
    it's all very nice when it works
    Friday, May 8, 2009 10:28 AM
  • I appreciate this is a slightly old post to reply to, but I had exactly this problem and could find no solution on other posts that looked similar.  With the help of MS Support I have fixed my issue!  The problem related to a custom report that had been added to the system.  This report used a non standard data source and was causing SQL Server to timeout during the import.  To clarify I had the following info:

    Error in crm40dmsnapin log file:

    11:30:02|  Error| Import Organization (Name=KMS, Id=fa961c58-2866-de11-b828-00155d01010f) failed with Exception:
    System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

    Error in CRM Trace log file:

    >Crm Exception: Message: The data source 'MS Dynamics CRM' cannot be found., ErrorCode: -2147187968, InnerException:    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

    Looking at the log file I believed the reports had finished importing, however going back to the lines before the error occurred I could see that a particular report was being imported at the time.

    I was in a rush, so rather than fix the report, I just removed it and the subsequent import worked a treat!

    Just for further info, I had already set OLEDBTimout plus ExtendedTimout registry entries to try and address the problem with no success.  So no guarantees that they weren't also an issue!


    Stuart
    Wednesday, July 1, 2009 3:03 PM
  • Since yesterday our problem is solved here, it was a corrupt index in the asyncoperationbase table that caused some SQL Server issues that were thrown up. The error message was not the one it should be.

    With the help of a Microsoft dynamics and sql server support engineer, we traced this problem with some tools because the CrmDiagTurboTool could only give information about CRM errors and the SQL Server trace didn't caught the error.

    After found this error, we recreated the corrupt index by deleting and recreating it. After that everything went smoothly.

    So something new to try when you cannot import is to do a rebuild of all the indexes in the yourorganisation_MSCRM database on the source server before you take a backup and restore it to the new server.


    it's all very nice when it works
    Wednesday, July 1, 2009 3:21 PM

  • [...]I was in a rush, so rather than fix the report, I just removed it and the subsequent import worked a treat![...]


    Stuart

    How did you manage to remove theses reports ? I don't know how to do this without having my crm imported.
    Thanks.
    Tuesday, August 25, 2009 9:06 AM
  • This was the line in my log file just before the Error.
    18:32:38|   Info| PublishReportsFromDatabase: Creating report in Reporting Services.  ReportId: {e9c074ee-297b-de11-b6f5-005056ae24fb}, Name: Case Summary Table

    To remove the reports from the database, delete them from the ReportBase table.
    Due to parent/child constraints, you will have to remove any child reports, so my SQL looked like this:


    --check report exists
    select * from reportbase where ReportId='e9c074ee-297b-de11-b6f5-005056ae24fb'
    --get any child reportIDs
    select reportid from reportbase where parentReportId='e9c074ee-297b-de11-b6f5-005056ae24fb'
    --delete first the child, then the main report
    delete from reportbase where ReportId='9A6BDB17-2A7B-DE11-B6F5-005056AE24FB'
    delete from reportbase where ReportId='e9c074ee-297b-de11-b6f5-005056ae24fb'
    Wednesday, January 13, 2010 8:35 AM
  • This is one cause of issue.
    This error occure due to various reasons. Some are:
                  1) Problem with custom Report
                  2) Timeout while connecting SQL Server
                  3) Timeout while updating AD

    Error is not very clear. You need to check log file and decide action points.

    One good article on it is:
    http://www.mskbarticles.com/index.php?kb=2003564

    Hope it would solve your problem.

    Shubh
    Tuesday, February 16, 2010 4:19 PM
  • Got the same problem. Thanx grant050 Users MedalsUsers MedalsUsers MedalsUsers Medals, removing that report from database helps

    Thursday, February 10, 2011 10:07 AM