Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrchardCore.OpenId Error: Could not run migrations automatically #3421

Closed
Chris533 opened this issue Apr 1, 2019 · 4 comments
Closed

OrchardCore.OpenId Error: Could not run migrations automatically #3421

Chris533 opened this issue Apr 1, 2019 · 4 comments
Labels
Milestone

Comments

@Chris533
Copy link

Chris533 commented Apr 1, 2019

warn: OrchardCore.OpenId.EntityFrameworkCore.Startup[0]
      The OpenID Connect module is not correctly configured.
fail: OrchardCore.Data.Migration.DataMigrationManager[0]
      Could not run migrations automatically on 'OrchardCore.OpenId.Management'
System.InvalidOperationException: Nullable object must have a value.
   at System.Nullable`1.get_Value()
   at OrchardCore.Data.Migration.DataMigrationManager.UpdateAsync(String featureId) in /../src/OrchardCore/OrchardCore.Data/Migration/DataMigrationManager.cs:line 175
   at OrchardCore.Data.Migration.DataMigrationManager.UpdateAllFeaturesAsync() in /../src/OrchardCore/OrchardCore.Data/Migration/DataMigrationManager.cs:line 364

@sebastienros
Copy link
Member

Can you share some repro steps?

@Chris533
Copy link
Author

Chris533 commented Apr 1, 2019

Hi, thanks for your reply.


Update: I think that is caused by Mysql database.

Error while running migration version 0 for 'OrchardCore.OpenId.Management'.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MySql.Data.MySqlClient.MySqlException: Identifier name 'FK_OpenIdApplicationByPostLogoutRedirectUriIndex_Document_Id' is too long ---> MySql.Data.MySqlClient.MySqlException: Identifier name 'FK_OpenIdApplicationByPostLogoutRedirectUriIndex_Document_Id' is too long
   at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ResultSet.cs:line 146
   --- End of inner exception stack trace ---
   at MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet(ResultSet resultSet) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 74
...

  • Normal configuration with fresh installation
  • Error in -post /connect/token
  • Both of default and tenant

Steps(MacOS)

  1. Clone and build
git clone https://github.com/OrchardCMS/OrchardCore.git myApp && cd $_
dotnet build
cd src/OrchardCore.Cms.Web && dotnet run
  1. Enable OpenID Modules and Settings(default, tenant).
  2. Test in Postman
POST /connect/token or /tenant/connect/token  x-www-form-urlencoded
   
grant_type:password
client_id:...
client_secret:...
username:...
password:...


Variable | Value
-- | --
Accept | */*
Accept-Encoding | gzip, deflate
Cache-Control | no-cache
Connection | keep-alive
Content-Length | 91
Content-Type | application/x-www-form-urlencoded
Host | localhost:5000
Postman-Token | e070838f-e8a3-4fa9-890f-ae9826cbbdbb
User-Agent | PostmanRuntime/7.6.1


Error

An unhandled exception occurred while processing the request.

MySqlException: Table 'dbname.prefix_openidauthorizationindex' doesn't exist
MySqlConnector.Core.ServerSession.TryAsyncContinuation(Task<ArraySegment> task) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ServerSession.cs, line 1240

MySqlException: Table 'dbname.prefix_openidauthorizationindex' doesn't exist
MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet(ResultSet resultSet) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs, line 74

@Chris533
Copy link
Author

Chris533 commented Apr 1, 2019

PS: also error when Save
http://localhost:5000/OrchardCore.OpenId/Scope/Create or http://localhost:5000/tenant/OrchardCore.OpenId/Scope/Create

An unhandled exception occurred while processing the request.
MySqlException: Table 'mydbname.myprefix_openidscopeindex' doesn't exist
MySqlConnector.Core.ServerSession.TryAsyncContinuation(Task<ArraySegment> task) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ServerSession.cs, line 1240

MySqlException: Table 'mydbname.myprefix_openidscopeindex' doesn't exist
MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet(ResultSet resultSet) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs, line 74

@sebastienros sebastienros added this to the rc milestone Apr 4, 2019
@sebastienros sebastienros modified the milestones: rc, 1.0 Aug 11, 2019
@sebastienros sebastienros modified the milestones: 1.0, 1.1 Apr 2, 2020
@sebastienros sebastienros modified the milestones: 1.1, 1.x Oct 7, 2021
@Piedone
Copy link
Member

Piedone commented Apr 25, 2024

This doesn't seem to be the issue with the current version. Please reopen if it is.

@Piedone Piedone closed this as completed Apr 25, 2024
@MikeAlhayek MikeAlhayek modified the milestones: 2.x, 2.0 Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants