CRM2011 – Sql Timeout during the export solution

Another day, another problem to resolve: Last Friday I tried to export a solution as usual but after several minutes I did not have my solution package. I opened the CRM Server and I started to check the Event Viewer. Inside the EventViewer I had this error:

RequestUrl: d2devcrm02/…/dlg_exportsolution.aspx;command=exportsolution&ismanaged=0&optionxml=%3csettings%3e%3cexportAutoNumber%3efalse%3c%2fexportAutoNumber%3e%3cexportCalendar%3efalse%3c%2fexportCalendar%3e%3cexportCustomization%3efalse%3c%2fexportCustomization%3e%3cexportEmailTracking%3efalse%3c%2fexportEmailTracking%3e%3cexportGeneral%3efalse%3c%2fexportGeneral%3e%3cexportMarketing%3efalse%3c%2fexportMarketing%3e%3cexportOutlookSynchronization%3efalse%3c%2fexportOutlookSynchronization%3e%3cexportRelationshipRole%3efalse%3c%2fexportRelationshipRole%3e%3cexportIsvConfig%3efalse%3c%2fexportIsvConfig%3e%3c%2fsettings%3e, StackTrace: [CrmException: SQL timeout expired.]
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.ExportSolutionCommand.Execute()
   at Microsoft.Crm.Dialogs.ExportSolutionPage.ExportSolution(String ismanaged, String optionXml)
   at Microsoft.Crm.Dialogs.ExportSolutionPage.ConfigureForm()
   at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.]
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   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)

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 13.06.2016 16:06:31
Event time (UTC): 13.06.2016 14:06:31
Event ID: 32a2c5bc89a145d7bf49d70c8d8f4f28
Event sequence: 616
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-131102998861671990
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\Program Files\Microsoft Dynamics CRM\CRMWeb\
    Machine name: D2DEVCRM02
 
Process information:
    Process ID: 4332
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Exception information:
    Exception type: CrmException
    Exception message: SQL timeout expired.
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.ExportSolutionCommand.Execute()
   at Microsoft.Crm.Dialogs.ExportSolutionPage.ExportSolution(String ismanaged, String optionXml)
   at Microsoft.Crm.Dialogs.ExportSolutionPage.ConfigureForm()
   at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 
 
Request information:
    Request URL: d2devcrm02/…/dlg_exportsolution.aspx{E78FB0AD-C209-45F2-B3C2-969B588AE213}&command=exportsolution&ismanaged=0&optionxml=<settings><exportAutoNumber>false</exportAutoNumber><exportCalendar>false</exportCalendar><exportCustomization>false</exportCustomization><exportEmailTracking>false</exportEmailTracking><exportGeneral>false</exportGeneral><exportMarketing>false</exportMarketing><exportOutlookSynchronization>false</exportOutlookSynchronization><exportRelationshipRole>false</exportRelationshipRole><exportIsvConfig>false</exportIsvConfig></settings>
    Request path: /winVSNextCommissioning/_grid/cmds/dlg_exportsolution.aspx
    User host address: 10.20.180.16
    User: META10\crmdeploymentadmin
    Is authenticated: True
    Authentication Type: Negotiate
    Thread account name: NT AUTHORITY\NETWORK SERVICE
 
Thread information:
    Thread ID: 21
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.ExportSolutionCommand.Execute()
   at Microsoft.Crm.Dialogs.ExportSolutionPage.ExportSolution(String ismanaged, String optionXml)
   at Microsoft.Crm.Dialogs.ExportSolutionPage.ConfigureForm()
   at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
 
Custom event details:

After a scounting on google I found that there are a number of causes for this error message and there are many article about the problem. I added the the OLEDBTimeout and the ExtendedTimeout registry subkeys to increase the time-out values

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  3. Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.
  4. Rename the DWORD value to the following value:
    OLEDBTimeout
  5. Right-click the DWORD value, and then click Modify.
  6. In the Edit DWORD Value dialog box, type 86400 in the Value data box, click Decimal in the Base option, and then click OK.Note According to the requirement of the computer that is running SQL server and the number of customization files, the value can be larger than 86400. The value of 86400 is equivalent to 24 hours.
  7. Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.
  8. Rename the DWORD value to the following value:
    ExtendedTimeout
  9. Right-click the DWORD value, and then click Modify.
  10. In the Edit DWORD Value dialog box, type 1000000 in the Value data box, and then click OK.Notes
    • In the Value data box, you can type a value that is larger than 1,000,000. However, do not type a value that is larger than 2,147,483,647. This is hexadecimal 0x7FFFFFFF.
    • If this key already exists, notice the current value. After you have completed the import or the upgrade for Microsoft Dynamics CRM, set the value of this key back to the original value or delete the key if it did not previously exist. The default OLEDB timeout value is 30 seconds.

After I reset IIS and I tried to export the solution again… and run all!!!

Annunci

CRM2016 – DCP Server Upgrade problems

Today, during the upgrade, I had an error to install the new version for DCP server. I tried to follow the workaround on this post but I did not resolve the problem.  My error was on other solution MSCRMADDONScomGeneral2015.101:

