Closed eaba closed 7 years ago
Database is not in sync
2016-09-06 14:46 GMT+02:00 Mestical notifications@github.com:
I get the below error using the latest release :
{"message":"An error has occurred.","exceptionMessage":"The model backing the 'ClientConfigurationDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).","exceptionType":"System.InvalidOperationException" ,"stackTrace":" at System.Data.Entity.CreateDatabaseIfNotExists
1.InitializeDatabase(TContext context )\r\n at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf
1.<CreateInitializationActionbe()\r\n at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action )\r\n at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()\r\n at System .Data.Entity.Internal.LazyInternalContext.
b 4(InternalContext c)\r\n at System .Data.Entity.Internal.RetryAction1.PerformAction(TInput input)\r\n at System.Data.Entity.Internal .LazyInternalContext.InitializeDatabaseAction(Action
1 action)\r\n at System.Data.Entity.Internal.LazyInternalContext .InitializeDatabase()\r\n at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType (Type entityType)\r\n at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()\r\n at System .Data.Entity.Internal.Linq.InternalSet
1.get_InternalContext()\r\n at System.Data.Entity.Internal.Linq .InternalSet1.get_Local()\r\n at System.Data.Entity.DbSet
1.get_Local()\r\n at IdentityServer3.EntityFramework .DbModelBuilderExtensions.RegisterClientChildTablesForDelete[TClient](DbContext ctx) in c:\git\identity \server3\EntityFramework\Source\Core.EntityFramework\Extensions\DbModelBuilderExtensions.cs:line 31\r\n at IdentityServer3.EntityFramework.ClientConfigurationDbContext.ConfigureChildCollections( ) in c:\git\identity\server3\EntityFramework\Source\Core.EntityFramework\DbContexts\ClientConfigurationDbContext .cs:line 40\r\n at IdentityServer3.Admin.EntityFramework.IdentityAdminCoreManager4.QueryClientsAsync (String filter, Int32 start, Int32 count) in c:\\git\\identity\\server3admin\\EntityFramework\\source \\IdentityServer3.Admin.EntityFramework\\IdentityAdminCoreManager.cs:line 616\r\n at IdentityAdmin .Api.Controllers.ClientController.<GetClientsAsync>d__4.MoveNext() in c:\\git\\identity\\server3admin \\Admin\\source\\Core\\Api\\Controllers\\ClientController.cs:line 83\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)\r\n at System.Threading.Tasks.System.Web.Http866082.TaskHelpersExtensions.<CastToObject d__3
1.MoveNext() in c:\git\identity\server3admin\Admin\source\Core\Extensions\PropertyMetadataExtensions .cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System .Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices .TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers .ApiControllerActionInvoker.d0.MoveNext() in c:\git\identity\server3admin \Admin\source\Core\Extensions\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter .ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute. d 5.MoveNext () in c:\git\identity\server3admin\Admin\source\Core\Extensions\PropertyMetadataExtensions.cs :line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System .Web.Http.Filters.ActionFilterAttribute.d5.MoveNext() in c:\git\identity \server3admin\Admin\source\Core\Extensions\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices .TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute. d 0 .MoveNext() in c:\git\identity\server3admin\Admin\source\Core\Extensions\PropertyMetadataExtensions .cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System .Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices .TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers .ActionFilterResult.d2.MoveNext() in c:\git\identity\server3admin\Admin\source\ \Core\Extensions\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore d2.MoveNext() in c:\git\identity\server3admin\Admin\source\Core\Extensions\PropertyMetadataExtensions .cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System .Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices .TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers .AuthenticationFilterResult. d0.MoveNext() in c:\git\identity\server3admin\Admin\ \source\Core\Extensions\PropertyMetadataExtensions.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher. d 1.MoveNext() in c:\git\identity\server3admin\Admin\source\Core\Extensions\PropertyMetadataExtensions.cs:line 0"}i am running it against IdentityServer3 5.2.3 Thanks
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/IdentityServer/IdentityServer3.Admin.EntityFramework/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/ACy2xlEqPFpJ5Q_-GR7LmzsJFO7wDw2zks5qnWCtgaJpZM4J1zBN .
@iBoonz at what end? I can not see any migration script for IdentityServer3 5.2.3 which makes me to think the schema are still intact except if @brockallen is yet to update the sample repo with it.
Little guidance will do though! Thanks
you could use entity framework to find out what has changed and generate scripts.
Add-Migration TestMigration
Update-Database -script
Okay to get rid of this issue, since a have my main project working fine and to get the admin project working I created a new IdentityCoreAdminManager
class and changed all new ClientConfigurationDbContext
to :
public class NewContext : ClientConfigurationDbContext
{
public NewContext(string con, string schema)
: base(con, schema)
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
Database.SetInitializer<NewContext>(null);
base.OnModelCreating(modelBuilder);
}
}
And it works now and I dont know if it is the best way but I have moved on from the issue!!
I get the below error using the latest release :
i am running it against IdentityServer3 5.2.3 Thanks