Answered by:
upgrade from 3.0 to 4.0 fals with System.Data.SqlClient.SqlException: There is already an object named 'AttributeTypes' in the database.

Question
-
Hi guys,
Im tryng to upgade mscrm 3.0 to 4.0 and im having some issues with following:
20:40:06| Error| System.Exception: Action Microsoft.Crm.Setup.Server.InstallDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
and when i click on retry i get :System.Data.SqlClient.SqlException: There is already an object named 'AttributeTypes' in the database.
basically the upgrade hanged under
18:30:39| Info| Metadata xml upgrade: pass 2for almost 2 hours before i ended up with errors above.
here is the full log :
18:30:39| Info| Metadata xml upgrade: pass 2
20:40:06| Error| System.Exception: Action Microsoft.Crm.Setup.Server.InstallDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
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.ExecuteNonQuery(IDbCommand command)
at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.ExecuteNonQuery(IDbCommand command)
at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.DeleteAll(MetadataBusinessEntityMoniker moniker, ISqlExecutionContext context)
at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.DoDelete(MetadataBusinessEntityMoniker moniker, ISqlExecutionContext sqlContext, OperationContext operationContext)
at Microsoft.Crm.Platform.MetadataBusinessEntities.MetadataProcessObject.Delete(MetadataBusinessEntityMoniker moniker, ISqlExecutionContext sqlContext, OperationContext operationContext)
at Microsoft.Crm.Metadata.ViewInfoDeleteAction.DeleteViewAttribute(Guid viewAttributeId, MetadataHelper helper)
at Microsoft.Crm.Metadata.ViewInfoDeleteAction.MetabaseOperation()
at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
at Microsoft.Crm.Setup.DiffBuilder.Pass2(String metadataLocation)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.Crm.Setup.Database.DllMethodAction.Execute()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseCollection releases, Int32 currentProgress)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase)
at Microsoft.Crm.Setup.Server.InstallDatabaseAction.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Common.Action.ExecuteAction(Action action, IDictionary parameters, Boolean undo)
--- End of inner exception stack trace ---, Error, RetryCancel, Option1
20:52:17| Info| InputResult: Retry
20:52:17| Info| Dropping v3 sql jobs
20:52:17| Info| Dropping v3 sql jobs
20:52:17| Info| Dropping v3 sql jobs
20:52:17| Info| Creating v3.0 metabase tables in database
20:52:17| Info| Creating v3.0 metabase tables in database
20:52:17| Info| Creating v3.0 metabase tables in database
20:52:17| Error| System.Exception: Action Microsoft.Crm.Setup.Server.InstallDatabaseAction failed. ---> System.Data.SqlClient.SqlException: There is already an object named 'AttributeTypes' in the database.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, Int32 timeout)
at Microsoft.Crm.Setup.Database.SqlScriptAction.Execute(DatabaseUtility dbUtility)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseCollection releases, Int32 currentProgress)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase)
at Microsoft.Crm.Setup.Server.InstallDatabaseAction.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Common.Action.ExecuteAction(Action action, IDictionary parameters, Boolean undo)
--- End of inner exception stack trace ---, Error, RetryCancel, Option1- Edited by iCRM Monday, August 9, 2010 12:04 PM edit
Monday, August 9, 2010 11:51 AM
Answers
-
In most cases, if there is a SQL issue during the upgrade, then Retry won't work, as the upgrade process leaves some objects behind. The message 'There is already an object named 'AttributeTypes' in the database' is normally just a consequence of doing a Retry.
If you get in this state, you should restore your CRM 3 databases (MSCRM and METABASE) from backup and try the upgrade again, having first extended the CRM SQL timeout (see http://mscrmuk.blogspot.com/2008/09/sql-timeouts-in-crm-generic-sql-error.html )
Microsoft CRM MVP - http://mscrmuk.blogspot.com http://www.excitation.co.uk- Marked as answer by Jim Glass Jr Tuesday, August 10, 2010 5:38 PM
- Unmarked as answer by iCRM Wednesday, August 11, 2010 6:52 AM
- Marked as answer by Donna EdwardsMVP Thursday, August 12, 2010 8:22 PM
- Unmarked as answer by Donna EdwardsMVP Monday, August 16, 2010 4:37 PM
- Proposed as answer by Donna EdwardsMVP Monday, August 16, 2010 4:37 PM
- Marked as answer by Jim Glass Jr Monday, August 16, 2010 6:06 PM
Monday, August 9, 2010 4:03 PMModerator
All replies
-
Smajlovic - Replication isn't enabled by any chance is it?
See this KB: http://support.microsoft.com/kb/946590/
Monday, August 9, 2010 1:41 PM -
Hi Marc,
Well i dont think so, this server 2003 is running sql2005 and crm3.0. there is only one server.
any idea?Monday, August 9, 2010 2:00 PM -
In most cases, if there is a SQL issue during the upgrade, then Retry won't work, as the upgrade process leaves some objects behind. The message 'There is already an object named 'AttributeTypes' in the database' is normally just a consequence of doing a Retry.
If you get in this state, you should restore your CRM 3 databases (MSCRM and METABASE) from backup and try the upgrade again, having first extended the CRM SQL timeout (see http://mscrmuk.blogspot.com/2008/09/sql-timeouts-in-crm-generic-sql-error.html )
Microsoft CRM MVP - http://mscrmuk.blogspot.com http://www.excitation.co.uk- Marked as answer by Jim Glass Jr Tuesday, August 10, 2010 5:38 PM
- Unmarked as answer by iCRM Wednesday, August 11, 2010 6:52 AM
- Marked as answer by Donna EdwardsMVP Thursday, August 12, 2010 8:22 PM
- Unmarked as answer by Donna EdwardsMVP Monday, August 16, 2010 4:37 PM
- Proposed as answer by Donna EdwardsMVP Monday, August 16, 2010 4:37 PM
- Marked as answer by Jim Glass Jr Monday, August 16, 2010 6:06 PM
Monday, August 9, 2010 4:03 PMModerator -
Hi David,
Thanks for posting, my setup was missing the DWORD key "OLED Timeout" i created it with 99999 as timeout in secunds. I will try upgrade this weekend and i will let you know.
Tuesday, August 10, 2010 7:17 AM -
I believe I’m missing some SQL CRM3.0 jobs as well, I only see following jobs:
MSCRM_CONFIG.HardDelete
MSCRM_CONFIG.SiteWideCleanupAnd I believe that jobs above were, was created when I tried to upgrade to 4.0 and this is basically not MSCRM3.0 jobs.
Are jobs important to upgrade process? And if yes, can somebody tell me what kind of jobs I need to create for mscrm3.0 before upgrading?I only need this setup for upgrading to CRM4.0 after that I will move the org to another server where I got 4.0 already running.
Tuesday, August 10, 2010 7:43 AM -
You'll need to restore your database to a stable state before you started the upgrade as David mentioned. If that is not possible, then you will most likely experience various issues during the upgrade process.
Thursday, August 12, 2010 8:24 PM