i1

i2

The problem was related about a “DROP FULLTEXT INDEX”

I tried to install manually the solution from App path\essentials folder but the result was the same:

i3

The log error was

Entity                   ptm_mscrmaddons_key             MSCRM-ADDONS.com Settingskeys     MSCRM-ADDONS.com Settingskeys                       Failure 0x80044150        DROP FULLTEXT INDEX statement cannot be used inside a user transaction.

After I tried to drop manually the index on the table. I tried again the DCP server setup and It’s running!!

DROP FULLTEXT INDEX ON ptm_mscrmaddons_settingsBase
DROP FULLTEXT INDEX ON [dbo].[ptm_mscrmaddons_keyBase]</p>

That’s all!

Upgrade CRM2015 to CRM2016 : Timeout error during the upgrade

When I tried to uprade an organization from CRM2015 to CRM2016 I hade a Time out error : “The timeout period elapsed prior to completion of the operation or the server is not responding.  The wait operation timed out“.

I checked on google and I read that “You cannot import your CRM 2015 database to upgrade to CRM 2016 if it has a Full Text Catalogue. Something that is likely if you have been using the improved searching functions of CRM 2015.

To fix this problem, we have two possibilities: First one is to disable the Full-search for Quick find on CRM2105 before to migrate. But I don’t know why You need to wait a full 24 hours from the time you change this setting before you attempt to import (or backup to import) the organization into a CRM 2016 environment.

 

quickfind

if you need to resolve problem in fast way there is the second solution: This one is an update script directly on databse but it is not supported. The steps are the following:

  1. Restore backup from CRM 2015 database
  2. On the SQL manager, select the Database in question, and select “New Query” (our 2015 dates restore is demo_2016_MSCRM)s2
  3. In the new Query window. Paste the following code and click Execute
    declare @catid int
    
    select @catid=fulltext_catalog_id from sys.fulltext_catalogs where name='CRMFullTextCatalog'
    
    declare c cursor for
    
     select sys.tables.name, sys.fulltext_indexes.unique_index_id from sys.fulltext_indexes inner join sys.tables on sys.fulltext_indexes.object_id = sys.tables.object_id where sys.fulltext_indexes.fulltext_catalog_id=@catid
    
     open c
    
     declare @TableName varchar(200), @UniqueID as integer
    
     fetch next from c into @TableName, @UniqueID
    
     while @@fetch_status = 0
    
     begin
    
     declare d cursor for
    
     select sys.indexes.name, sys.tables.object_id from sys.tables inner join sys.indexes on sys.tables.object_id = sys.indexes.object_id where sys.tables.name=@TableName and sys.indexes.index_id = @UniqueID
    
     open d
    
     declare @KeyIndex varchar(200), @object_id as integer
    
     fetch next from d into @KeyIndex, @object_id
    
     if @@FETCH_STATUS &lt;&gt; 0 
    
     begin
    
     Print 'Error with' + @TableName
    
     end
    
     while @@fetch_status = 0
    
     begin
    
     BEGIN TRY
    
     Print 'CREATE FULLTEXT INDEX ON [dbo].'+@TableName+' KEY INDEX ['+@KeyIndex+'] on([CRMFullTextCatalog]) WITH (CHANGE_TRACKING AUTO)'
    
     Print 'GO'
    
     declare e cursor for
    
     select sys.columns.name from sys.columns inner join sys.fulltext_index_columns on sys.columns.object_id=sys.fulltext_index_columns.object_id and sys.columns.column_id=sys.fulltext_index_columns.column_id where sys.columns.object_id=@object_id
    
     open e
    
     declare @ColumnName varchar(200)
    
     fetch next from e into @ColumnName
    
     while @@fetch_status = 0
    
     begin
    
     Print 'ALTER FULLTEXT INDEX ON [dbo].'+@TableName+' Add ('+@ColumnName+')'
    
     Print 'GO'
    
     fetch next from e into @ColumnName
    
     end
    
     close e
    
     deallocate e
    
     END TRY
    
     BEGIN CATCH
    
     print 'Error' + @KeyIndex
    
     END CATCH
    
     fetch next from d into @KeyIndex, @object_id
    
     end
    
     close d
    
     deallocate d
    
     fetch next from c into @TableName, @UniqueID
    
     end
    
     close c
    
     deallocate c
    

    The complete script is on my Github: DisableFullTextSearch-Catalog.sql

  4.  When the query executes successfully. Copy to the Clipboard all of the “Message” output in the bottom half of the screen to your clipboard.s3
  5. Now Expand the “Storage / Full Text Catalogues” section of the Database in question and select Properties. s4
  6. Select Table / Views. Using the the little Left pointing arrow. s5Click it as many times as needed to move all the items on the right to the left. Like this:s6
  7. Once finished, select he Script Dropdown and select “Script Action to New Window” (or just click on OK both actions should work)s7
  8. Now Close all the Management for the SQL Server. This is Important.
  9. Upgrade your CRM database the normal way using the Microsoft Dynamics Deployment Manager / Organisations / Import Organisation
  10. Once the upgrade has finished and you have your database imported and upgraded to CRM 2016, Open the SQL manager for the database in question again, and run a new query against the database as we did in step 3 above.This time however we are going to paste the output we captured to clipboard in step 4 above, and run that output as a script.s9
  11. Click Execute again. And you should be rebuilding the database indexes to a state that will function with the new CRM upgraded database.

