Error after upgrade 3.8 to 3.9

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
i get an error after upgrading form 3.8 to 3.9 also when i try to access admin section through /administration/default.aspx i get a pure blank page with no messages. This is the error message:

Server Error in '/' Application.

The 'RegisteredInStoreId' property on 'Customer' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.

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.ConstraintException: The 'RegisteredInStoreId' property on 'Customer' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ConstraintException: The 'RegisteredInStoreId' property on 'Customer' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'. ]
   System.Data.Entity.Core.Common.Internal.Materialization.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) +96
   System.Data.Entity.Core.Common.Internal.Materialization.Shaper.GetPropertyValueWithErrorHandling(Int32 ordinal, String propertyName, String typeName) +61
   lambda_method(Closure , Shaper ) +2753
   System.Data.Entity.Core.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly(Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) +185
   lambda_method(Closure , Shaper ) +367
   System.Data.Entity.Core.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper) +181
   System.Data.Entity.Core.Common.Internal.Materialization.SimpleEnumerator.MoveNext() +76
   System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() +112
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +121
   System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1(IEnumerable`1 sequence) +40
   System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +59
   System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +114
   System.Data.Entity.Internal.Linq.DbQueryProvider.Execute(Expression expression) +116
   System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +211
   Nop.Services.Customers.CustomerService.GetCustomerByGuid(Guid customerGuid) +537
   Nop.Web.Framework.WebWorkContext.get_CurrentCustomer() +551
   Nop.Web.Framework.WebWorkContext.get_WorkingLanguage() +462
   Nop.Web.MvcApplication.SetWorkingCulture() +253
   Nop.Web.MvcApplication.Application_AuthenticateRequest(Object sender, EventArgs e) +5
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
7 years ago
Have you executed the upgrade script (from 3.80 to 3.90)? It has the following code. Try to execute it one more time:


--new column
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[Customer]') and NAME='RegisteredInStoreId')
BEGIN
   ALTER TABLE [dbo].[Customer]
   ADD    [RegisteredInStoreId] int NULL
END
GO

declare @DefaultStoreId int;
if ((select count(id) from [dbo].[Store]) = 1)
set @DefaultStoreId = (select top(1) id from [dbo].[Store])
else
set @DefaultStoreId = 0;
--set default value to store column
UPDATE [dbo].[Customer] set [RegisteredInStoreId] = @DefaultStoreId where [RegisteredInStoreId] is NULL

ALTER TABLE [dbo].[Customer] ALTER COLUMN [RegisteredInStoreId] int NOT NULL
GO
7 years ago
Yes, i ve executed the upgrade script without errors. I'll try to execute it one more time.
7 years ago
i run the query as you wrote and got 2 errors

Msg 207, Level 16, State 1, Line 10
Invalid column name 'id'.
Msg 207, Level 16, State 1, Line 11
Invalid column name 'id'.
7 years ago
i ve manually changed the NULL values in RegisteredInStoreId to 1. It seems ok now.
7 years ago
ben 1 yaptım site düzgün gibi ama admin panele giremiyorum
7 years ago
Klasörlerin yazma izinlerini kontrol et. Ben hepsini yeniden ayarladım.
7 years ago
I have the same problem exactly.

-- Update
The problem has been resolved. I had pointed to incorrect database.
4 years ago
im upgrading Nopcommerce 3.8 to 3.9 by applying script after the upgradation i have an error  homepage redirect me to login?ReturnUrl=%2f
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.