Trying to run latest docker image with existing database throws error

Hi Sebastian,

I am trying to run the latest docker image and am getting the following error, its been a while since i have updated, seems like migrations for the Assets Mongodb are not being applied?

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.

   at Squidex.Domain.Apps.Entities.MongoDb.Assets.MongoAssetRepository.Squidex.Infrastructure.States.ISnapshotStore<Squidex.Domain.Apps.Entities.Assets.State.AssetState,System.Guid>.WriteAsync(Guid key, AssetState value, Int64 oldVersion, Int64 newVersion) in /src/src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository_SnapshotStore.cs:line 48

   at Squidex.Infrastructure.Commands.LogSnapshotDomainObject`1.RebuildStateAsync() in /src/src/Squidex.Infrastructure/Commands/LogSnapshotDomainObject.cs:line 106

   at Squidex.Infrastructure.Commands.Rebuilder.<>c__DisplayClass7_0`2.<<InsertManyAsync>b__0>d.MoveNext() in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 78

--- End of stack trace from previous location where exception was thrown ---

   at Squidex.Infrastructure.Commands.Rebuilder.InsertManyAsync[T,TState](IdSource source, CancellationToken ct) in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 104

   at Squidex.Infrastructure.Commands.Rebuilder.RebuildAsync[T,TState](IdSource source, CancellationToken ct) in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 63

   at Migrations.RebuildRunner.RunAsync(CancellationToken ct) in /src/src/Migrations/RebuildRunner.cs:line 54

   at Squidex.Config.Startup.SafeHostedService.StartAsync(CancellationToken cancellationToken) in /src/src/Squidex/Config/Startup/SafeHostedService.cs:line 29

   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)

   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)

   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)

   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)

   at Squidex.Program.Main(String[] args) in /src/src/Squidex/Program.cs:line 25

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)
  • [ ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Expected behavior

Minimal reproduction of the problem


  • [X] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [VERSION]


  • [X] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge


Can you create a backup of your DB with mongo restore and send me a link where I can download it?

Please find databases at

[Redacted Link]

i used mongodump to create the files


Do you have an older version before the migration was running? this DB looks up to date.

It looks like you have used the latest beta and then a 4.X version after that. This is not supported.

Hi Sebastian,

I have managed to retrieve the live database and restore it to our dev instance and set the release version to 4.5.1 just to be on the safe side and it has worked and the docker instance came up as expected. i will make sure not to use :latest in the future. I am sure i have run in to this in the past and not updated it then :rofl:

thanks for the help

1 Like