question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error - Unable to Login

See original GitHub issue

I’m getting the following exception when I login. The OpenIddictAuthorizations only has the colums Id, ApplicationId, Scope, Status, and Subject. Could there have been some version changes in OpenIddict?

  Activated	Event	Time	Duration	Thread
Program Output: Microsoft.EntityFrameworkCore.Database.Command:Error: Failed executing DbCommand (90ms) [Parameters=[@p0='?' (Size = 450), @p1='?' (Size = 450), @p2='?' (Size = 4000), @p3='?' (Size = 4000), @p4='?' (Size = 4000), @p5='?' (Size = 4000)], CommandType='Text', CommandTimeout='30']

SET NOCOUNT ON; INSERT INTO [OpenIddictAuthorizations] ([Id], [ApplicationId], [Scopes], [Status], [Subject], [Type]) VALUES (@p0, @p1, @p2, @p3, @p4, @p5); SELECT [Timestamp] FROM [OpenIddictAuthorizations] WHERE @@ROWCOUNT = 1 AND [Id] = @p0;

System.Data.SqlClient.SqlException (0x80131904): Invalid column name ‘Scopes’. Invalid column name ‘Type’. Invalid column name ‘Timestamp’. at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__108_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.<ExecuteAsync>d__17.MoveNext() ClientConnectionId:4563d889-c9bd-4b61-a2e2-dcec43c20bd6 Error Number:207,State:1,Class:16 63.55s

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
garyhoff1commented, Oct 31, 2017

To fix the OpenIddict database errors I changed the following in Migrations 20170913022214_Initial.cs. It fixed the issue, I can now login. Not sure if there are any other attributes (nullable or not) that I might have wrong.

                name: "OpenIddictAuthorizations",
                columns: table => new
                {
                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ApplicationId = table.Column<string>(type: "nvarchar(450)", nullable: true),
                    Scopes = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Subject = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Timestamp = table.Column<string>(type: "timestamp", nullable: false),
                },

                name: "OpenIddictTokens",
                columns: table => new
                {
                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ApplicationId = table.Column<string>(type: "nvarchar(450)", nullable: true),
                    AuthorizationId = table.Column<string>(type: "nvarchar(450)", nullable: true),
                    Ciphertext = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    End = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Hash = table.Column<string>(type: "nvarchar(450)", nullable: true),
                    Start = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Status = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Subject = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ExpirationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Timestamp = table.Column<string>(type: "timestamp", nullable: false)
                },
1reaction
garyhoff1commented, Oct 29, 2017

I’m also getting the error Invalid column name ‘Scopes’, ‘Type’, ‘Timestamp’ on table OpenIddictAuthorizations. I uninstalled and installed Install AspNet.Security.OAth.Valivation 2.0.0-rc1-0286 (final), Changed DAL.cspfoj:

PackageReference Include="OpenIddict" Version="2.0.0-rc1-final"
PackageReference Include="OpenIddict.EntityFrameworkCore" Version="2.0.0-rc1-final"

Still get error. I drop the database after each try so it rebuilds the tables.

Code in Migrations\20170913022214_Initial.cs:
            migrationBuilder.CreateTable(
                name: "OpenIddictAuthorizations",
                columns: table => new
                {
                    Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    ApplicationId = table.Column<string>(type: "nvarchar(450)", nullable: true),
                    Scope = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Subject = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },

Does this need to be changed to include the new columns?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows error message: "We can't sign in to your account"
If you still can't sign in, try creating a new local administrator account, sign in to that new account, then follow the steps...
Read more >
Can't sign in to your Google Account
You know your username and password, but you can't sign in. You think someone else is using your account. You're having trouble with...
Read more >
I can't log in to a website - WhatIsMyBrowser.com
Having trouble logging into a website? There are lots of things that could be wrong. Here's a detailed guide to help you find...
Read more >
Fix login issues on websites that require a username and ...
Fix login issues on websites that require a username and password · Enable cookies for the website · Clear history for that site...
Read more >
How to Fix Windows 10 Login Problems [EXPERT GUIDE]
One of these problems is the fact that users can't log into Windows 10 at all. This is a serious error, as it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found