Hey guys, this morning I noticed that some linked assets were not rendering on our website correctly. Even after saving it didnt link correctly.
Tried an upgrade to squidex:latest and all the schemas and data was gone from the UI.
Logged into the mongo db and the data still seems to be there (I can query it in the SquidexContent collection). Tried re-running the docker with the environment variable REBUILD__SCHEMAS=true but no luck.
Please advice?
I have…
[x] Checked the logs and have provided the logs if I found something suspicious there
I’m submitting a…
[x ] Regression (a behavior that stopped working in a new release)
Current behavior
Probably after an upgrade, but not sure since its running kubernetes as squidex:latest
Just a side note, my apps are still available; so its able to reach those correctly, squidex just can not see any schema and or data belonging to those schema anymore
{
05/10/2020 11:06:22 "logLevel": "Fatal",
05/10/2020 11:06:22 "action": "Migration",
05/10/2020 11:06:22 "status": "Failed",
05/10/2020 11:06:22 "migrator": "Migrations.Migrations.ConvertEventStore",
05/10/2020 11:06:22 "app": {
05/10/2020 11:06:22 "name": "Squidex",
05/10/2020 11:06:22 "version": "4.0.0.0",
05/10/2020 11:06:22 "sessionId": "61590431-47de-49fb-b261-4a89582dddca"
05/10/2020 11:06:22 },
05/10/2020 11:06:22 "timestamp": "2020-10-05T09:06:22Z",
05/10/2020 11:06:22 "exception": {
05/10/2020 11:06:22 "type": "System.InvalidCastException",
05/10/2020 11:06:22 "message": "Unable to cast object of type \u0027MongoDB.Bson.BsonDocument\u0027 to type \u0027MongoDB.Bson.BsonString\u0027.",
05/10/2020 11:06:22 "stackTrace": " at Migrations.Migrations.ConvertEventStore.\u003C\u003Ec__DisplayClass2_0.\u003C\u003CUpdateAsync\u003Eb__1\u003Ed.MoveNext() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 54\n--- End of stack trace from previous location where exception was thrown ---\n at MongoDB.Driver.IAsyncCursorExtensions.ForEachAsync[TDocument](IAsyncCursor\u00601 source, Func\u00603 processor, CancellationToken cancellationToken)\n at MongoDB.Driver.IAsyncCursorSourceExtensions.ForEachAsync[TDocument](IAsyncCursorSource\u00601 source, Func\u00602 processor, CancellationToken cancellationToken)\n at Migrations.Migrations.ConvertEventStore.UpdateAsync() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 65\n at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 78"
05/10/2020 11:06:22 }
05/10/2020 11:06:22 }
05/10/2020 11:06:22
05/10/2020 11:06:22 Unhandled exception. Squidex.Infrastructure.Migrations.MigrationFailedException: Failed to run migration 'Migrations.Migrations.ConvertEventStore'
05/10/2020 11:06:22 ---> System.InvalidCastException: Unable to cast object of type 'MongoDB.Bson.BsonDocument' to type 'MongoDB.Bson.BsonString'.
05/10/2020 11:06:22 at Migrations.Migrations.ConvertEventStore.<>c__DisplayClass2_0.<<UpdateAsync>b__1>d.MoveNext() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 54
05/10/2020 11:06:22 --- End of stack trace from previous location where exception was thrown ---
05/10/2020 11:06:22 at MongoDB.Driver.IAsyncCursorExtensions.ForEachAsync[TDocument](IAsyncCursor`1 source, Func`3 processor, CancellationToken cancellationToken)
05/10/2020 11:06:22 at MongoDB.Driver.IAsyncCursorSourceExtensions.ForEachAsync[TDocument](IAsyncCursorSource`1 source, Func`2 processor, CancellationToken cancellationToken)
05/10/2020 11:06:22 at Migrations.Migrations.ConvertEventStore.UpdateAsync() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 65
05/10/2020 11:06:22 at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 78
05/10/2020 11:06:22 --- End of inner exception stack trace ---
05/10/2020 11:06:22 at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 88
05/10/2020 11:06:22 at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 97
05/10/2020 11:06:22 at Squidex.Config.Startup.SafeHostedService.StartAsync(CancellationToken cancellationToken) in /src/src/Squidex/Config/Startup/SafeHostedService.cs:line 29
05/10/2020 11:06:22 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
05/10/2020 11:06:22 at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
05/10/2020 11:06:22 at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
05/10/2020 11:06:22 at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
05/10/2020 11:06:22 at Squidex.Program.Main(String[] args) in /src/src/Squidex/Program.cs:line 24
In general, I recommend never ever to use :latest. Imagine you are using a version :3 and then after a year you add a second instance and the docker image is not cached on this server, then you have :3 and :5 in your cluster. It will fuck everything, even if the version does not contain a bug and is super stable.
If you want you can also send me your database and I can have a look.
Thanks for the update, upgraded to dev-4967, still crash (copy/pasting stacktrace below).
I’ll try to revert to the database I sent you and then run the upgrade again, maybe i changed something in the meanwhile which messed things up.
{
05/10/2020 16:03:30 "logLevel": "Fatal",
05/10/2020 16:03:30 "action": "Migration",
05/10/2020 16:03:30 "status": "Failed",
05/10/2020 16:03:30 "migrator": "Migrations.Migrations.ConvertEventStore",
05/10/2020 16:03:30 "app": {
05/10/2020 16:03:30 "name": "Squidex",
05/10/2020 16:03:30 "version": "4.0.0.0",
05/10/2020 16:03:30 "sessionId": "84965cad-7695-4f96-b14d-8d01c496aa20"
05/10/2020 16:03:30 },
05/10/2020 16:03:30 "timestamp": "2020-10-05T14:03:30Z",
05/10/2020 16:03:30 "exception": {
05/10/2020 16:03:30 "type": "System.InvalidCastException",
05/10/2020 16:03:30 "message": "Unable to cast object of type \u0027MongoDB.Bson.BsonDocument\u0027 to type \u0027MongoDB.Bson.BsonString\u0027.",
05/10/2020 16:03:30 "stackTrace": " at Migrations.Migrations.ConvertEventStore.\u003C\u003Ec__DisplayClass2_0.\u003C\u003CUpdateAsync\u003Eb__1\u003Ed.MoveNext() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 54\n--- End of stack trace from previous location where exception was thrown ---\n at MongoDB.Driver.IAsyncCursorExtensions.ForEachAsync[TDocument](IAsyncCursor\u00601 source, Func\u00603 processor, CancellationToken cancellationToken)\n at MongoDB.Driver.IAsyncCursorSourceExtensions.ForEachAsync[TDocument](IAsyncCursorSource\u00601 source, Func\u00602 processor, CancellationToken cancellationToken)\n at Migrations.Migrations.ConvertEventStore.UpdateAsync() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 65\n at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 78"
05/10/2020 16:03:30 }
05/10/2020 16:03:30 }
05/10/2020 16:03:30
05/10/2020 16:03:30 Unhandled exception. Squidex.Infrastructure.Migrations.MigrationFailedException: Failed to run migration 'Migrations.Migrations.ConvertEventStore'
05/10/2020 16:03:30 ---> System.InvalidCastException: Unable to cast object of type 'MongoDB.Bson.BsonDocument' to type 'MongoDB.Bson.BsonString'.
05/10/2020 16:03:30 at Migrations.Migrations.ConvertEventStore.<>c__DisplayClass2_0.<<UpdateAsync>b__1>d.MoveNext() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 54
05/10/2020 16:03:30 --- End of stack trace from previous location where exception was thrown ---
05/10/2020 16:03:30 at MongoDB.Driver.IAsyncCursorExtensions.ForEachAsync[TDocument](IAsyncCursor`1 source, Func`3 processor, CancellationToken cancellationToken)
05/10/2020 16:03:30 at MongoDB.Driver.IAsyncCursorSourceExtensions.ForEachAsync[TDocument](IAsyncCursorSource`1 source, Func`2 processor, CancellationToken cancellationToken)
05/10/2020 16:03:30 at Migrations.Migrations.ConvertEventStore.UpdateAsync() in /src/src/Migrations/Migrations/ConvertEventStore.cs:line 65
05/10/2020 16:03:30 at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 78
05/10/2020 16:03:30 --- End of inner exception stack trace ---
05/10/2020 16:03:30 at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 88
05/10/2020 16:03:30 at Squidex.Infrastructure.Migrations.Migrator.MigrateAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Migrations/Migrator.cs:line 97
05/10/2020 16:03:30 at Squidex.Config.Startup.SafeHostedService.StartAsync(CancellationToken cancellationToken) in /src/src/Squidex/Config/Startup/SafeHostedService.cs:line 29
05/10/2020 16:03:30 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
05/10/2020 16:03:30 at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
05/10/2020 16:03:30 at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
05/10/2020 16:03:30 at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
05/10/2020 16:03:30 at Squidex.Program.Main(String[] args) in /src/src/Squidex/Program.cs:line 24
The ConvertEventStore is a very old migration. It seems that it is running, but this can only happen when the version field is not correct in the migration.