locked
CRM 4.0 to 2011 AccountId column upgrade problem RRS feed

  • Question

  • Hi.

    We tried to inplace update our crm 4.0 to 2011 and encountered this error which i had taken from the log file :

     

    13:29:05|   Info| Metadata xml upgrade: pass 1
    13:52:23|   Info| CrmAction execution time; UpgradeDatabaseAction; 01:01:40.4468263
    13:52:23|  Error| Installer Complete: OrganizationUpgrader - Error encountered
    13:52:23|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed.
    InnerException:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       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.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.SqlHelper.ExecuteNonQuery(ISqlExecutionContext context, IDbCommand sqlCommand)
       at Microsoft.Crm.Metadata.DenormalizedFieldHelper.PopulateDenormalizedField(IViewInfoDescription viewInfoDescription, MetadataHelper helper)
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
       at Microsoft.Crm.Setup.DiffBuilder.Pass1(String metadataLocation, String languageCode)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType 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 Microsoft.Crm.Setup.Database.DllMethodAction.Execute()
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
    InnerException:
    System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       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.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.SqlHelper.ExecuteNonQuery(ISqlExecutionContext context, IDbCommand sqlCommand)
       at Microsoft.Crm.Metadata.DenormalizedFieldHelper.PopulateDenormalizedField(IViewInfoDescription viewInfoDescription, MetadataHelper helper)
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
       at Microsoft.Crm.Setup.DiffBuilder.Pass1(String metadataLocation, String languageCode)

    13:52:24|   Info| Setting organization state.  New state = Failed
    13:52:24|  Error| Install exception.System.Exception: Action Microsoft.Crm.Tools.Admin.UpgradeDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
    Invalid column name 'AccountId'.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       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.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Metadata.SqlHelper.ExecuteNonQuery(ISqlExecutionContext context, IDbCommand sqlCommand)
       at Microsoft.Crm.Metadata.DenormalizedFieldHelper.PopulateDenormalizedField(IViewInfoDescription viewInfoDescription, MetadataHelper helper)
       at Microsoft.Crm.Metadata.MetadataHelper.ProcessQueue()
       at Microsoft.Crm.Setup.DiffBuilder.Pass1(String metadataLocation, String languageCode)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType 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 Microsoft.Crm.Setup.Database.DllMethodAction.Execute()
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseInfo releaseInfo, Boolean isInstall)
       at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase, Boolean isInstall)
       at Microsoft.Crm.Tools.Admin.InstallDatabaseAction.Do(IDictionary parameters)
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
       at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
       at Microsoft.Crm.Tools.Admin.OrganizationUpgrader.Install(IDictionary stateSaver)
       at Microsoft.Crm.Setup.Common.ComposedInstaller.InvokeInstall(Installer installer, IDictionary stateSaver)
       at Microsoft.Crm.Setup.Common.ComposedInstaller.InternalInstall(IDictionary stateSaver)
       at Microsoft.Crm.Setup.Common.ComposedInstaller.Install(IDictionary stateSaver)
       at Microsoft.Crm.Setup.Server.ServerSetup.Upgrade(IDictionary data)
       at Microsoft.Crm.Setup.Common.SetupBase.ExecuteOperation()
    13:52:24|Verbose| Method exit: Microsoft.Crm.Setup.Server.ServerSetup.ExecuteOperation
    13:52:25|   Info| ActivatePage(ServerSetupFinishPage)

     

    Prior to that there were some warnings :

    For a deployment that is more secure, the Microsoft Dynamics CRM Sandbox Processing Service should be run under a least-privileged domain user account that is not shared by other Microsoft Dynamics CRM services on this computer.

    The stored procedures in the database are not consistent with Microsoft Dynamics CRM stored procedures.

    Database triggers were detected in the Microsoft Dynamics CRM database

    Fragmented indexes were detected in the Microsoft Dynamics CRM database

    There are one or more language packs provisioned for this organization. For the language feature to continue to work correctly, you must upgrade and then provision each language pack after the organization upgrade is completed.

     

    Is there some way I could get my hands on the SQL that was executed? Also I started SQL trace prior to the update, hope that could help.

    Thx in advance for any response.

     

    Dušan


    Tuesday, April 5, 2011 12:33 PM

Answers

  • Hi Dusan,

     

    we opened a ticket at MS for this case but kept trying to do the migration.

    The issue seems to be solved by dropping all triggers in the database and reactivating them after the migration.

    But I have no idea, what the error message tried to tell me....

     

    Regards,

    Ludger

    Monday, May 2, 2011 2:30 PM

All replies

  • This issue is a bug which is already fixed in RTM. Could you please check the version of the CRM 2011 you are using?
    Please remember to click “Mark as Answer” on the post that helps you. Jackie Chen, Microsoft Online Community Support
    Thursday, April 7, 2011 7:17 AM
  • Hi Jackie.

    We have 5.0.9688.583 installed.

     

    Thx for your response BTW :)

    Thursday, April 7, 2011 7:44 AM
  • hey there,

     

    got the exactly same issue with CRM2011 Rollup 1 installed (5.0.9688.1045).

     

    Did you get fix or workaround for this exception?

     

    Regards,

    Ludger

     

    Thursday, April 28, 2011 3:30 PM
  • Hi Dusan,

    what do you mean by IE9/IE8? This is not a frontend problem. It occurs in the deployment manager while upgrading the database.

    But I will go ahead and open a ticket at MS and keep this thread informed.

     

    Ludger

    Friday, April 29, 2011 6:52 AM
  • Hi Ludger.

    I'm very sorry, my bad. You are of course right.

    We had also problem with picker column in IE9, I replied to wrong thread. I will delete my reply to not confuse others. Thx for keeping us informed about the ticket result :)

     

    Dušan

    Friday, April 29, 2011 7:31 AM
  • Hi Dusan,

     

    we opened a ticket at MS for this case but kept trying to do the migration.

    The issue seems to be solved by dropping all triggers in the database and reactivating them after the migration.

    But I have no idea, what the error message tried to tell me....

     

    Regards,

    Ludger

    Monday, May 2, 2011 2:30 PM
  • Hi Ludger.

    Well we added some triggers to the original CRM 4.0 DB (as part of our customizations). So we will try to deactivate triggers prior to migration and I will keep you informed if we succeeded (or not).

     

    THX,

    Dušan

    Tuesday, May 3, 2011 6:31 AM
  • Hi Ludger.

    So it worked for us, we dropped all our triggers and the migration was successful :) THX for your suggestion. I owe you a beer. :)

     

    Dušan

    Tuesday, May 3, 2011 11:14 AM
  • Hello!

    Please help!

    We have no triggers in our customization, but after migration AccountId column is missing!

    It's a very strange behavior!

     

    Thanks for any suggestion!

    Thursday, December 15, 2011 4:01 PM