locked
Upgrade fails with an error RRS feed

  • Question

  •  

    When upgrading our pre production crm 3.0 Rollup2 to the RTM version of CRM 4.0 upgrade fails with an error:

    System.Exception: Action Microsoft.Crm.Setup.Server.InstallDatabaseAction failed. ---> System.Data.SqlClient.SqlException: There is already an object named 'AttributeTypes' in the database.

     

    There is no replication on the database and al the prechecks are "green"

     

    Any Ideas ?

     

    Best regards

    Tomaz

     

    Tuesday, January 8, 2008 3:28 PM

Answers

  • This looks like you have made unsupported modifications to the CRM database. Have you added any tables, stored procs etc?

     

     

    REgards,

    Imran

     

    http://microsoftcrm3.blogspot.com

    Thursday, January 10, 2008 10:51 AM
    Moderator

All replies



  • Your best bet here is to use SQL Server Profiler  and set it up to listen for error events (they will appear as red in the profiler), then kick off an install and you should be able to see  the exact sql statement that is failing and hence work out a course of action.

    My best initial guess would be that you have an entity or attribute called AttributeTypes already as part of your customizations and you will need to rename it as it is now effectively a reserved word.

    John
    Tuesday, January 8, 2008 8:28 PM
  • This looks like you have made unsupported modifications to the CRM database. Have you added any tables, stored procs etc?

     

     

    REgards,

    Imran

     

    http://microsoftcrm3.blogspot.com

    Thursday, January 10, 2008 10:51 AM
    Moderator
  • Hi Tomaz,

     

    We too received the exact same error message when attempting to install CRM 4.0 as an upgrade to our CRM 3.0 deployment.  Were you able to resolve this error message?

     

    We appreciate any assistance you can offer.

     

    Sincerely,

     

    Tim Ziegner

     

    Friday, January 18, 2008 1:20 AM
  • Hi Tomaz,

     

    Did your CRM 3.0 deployment have any c360 products installed?

     

     

    Friday, January 18, 2008 5:01 AM
  • Tomaz,

     

    let me know your 3rd party softwars or un supported customization.

     

    also let me know error message you are getting -

     

    Regards,

    Imran

     

    http://microsoftcrm3.blogspot.com

     

     

    Friday, January 18, 2008 6:33 AM
    Moderator
  •  

    No there were no unsupported customizations, there are no additional stored procedures.

    Regards Tomaz
    Friday, January 18, 2008 8:16 AM
  • Hi,

    We do not have any c360 product installed , all the extensions are supportable (.net assemblyes , jscript) .

    The solution for our problem was the deletion of stuck Workflows not visible in Workflow Manager.

    In the log file crm40svrsetup.log there ware errors like:

    ERROR : Running workflow check: Check for assemblies being referred inside workflow definitions/instances, missing from workflow.config

    13:53:29|  Error| Process: Test, ProcessId: 308409ce-9366-dc11-9429-005056c00008, Description: Reference to missing .net assembly method: Create_entity, group:  in action: Create_entity:test

    The solution was to delete them with stored procedure P_deleteprocess

    After deleted all the stuck workflows the setup worked fine

     

    Regards Tomaz

    Friday, January 18, 2008 8:30 AM
  •  

    Hoping someone can assist me a bit...

     

    I got past our problems with the AttributeTypes object message by simply applying Win2k3 service packs.  Not sure how that relates, exactly but it seemed to have worked.  I'm working off the exact same set of data every time I attempt the upgrade - We're using VMWare for our testing environment and we've duplicated the virtual machine so we know what steps we need to take for our production environment.

     

    Our upgrade now runs for hours and right toward the end it craps out and tells me it failed upgrading some workflows.  Tomaz seems to be bang-on.

     

    I have two errors in my log, similar to:

     

    17:27:09|  Error| Exception while upgrading instance workflow: NameStick out tongueroposal Delivered: Move Sales Stage to Waiting - Create Follow Up ProcessInstanceId:{96cc013d-ce09-dc11-a123-00145e956349}Microsoft.Crm.CrmException: SdkCommand Update ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
       at System.Data.SqlClient.TdsParser.ReadPlpUnicodeChars(Char[]& buff, Int32 offst, Int32 len, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.ReadSqlStringValue(SqlBuffer value, Byte type, Int32 length, Encoding encoding, Boolean isPlp, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.ReadSqlValue(SqlBuffer value, SqlMetaDataPriv md, Int32 length, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.ReadColumnData()
       at System.Data.SqlClient.SqlDataReader.ReadColumn(Int32 i, Boolean setTimeout)
       at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)
       at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.FillEntityFromDataReader(BusinessEntity entity, IDataReader reader, EntityExpression entityExpression)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoRetrieve(BusinessEntity entity, EntityExpression entityExpression, ExecutionContext context, Int32 languageCode)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.Retrieve(BusinessEntityMoniker moniker, EntityExpression entityExpression, ExecutionContext context, Int32[] deletionCodes, Int32 languageCode)
       at Microsoft.Crm.BusinessEntities.BusinessProcessObject.Retrieve(BusinessEntityMoniker moniker, EntityExpression entityExpression, ExecutionContext context)
       at Microsoft.Crm.Workflow.Upgrade.SdkCommand.Retrieve(String entityName, Guid entityId, String[] columns)
       --- End of inner exception stack trace ---
       at Microsoft.Crm.Workflow.Upgrade.SdkCommand.Retrieve(String entityName, Guid entityId, String[] columns)
       at Microsoft.Crm.Workflow.Upgrade.SdkCommand.Retrieve(String entityName, Guid entityId)
       at Microsoft.Crm.Workflow.Upgrade.WorkflowUpgradeOrchestration.CreateAsyncOperation(WFProcessInstanceRow processInstanceRow, Guid activationId, String primaryEntityName, IUpgradeContext upgradeContext, String messageName, Int32 errorCode)
       at Microsoft.Crm.Workflow.Upgrade.WorkflowUpgradeOrchestration.UpgradeInstances(IUpgradeContext upgradeContext, IDataProvider`1 dataProvider)

     

    Assuming I can follow Tomaz's guidance and delete the workflow instance (can someone guide me a bit more), is there a way for me to accurately tell if that workflow instance contains useful data?  Will I be deleting good data?

     

     

    Thanks in advance,

     

    TM

     

     

    Tuesday, January 22, 2008 11:13 PM
  • Hi,

     

    I will provide you with the steps which you must execute in the SQL Data Managment studio on your CRM Database server. If I presume right this is not supported from Microsoft. But this workflows are not visible in WorkFlow manager.

    A backup of the CRM database before this procedure is an absolute MUST.

     Start a new query for the database Organization__MSCRM 

    The process id is the proces which you provided in the log above.

     

    DELETE FROM WFParameter

    FROM WFRule INNER JOIN

    WFStep ON WFRule.StepId = WFStep.StepId INNER JOIN

    WFCondition ON WFRule.RuleId = WFCondition.RuleId INNER JOIN

    WFParameter ON WFCondition.ConditionId = WFParameter.ConditionId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFCondition

    FROM WFRule INNER JOIN

    WFStep ON WFRule.StepId = WFStep.StepId INNER JOIN

    WFCondition ON WFRule.RuleId = WFCondition.RuleId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFRuleLog

    FROM WFRule INNER JOIN

    WFStep ON WFRule.StepId = WFStep.StepId INNER JOIN

    WFRuleLog ON WFRule.RuleId = WFRuleLog.RuleId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFRule

    FROM WFRule INNER JOIN

    WFStep ON WFRule.StepId = WFStep.StepId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFActionLog

    FROM WFStep INNER JOIN

    WFAction ON WFStep.StepId = WFAction.StepId INNER JOIN

    WFActionLog ON WFAction.ActionId = WFActionLog.ActionId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFParameter

    FROM WFStep INNER JOIN

    WFAction ON WFStep.StepId = WFAction.StepId INNER JOIN

    WFParameter ON WFAction.ActionId = WFParameter.ActionId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFAction

    FROM WFStep INNER JOIN

    WFAction ON WFStep.StepId = WFAction.StepId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFActionLog

    FROM WFStep INNER JOIN

    WFProcess ON WFStep.ProcessId = WFProcess.ProcessId INNER JOIN

    WFProcessInstance ON WFProcess.ProcessId = WFProcessInstance.ProcessId INNER JOIN

    WFActionLog ON WFProcessInstance.ProcessInstanceId = WFActionLog.ProcessInstanceId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFProcessInstance

    FROM WFStep INNER JOIN

    WFProcess ON WFStep.ProcessId = WFProcess.ProcessId INNER JOIN

    WFProcessInstance ON WFProcess.ProcessId = WFProcessInstance.ProcessId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

    DELETE FROM WFProcess

    FROM WFStep INNER JOIN

    WFProcess ON WFStep.ProcessId = WFProcess.ProcessId

    WHERE (WFStep.ProcessId IN ('96cc013d-ce09-dc11-a123-00145e956349'))

     

    P_deleteProcess @Processid = '96cc013d-ce09-dc11-a123-00145e956349'

     

     

    I hope this procedure will solve your problem.

     

    Regards Tomaz

     

    Thursday, January 24, 2008 2:38 PM
  • If i Understand right the error your Workflow SalesProcess (opportunity) is stuck in a waiting  for a task or something there is defined in a sales process.

     

    The workflow monitor can show you paused processes. In our Case the workflows were not visible in Workflow Monitor so I used brutal force to find them en deleted them.

     

    Yes i deleted a "useful" data for 5 processes from April and March of 2007 .... (Useful ??? )

     

    You can check in the sql table WF Process when it was created then you can decide.

     

    You can always execute this workflow in CRM 4. 0

     

    Our production system was successfully upgraded today

     

    Regards

    Tomaž

    Thursday, January 24, 2008 4:55 PM
  • Hi Tomaz,

     

    Good evening.  Congratuations on your upgrade. 

     

    Can you please instruct us again on how do "clear" stuck processes?

     

    Do we only need to run the stored procedure?  (P_deleteProcess)   How do we find out the process id?

     

    Thank you for your help.  We appreciate your assistance.

     

    Sincerely,

     

    Tim Ziegner

    Austin, Texas

    Friday, January 25, 2008 2:17 AM
  •  

    Tim,

     

    Tomaz's script basically did the same thing as the P_DeleteProcess stored procedure.  What I did was to open MS SQL Server Mgmt Studio, drilled down into MSCRM -> Programibility -> Stored Procedures.  Right click on p_Delete_Process and select Execute.  In the dialog you'll need to specifiy your failing process ID found in your CRM4 upgrade log. 

     

    I'm re-running my upgrade now and should know today if this worked for me.

     

    Hope this helps.

     

    Regards,

     

    TM

    Friday, January 25, 2008 3:23 PM
  • Good news!  Deleting the processes using p_DeleteProcess has done the trick and gotten us past errors converting workflows.

     

    My environment still isn't working but i have to dig through the installation log to find out what is happening.  But the deletig those process ID's seemed to have helped.

     

    Thanks Tomaz.

     

     

    TM

     

    Saturday, January 26, 2008 1:44 PM