[Solved] The model backing the 'CloudPanelContext' context has changed since the database was created.
Ive just upgraded to CloudPanel_3.1.1540 the plan was to get me up to date so the net step is to install CloudPanel_3.2.0292.3 once I verify the first update works.
I get the following message on login after the upgrade to 3.1.1540 ‘The model backing the ‘CloudPanelContext’ context has changed since the database was created. Consider using Code First Migrations to update the database ( http://go.microsoft.com/fwlink/?LinkId=238269) .’
I cycled the application pool in IIS and it was still the same, so i waited 10 minutes in case its converting a DB, still the same.
I rebooted the entire VM, let it settle down for half an hour after its first boot and still the same. It looks like the database isnt converting to the new schema as it should after the upgrade.
Where do I start troubleshooting this ? I searched and I read to restart IIS and then contact support.
Thanks.
From the CP Log file …
2018-12-18 13:27:51,426 ::: [64] ERROR ::: CloudPanel.UserMapper — Error getting user from identifier 4a204458-b683-47cf-beda-118f1c59e2f6: System.InvalidOperationException: The model backing the ‘CloudPanelContext’ context has changed since the database was created. Consider using Code First Migrations to update the database ( http://go.microsoft.com/fwlink/?LinkId=238269).
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at CloudPanel.UserMapper.GetUserFromIdentifier(Guid identifier, NancyContext context)
2018-12-18 13:27:51,427 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Retrieving the PrincipalContext…
2018-12-18 13:27:51,432 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Attempting to authenticate user Administrator
2018-12-18 13:27:51,475 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — User was found in AD. Validating credentials for Administrator
2018-12-18 13:27:51,490 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Getting AuthorizationGroups for Administrator
2018-12-18 13:27:51,541 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Domain Users with distinguishedname CN=Domain Users,CN=Users,DC=hosted,DC=exchange
2018-12-18 13:27:51,597 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Administrators with distinguishedname CN=Administrators,CN=Builtin,DC=hosted,DC=exchange
2018-12-18 13:27:51,600 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Schema Admins with distinguishedname CN=Schema Admins,CN=Users,DC=hosted,DC=exchange
2018-12-18 13:27:51,603 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Enterprise Admins with distinguishedname CN=Enterprise Admins,CN=Users,DC=hosted,DC=exchange
2018-12-18 13:27:51,605 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Domain Admins with distinguishedname CN=Domain Admins,CN=Users,DC=hosted,DC=exchange
2018-12-18 13:27:51,607 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Group Policy Creator Owners with distinguishedname CN=Group Policy Creator Owners,CN=Users,DC=hosted,DC=exchange
2018-12-18 13:27:51,608 ::: [64] DEBUG ::: CloudPanel.ActiveDirectory.ADUsers — Found group Organization Management with distinguishedname CN=Organization Management,OU=Microsoft Exchange Security Groups,DC=hosted,DC=exchange
2018-12-18 13:27:52,370 ::: [64] ERROR ::: CloudPanel.UserMapper — Error logging in user Administrator: System.InvalidOperationException: The model backing the ‘CloudPanelContext’ context has changed since the database was created. Consider using Code First Migrations to update the database ( http://go.microsoft.com/fwlink/?LinkId=238269).
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at CloudPanel.UserMapper.Validate(String username, String password, Boolean rememberMe)
2018-12-18 13:27:52,371 ::: [64] ERROR ::: CloudPanel.Modules.LoginModule — Error logging in: System.InvalidOperationException: The model backing the ‘CloudPanelContext’ context has changed since the database was created. Consider using Code First Migrations to update the database ( http://go.microsoft.com/fwlink/?LinkId=238269).
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at CloudPanel.UserMapper.Validate(String username, String password, Boolean rememberMe)
at CloudPanel.Modules.LoginModule.<.ctor>b__1_2(Object _)
2018-12-18 13:27:53,038 ::: [32] ERROR ::: CloudPanel.Bootstrapper — Error after pipeline: System.InvalidOperationException: The model backing the ‘CloudPanelContext’ context has changed since the database was created. Consider using Code First Migrations to update the database ( http://go.microsoft.com/fwlink/?LinkId=238269).
at System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
at System.Data.Entity.DbSet`1.Add(TEntity entity)
at CloudPanel.Bootstrapper.<Trace>d__5.MoveNext()
2018-12-18 13:27:53,039 ::: [32] DEBUG ::: CloudPanel.Modules.BrandingModule — Processing branding request for he.mait.co
2018-12-18 13:27:53,039 ::: [32] DEBUG ::: CloudPanel.Modules.BrandingModule — No brandings have been defined
Older versions required you to go to the settings/setup view and click on update database. Login to the server it is installed on and go to http://localhost/CloudPanel/admin/settings and it should being up the admin page. You have to do this from the server though
You could also check the settings.xml file and validate that the correct SQL connection string is in there. There were issues in the past where it wouldn’t save that value.
Thanks, your first advice worked! Now onto the 3.2 upgrade, fingers crossed!
Make sure you validate the plans and that they don’t have data missing. Such as the company and mailbox plans
- 5 Forums
- 716 Topics
- 3,649 Posts
- 0 Online
- 258 Members