GetContentVersion API return 500

I have…

  • Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

  • Regression (a behavior that stopped working in a new release)
  • Bug report
  • Performance issue
  • Documentation issue or request

Current behavior

When trying to Load or Compare changes, the API returns 500

Expected behavior

The same behavior as the latest version without this issue - 7.18.0

Minimal reproduction of the problem

Click Load or Compare

Environment

  • Self hosted with docker
  • Self hosted with IIS
  • Self hosted with other version
  • Cloud version

Version: dev-8471

Browser:

  • Chrome (desktop)
  • Chrome (Android)
  • Chrome (iOS)
  • Firefox
  • Safari (desktop)
  • Safari (iOS)
  • IE
  • Edge

Others:

StackTrace from Azure Application Insights:

System.InvalidOperationException:
   at Squidex.Infrastructure.ThrowHelper.InvalidOperationException (Squidex.Infrastructure, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Infrastructure/ThrowHelper.cs:31)
   at Squidex.Infrastructure.States.Persistence`1+<ReadEventsAsync>d__24.MoveNext (Squidex.Infrastructure, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Infrastructure/States/Persistence.cs:143)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Squidex.Infrastructure.States.Persistence`1+<ReadAsync>d__22.MoveNext (Squidex.Infrastructure, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Infrastructure/States/Persistence.cs:93)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Squidex.Infrastructure.Commands.DomainObject`1+<GetSnapshotAsync>d__16.MoveNext (Squidex.Infrastructure, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Infrastructure/Commands/DomainObject.cs:127)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentLoader+<GetAsync>d__5.MoveNext (Squidex.Domain.Apps.Entities, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentLoader.cs:52)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentLoader+<GetAsync>d__3.MoveNext (Squidex.Domain.Apps.Entities, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentLoader.cs:25)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentQueryService+<FindAsync>d__9.MoveNext (Squidex.Domain.Apps.Entities, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs:77)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Squidex.Areas.Api.Controllers.Contents.ContentsController+<GetContentVersion>d__10.MoveNext (Squidex, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null: /src/src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs:281)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+TaskOfIActionResultExecutor+<Execute>d__0.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeActionMethodAsync>g__Logged|12_1>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeNextActionFilterAsync>g__Awaited|10_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeInnerFilterAsync>g__Awaited|13_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeNextExceptionFilterAsync>g__Awaited|26_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)

You have not posted the actual exception message. But I am pretty sure that this data is just broken. I need a DB dumb

Working on it at the moment, but might consider waiting until next week

Good day, Sebastian. I got a DB dump. Do you have any place where I can upload 2 archives (~approx 600mb)?

No I dont, people jst use dropbox or something similar.

Ok, I’ll clarify this from our side and reach back to you

Sebastian, could you share the email address to be used for DB dump access?

Send me a PM here, plz

Done, please check your PM. Thanks in advance

Is this the complete DB with all collections?

I hope so.
Unfortunately, I wasn’t able to test it by myself, and I had to ask another team to create this dump. I can try restoring it on the local machine and comparing it with the actual DB structure.
Was there an issue during mongorestore, or have you not tried yet?

Sorry, it works fine. I just thought that the structure looks so unfamiliar.

No problem. Probably an old structure, as I know for sure DB has existed since v6 or even older versions.
Now, I’ll check and provide you exact IDs, where I was able to catch issues

1 Like

@Sebastian please check PM, I provided additional data about items where issue is reproducible at the moment. Let me know if you need more info. Thanks

Good day, @Sebastian. Found this Squidex custom exception message in our Application Insights regarding Status Code 500: “Events must follow the snapshot version in consecutive order with no gaps.”
What exactly does this message mean, and how can it be fixed?

It means that there are events missing or there are inconsistencies. I think the inconsistencies should be fixed automatically.

You could check the events for this content item and see if you have gaps, e.g. only event0, event1, event3 (so event2 is missing)

Will I understand from the logs what events are missing, or should I research the DB for this?

No, the logs are not clear here. I can improve that for next time.