Open AndyButland opened 10 months ago
Wierd one indeed, this works for me π
I installed 12.0.1 using dotnet new install Umbraco.Templates::12.0.1
I installed and just created a content.
Then updated to 13.0.0--rc.preview.28.g42bc50e
That worked just fine π€
Hmm... maybe ignore the first issue then, as it wasn't really clear to my why it happened and why I was able to migrate via 12.2, as it ran the same things.
But perhaps there is something to think about with regard the newer migrations that I see are now using EF Core.
The existing migrations tend to do a check to see if something exists before creating it - e.g. like this one.
With the new ones though, there's not that equivalent - so that might cause issues if re-running migrations on a database that's already updated. I know we do that in development a fair bit when switching branches. Not sure if there are other cases where someone using Umbraco might run into it though. At least it's different though, so probably should be thought about and maybe see if a check for existence should be added to the EF core migrations.
Agreed, we should probably look into this.
EFCore does that the __EFMigrationsHistory
which should keep track of which migrations has been run, but we should probably keep them idempotent anyways π€
Hi Folks,
I am also hitting this error however I haven't been able to resolve it. The migration will not run. All I see is the Migration record getting added to umbracoKeyValue. When @AndyButland said 'When I deleted the tables', what tables did you actually delete?
Trying to go from 12.0.1 to 12.2.0
Cheers,
Marc
When @AndyButland said 'When I deleted the tables', what tables did you actually delete?
The umbracoOpenIddict*
ones - that the migration was trying to add and would fail if they already existed.
Hi Andy, thanks for getting back so quickly. I dont get these tables created. Migration just fails. User in connection string has full permissions to create tables so a bit lost at why the migration is failing.
I think I'm seeing the same issue as Marc here. I'm upgrading a v12 site to v13 and I'm getting an error SqliteException: SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.
As you can see, I'm using SQLite and so I'm wondering if this is part of the issue? (not sure what Marc using)
When I look in the DB the table doesn't exist so the migration hasn't run, but more interesting, there isn't a __EFMigrationsHistory
table either so I'm wondering if this is what is causing this migration to fail seeing as that table is created via an EFCore migration.
Hmm, deleting the core migration line in umbracoKeyValue
and re-running the migrations seems to have done it. Weirdly, but prior and after migration, my DB record states the value as {C76D9C9A-635B-4D2C-A301-05642A523E9D}
yet I can't see a migration step with that ID in the Umbraco migration plan π€
We've just had a go at this, and could still not reproduce. I'm wondering what version you tried to upgrade from? π€
We've tried from 12.0.1, but I do see this migration in 12.1 To<V_12_1_0.AddOpenIddict>("{47DE85CE-1E16-42A0-8AF6-3EC3BCEF5471}");
Just got the same error when upgrading to v14 beta
SqliteException: SQLite Error 1: 'no such table: umbracoOpenIddictApplications'.
Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(int rc, sqlite3 db)
Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+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.Query.Internal.SingleQueryingEnumerable<T>+AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable<T>+AsyncEnumerator.MoveNextAsync()
System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>+ConfiguredValueTaskAwaiter.GetResult()
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.0.0--rc.preview.28.g42bc50e
Bug summary
When starting up Umbraco, I go to
/install
and run the upgrade. It fails with the following message:Running a second time I get:
Specifics
I'm was originally upgrading from a 12.0.1 website and got the first error.
I then retried first going to 12.2.0, and that was OK, apart from the second error. When I deleted the tables, I could proceed and complete. And then when I upgraded to the 13 preview, no further upgrade was needed.
I'm not sure quite what happened with the first issue unless you can replicate when trying a similar upgrade from 12.0,1.
But probably the upgrade step that adds the OpenIddict tables should be made idempotent, so it just skips over tables that already exist and doesn't try to create them again.
Steps to reproduce
Try to upgrade from 12.0.1 to 13.0.0--rc.preview.28.g42bc50e
Expected result / actual result
Should upgrade without error, and should be able to re-run the migrations without an error due to tables already existing.