SQLite Error 1: 'no such column: w.Scope'
See original GitHub issueI just tried to create a sample Blazor Server app simply running the Elsa Dashboard (to evaluate Elsa). Following the guide, I imported the Elsa, Elsa.Dashboard and Elsa.Persistence.EntityFrameworkCore packages at the latest version (1.4.1) and added the following to the startup.cs file
services
.AddElsa(elsa =>
elsa.AddEntityFrameworkStores<SqliteContext>(configureOptions =>
configureOptions.UseSqlite(@"Data Source=C:\Temp\Data\elsa.db;Cache=Shared;")))
.AddElsaDashboard()
.AddConsoleActivities()
.AddHttpActivities();
I then added a SqliteContextFactory (to set the connection string as above) and deployed the database using dotnet ef database update. However, when running the application, I get the following error:
SqliteException: SQLite Error 1: 'no such column: w.Scope'.
This error disappears if I downgrade the Elsa.Persistence.EntityFramework nuget package to 1.4.0.
Repro project and full stack trace below:
SqliteException: SQLite Error 1: 'no such column: w.Scope'.
Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)
Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable<T>+AsyncEnumerator.InitializeReaderAsync(DbContext _, bool result, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable<T>+AsyncEnumerator.MoveNextAsync()
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync<TSource>(IQueryable<TSource> source, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync<TSource>(IQueryable<TSource> source, CancellationToken cancellationToken)
Elsa.Persistence.EntityFrameworkCore.Services.EntityFrameworkCoreWorkflowInstanceStore.ListByBlockingActivityAsync(string activityType, string correlationId, CancellationToken cancellationToken)
Elsa.Extensions.WorkflowInstanceStoreExtensions.ListByBlockingActivityAsync<TActivity>(IWorkflowInstanceStore store, string correlationId, CancellationToken cancellationToken)
Elsa.Activities.Http.RequestHandlers.Handlers.TriggerRequestHandler.HandleRequestAsync()
Elsa.Activities.Http.Middleware.RequestHandlerMiddleware<THandler>.InvokeAsync(HttpContext httpContext, THandler handler)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
angular - SQLite Error: no such column
1 Answer 1 ... You are using a string to select from the database. The string is not in quotes so it is...
Read more >sqlite - No such column when column exists
The problem is that even though the column sendok exists, when running a query on the database with that field, it throws an...
Read more >No search Movies, SQLite Error 1: 'no such column: ...
Describe the bug No search Movies. To Reproduce Update 3.0.4829. Search any Movie. no show results. Screenshots Logs (Logs directory where ...
Read more >After installation I got this error [SQL logic error no such ...
SQLiteException (0x800007BF): SQL logic error no such column: -1 at System ... Scope scope, Object state, Boolean isCompleted) at Microsoft.
Read more >Getting no such column error for values to be inserted
I assume you want to insert a literal. In SQL, string literals have to be quoted with single quotes. INSERT INTO testTable VALUES...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

As it turns out, Sqlite doesn’t support dropping columns. Instead, the entire table must be dropped and then recreated. I’m disappointed that EF Core actually goes through each migration step even for new databases. I would have expected it to be smart enough to create the database in its final state immediately.
I’ll regenerate the Sqlite migration such that it creates the database in its final state (no creating and dropping columns).
I apologize for the inconvenience this breaking change introduced.
Actually, I’ve just found that even deleting the database file, I still get the database migration error about being unable to drop a column when using Elsa.Persistence.EntityFrameworkCore 1.4.3.
I’ll have to roll back to 1.4.0 and recreate the database to continue my evaluation.