Source are :

  • community.dynamics.com/crm/f/117/t/184508
  • interactivewebs.com/blog/index.php/crm/crm-2016-import-upgrade-from-crm-2015-failure-timeout-expired/

 

 

 

 

 

 

 

Upgrade CRM2015 to CRM2016 : Database having version 8.0.1.79 is not supported for upgraded.

Today I had a problem to migrate CRM2015 to CRM2016. When I try to import I had this error: Database having version 8.0.1.79 is not supported for upgraded.

I thought that the problem was related with CRM database but Microsoft Community helps me to understand the problem:

The error is misleading as it has nothing to do with the version of the database. If you are trying to import an organization database that has already been imported to an organization on that crm server, you will get this error, because the organization has the same ID.

To resolve it I found two solutions:

  1. Remove the organization with the same ID from server
  2. Change server

But my mate Martin got me another possiblity: Change organization ID from database. It is an unsupported solution but for my needs is perfect. Now I executed the SQL Script and all it is import right.  If you want, you can find the script on my GITHUB: Change Organisation ID V3.sql.

 

 

CRM – Import Organization Error

I am too old and sometime my memory lost something.. 🙂 Today I lost time to resolve a easy error that I already had in the past:

The Import Organization Wizard cannot connect to the SQL Server
or cannot find an organization database on SomeMachineName.
Verify that the server name in the SQL Server box is correct
and that the computer is running Microsoft SQL Server where an
organization database is stored

we have the error when you start we Microsoft Dynamics CRM Deployment Manager, choose Organizations then click Import Organization… we might hit the error “The Import Organization Wizard cannot connect to the SQL Server or cannot find an organization database on SomeMachineName. Verify that the server name in the SQL Server box is correct and that the computer is running Microsoft SQL Server where an organization database is stored.”

importorgerror1_thumb

One of the reasons is we do not have the database that you want to import as organization prior to clicking the Import Organization…

We need to check some things:

  1. In SQL Server Database we need that there is at least one CRM database free to import. If all database are imported, we cannot use this sql instance
  2. The name of database that we need to import needs to finish with _MSCRM : CRMDatabase_MSCRM.

After this check, we are able to import the Organization again.

 

Error message when you try to log on to Microsoft Dynamics CRM: “Cannot open database ‘[Organization]_MSCRM’ requested by the login” after restart server

After restart the server where I installed CRM2016, I have this error

Cannot open database “Organization_MSCRM” requested by the login.
The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’.

In the events viewer I watched the details:

Cannot open database “MSCRM_CONFIG” requested by the login. The login failed.
Login failed for user ‘Domain\CRMServer$‘.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database “MSCRM_CONFIG” requested by the login. The login failed. Login failed for user ‘Domain\CRMServer$‘.

This problem occurs if one or more of the following conditions are true:

  • You install Microsoft Dynamics CRM in a multiple-server environment. Then, you install Microsoft Dynamics CRM directly on a server that is running Microsoft SQL Server. However, some SQL Server permissions are not set.
  •   The Microsoft Dynamics CRM server is not added to the SQLAccessGroup group in the Active Directory directory service

I open the database and check the membership for the user NT AUTHORITY\NETWORK SERVICE on database MSCRM_CONFIG and the Database role membership db_owner was lost!!! I don’t know why!!!!

To resolve this problem I insert again the db_owner inside Database role membership and I reset IIS….

I resolve the problem!!!

 

NOSQL DB

Ho iniziato ad utilizzare i database NOSQL per un mio progetto, in particolare sto utilizzando MONGO DB. Girando su google ho trovato questi articoli molto interessanti per iniziare a lavore

http://www2.mokabyte.it/cms/article.run?permalink=mb160_nosql-1
http://www2.mokabyte.it/cms/article.run?permalink=mb161_nosql-2
http://www.dotnettoscana.org/database-nosql-usare-mongodb-con-c.aspx

Ma perche’ utilizzare un database NOSQL? Piccola premessa: Il mio progetto utilizzera 2 tipologie di database, SQL Server 2008 e MangoDB. Tutta la logica dati verra’ gestita con SQL Server 2008 mentre in MangoDB verranno salvate tutte quelle informazioni massive che non hanno bisongo di logica. Mi spiego: la gestione degli utenti, delle informazioni basi verranno fatte con SQL Server mentre tutte quelle informazioni che arrivano o vengono importate da fonti esterne, verranno salvate e gestite utilizzando MangoDB. Purtroppo per adesso non posso scendere ancora nel dettaglio ma in futuro iniziero’ a dettagliare meglio le mie ragioni.