GithubHelp home page GithubHelp logo

Comments (4)

iBoonz avatar iBoonz commented on June 9, 2024

Database is not in sync

2016-09-06 14:46 GMT+02:00 Mestical [email protected]:

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.CreateDatabaseIfNotExists1.InitializeDatabase(TContext context )\r\n at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.<CreateInitializationAction

b__e()\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(Action1 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.InternalSet1.get_InternalContext()\r\n at System.Data.Entity.Internal.Linq
.InternalSet1.get_Local()\r\n at System.Data.Entity.DbSet1.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__31.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.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.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.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.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.d__2.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
d__2.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.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.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
#26,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACy2xlEqPFpJ5Q_-GR7LmzsJFO7wDw2zks5qnWCtgaJpZM4J1zBN
.

from identityserver3.admin.entityframework.

eaba avatar eaba commented on June 9, 2024

@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

from identityserver3.admin.entityframework.

madhavabhyankar avatar madhavabhyankar commented on June 9, 2024

you could use entity framework to find out what has changed and generate scripts.
Add-Migration TestMigration
Update-Database -script

from identityserver3.admin.entityframework.

eaba avatar eaba commented on June 9, 2024

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!!

from identityserver3.admin.entityframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.