locked
Upgrade from CRM4.0 to CRM2011 fails RRS feed

  • Question

  • Hi,

    I have upgraded CRM4.0 to CRM2011, everything going on fine but at the end of the upgrade process i got an error like 

    System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values and upgrade process is failed.

     

    Everything is upgraded Deployment Manager CRM site with MSCRM_Config. When i try to access the CRM its showing me like SQL error

    The log file is from 172 step.

     

    This is log file 

     

    172: UnresolvedAddress

    10:01:51|Verbose| DatabaseAction execution time; Bin\Microsoft.Crm.DataUpgrade.dll:RunV4DeletionService; 00:04:33.0788452

    10:01:51|   Info| Clean up extension tables

    10:01:52|   Info| CrmAction execution time; UpgradeDatabaseAction; 00:11:48.8856186

    10:01:52|  Error| Installer Complete: OrganizationUpgrader - Error encountered

    10:01:53|  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.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

       at System.Data.SqlClient.SqlBuffer.get_String()

       at Microsoft.Crm.DataUpgrade.CleanUpExtensionTables.RetrieveAndCleanUpTables()

       --- End of inner exception stack trace ---

       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature 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.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

       at System.Data.SqlClient.SqlBuffer.get_String()

       at Microsoft.Crm.DataUpgrade.CleanUpExtensionTables.RetrieveAndCleanUpTables()

     

    10:01:54|   Info| Setting organization state.  New state = Failed

    10:01:55|  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.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

       at System.Data.SqlClient.SqlBuffer.get_String()

       at Microsoft.Crm.DataUpgrade.CleanUpExtensionTables.RetrieveAndCleanUpTables()

       --- End of inner exception stack trace ---

       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature 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()

    10:01:55|Verbose| Method exit: Microsoft.Crm.Setup.Server.ServerSetup.ExecuteOperation

    10:01:55|   Info| ActivatePage(ServerSetupFinishPage)

     

     


    Khaja Mohiddin
    Friday, March 18, 2011 2:48 PM

Answers

  • Hi Alvin,

     

    Run this query in the database,

     

    Update Entityview

    Set IsCustomizable = 0

    Where Objecttypecode = 4700 and IsCustomizable = 1

     

    And start Upgrading the CRM2011.


    Khaja Mohiddin
    • Proposed as answer by AlvinTranNL Tuesday, April 19, 2011 7:35 AM
    • Marked as answer by Khaja Mohiddin Wednesday, April 20, 2011 10:03 AM
    Monday, April 18, 2011 9:44 AM

All replies

  • I have scene where evidently upgrading TFS can expose this too and it was actually a problem in SQL with the @@Servername global. 

    The following article shows how to check for this and set it if necessary. 

    http://blogs.msdn.com/b/dstfs/archive/2010/07/13/error-during-upgrade-to-tfs-2010-system-data-sqltypes-sqlnullvalueexception-data-is-null-this-method-or-property-cannot-be-called-on-null-values.aspx

     


    Jamie Miley
    http://mileyja.blogspot.com
    LinkedIn Profile
    Friday, March 18, 2011 5:38 PM
    Moderator
  •  

    Hi Jamie,

    Thanks for the help, but in our SQL server name is not null its same as the machine name.

     

    I think this error occurs when we are trying to assign a NULL value to a variable or object, so this is quite odd.


    Khaja Mohiddin
    Monday, March 21, 2011 10:46 AM
  • Hi Khaja,

    If your databases were upgraded to 2011 why you not uninstall CRM and install CRM 2011 and import organization(-s) ?

    It's not suggested to have upgraded environments in the production.

    KG


    My Dynamics CRM Blog: http://bovoweb.blogspot.com
    • Proposed as answer by Jim Glass Jr Monday, March 21, 2011 4:57 PM
    • Unproposed as answer by Khaja Mohiddin Thursday, March 24, 2011 8:37 PM
    Monday, March 21, 2011 2:37 PM
  • Hi KG,

    As i said earlier the CRM 2011 is upgraded but not the database. I got this error and the upgrade process is failed.

    System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values

    but the strange thing is I have created a new organization using the Deployment Manager. But my production database is not upgraded.

    I was just trying different solutions but its related to database, i am not that much good at database(SQL). I am unable to find the null values from it. The size of the database is 27GB.


    Khaja Mohiddin
    Monday, March 21, 2011 4:22 PM
  • Ran the query below against the CRM 4.0 Org DB

     

    select ObjectTypeCode, Name, BaseTableName, ExtensionTableName from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)

     

    It returned the results

    =============

    ObjectTypeCode: 4700

    Name: AsyncOperation

    BaseTableName: AsyncOperationBase

    ExtensionTableName: NULL

     

    Resolution

    1 . select ObjectTypeCode, Name, BaseTableName, ExtensionTableName, iscustomisable from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)


    Khaja Mohiddin
    Friday, April 8, 2011 2:08 PM
  • @Khaja Mohiddin

     

     

    we have the same problem and i don't understand your "resolution".

    I use the "Import Organization Wizard" in Deployment Manager. How can i apply your resolution?

    in log:

    ...

    InnerException:

    System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

       at System.Data.SqlClient.SqlBuffer.get_String()

       at Microsoft.Crm.DataUpgrade.CleanUpExtensionTables.RetrieveAndCleanUpTables()

    ...

     



    Friday, April 15, 2011 1:57 PM
  • You need to run the Query in the CRM Database.
    Khaja Mohiddin
    Friday, April 15, 2011 4:02 PM
  • i did that:

    select ObjectTypeCode, Name, BaseTableName, ExtensionTableName, IsCustomizable from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)

    ObjectTypeCode: 1026

    Name: ProductPriceLevel

    BaseTableName: ProductPriceLevelBase

    ExtensionTableName: NULL

    IsCustomizable: 1

     

    it's just a select query, it didnt modify data.

    Sunday, April 17, 2011 9:24 PM
  • Hi Alvin,

     

    Run this query in the database,

     

    Update Entityview

    Set IsCustomizable = 0

    Where Objecttypecode = 4700 and IsCustomizable = 1

     

    And start Upgrading the CRM2011.


    Khaja Mohiddin
    • Proposed as answer by AlvinTranNL Tuesday, April 19, 2011 7:35 AM
    • Marked as answer by Khaja Mohiddin Wednesday, April 20, 2011 10:03 AM
    Monday, April 18, 2011 9:44 AM
  • i think its OK now!
    After i got the name of the entity (ProductPriceLevel) with this query:
    select ObjectTypeCode, Name, BaseTableName, ExtensionTableName, IsCustomizable from EntityView where IsCustomizable = 1 and ( Name is null or BaseTableName is null or ExtensionTableName is null)
    i update it to "0":

    update ENTITY
     	set ISCUSTOMIZABLE = 0
     	WHERE NAME = 'ProductPriceLevel'

    the import now completes...
    next, we have to check for upgrade issues after the import...


    • Proposed as answer by AlvinTranNL Tuesday, April 19, 2011 7:33 AM
    • Unproposed as answer by AlvinTranNL Tuesday, April 19, 2011 7:33 AM
    • Proposed as answer by AlvinTranNL Tuesday, April 19, 2011 7:35 AM
    Monday, April 18, 2011 10:08 AM
  • Hi Alvin,

    You didn't mark my post as an answer.


    Khaja Mohiddin
    Monday, April 18, 2011 3:23 PM
  • many thanx Khaja !
    Tuesday, April 19, 2011 7:36 AM
  • thank you very very very much ! this post solved my problem. 
    Sunday, June 23, 2013 1:04 PM