Error after upgrade 3.8 to 3.9

Posted: March 20, 2017 at 12:53 PM Quote #185211
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: March 20, 2017 at 1:10 PM Quote #185213
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Andrei Mazulnitsyn
Posted: March 20, 2017 at 3:05 PM Quote #185214
Yes, i ve executed the upgrade script without errors. I'll try to execute it one more time.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: March 21, 2017 at 6:25 AM Quote #185246
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'.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: March 21, 2017 at 1:54 PM Quote #185272
i ve manually changed the NULL values in RegisteredInStoreId to 1. It seems ok now.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: March 22, 2017 at 3:18 PM Quote #185338
ben 1 yaptım site düzgün gibi ama admin panele giremiyorum
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
BNV Yazılım
Posted: March 22, 2017 at 5:43 PM Quote #185345
Klasörlerin yazma izinlerini kontrol et. Ben hepsini yeniden ayarladım.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 20, 2017 at 3:59 PM Quote #186761
I have the same problem exactly.

-- Update
The problem has been resolved. I had pointed to incorrect database.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
E-COMMERCE CONFERENCE 2017
Learn more