[SOLVED] NullReferenceException after update to 7.10.0

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.
{
  "logLevel": "Error",
  "message": "An unexpected exception has occurred.",
  "timestamp": "2023-12-19T16:29:30Z",
  "app": {
    "name": "Squidex",
    "version": "7.10.0.0",
    "sessionId": "01b3a2a3-4c62-461b-b898-1732cb33dde5"
  },
  "web": {
    "requestId": "00-2fafa56f1faea349c52bb4ea523fd873-847fc496a99e7834-01",
    "requestPath": "/api/apps/XXX/schemas",
    "requestMethod": "GET",
    "routeValues": {
      "area": "api",
      "action": "GetSchemas",
      "controller": "Schemas"
    }
  },
  "category": "Squidex.Web.ApiExceptionFilterAttribute",
  "exception": {
    "type": "System.NullReferenceException",
    "message": "Object reference not set to an instance of an object.",
    "stackTrace": "   at Squidex.Web.Resources.Url[T](Func\u00602 action, Object values) in /src/src/Squidex.Web/Resources.cs:line 169\n   at Squidex.Areas.Api.Controllers.Schemas.Models.SchemaDto.CreateLinks(Resources resources) in /src/src/Squidex/Areas/Api/Controllers/Schemas/Models/SchemaDto.cs:line 154\n   at Squidex.Areas.Api.Controllers.Schemas.Models.SchemaDto.FromDomain(Schema schema, Resources resources) in /src/src/Squidex/Areas/Api/Controllers/Schemas/Models/SchemaDto.cs:line 143\n   at Squidex.Areas.Api.Controllers.Schemas.Models.SchemasDto.\u003C\u003Ec__DisplayClass4_0.\u003CFromDomain\u003Eb__0(Schema x) in /src/src/Squidex/Areas/Api/Controllers/Schemas/Models/SchemasDto.cs:line 24\n   at System.Linq.Enumerable.SelectListIterator\u00602.ToArray()\n   at Squidex.Areas.Api.Controllers.Schemas.Models.SchemasDto.FromDomain(IList\u00601 schemas, Resources resources) in /src/src/Squidex/Areas/Api/Controllers/Schemas/Models/SchemasDto.cs:line 22\n   at Squidex.Areas.Api.Controllers.Schemas.SchemasController.\u003C\u003Ec__DisplayClass2_0.\u003CGetSchemas\u003Eb__0() in /src/src/Squidex/Areas/Api/Controllers/Schemas/SchemasController.cs:line 56\n   at Squidex.Web.Deferred.\u003C\u003Ec__DisplayClass4_0.\u003CResponse\u003Eb__0() in /src/src/Squidex.Web/Deferred.cs:line 30\n   at System.Lazy\u00601.ViaFactory(LazyThreadSafetyMode mode)\n   at System.Lazy\u00601.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)\n   at System.Lazy\u00601.CreateValue()\n   at Squidex.Web.Pipeline.DeferredActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) in /src/src/Squidex.Web/Pipeline/DeferredActionFilter.cs:line 21\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeInnerFilterAsync\u003Eg__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextExceptionFilterAsync\u003Eg__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"
  }
}
{
  "logLevel": "Error",
  "message": "An unexpected exception has occurred.",
  "timestamp": "2023-12-19T16:29:32Z",
  "app": {
    "name": "Squidex",
    "version": "7.10.0.0",
    "sessionId": "01b3a2a3-4c62-461b-b898-1732cb33dde5"
  },
  "web": {
    "requestId": "00-d48a4b41f06bca52e3937d469f845bf8-1be497c0ac998258-01",
    "requestPath": "/api/content/XXX/graphql",
    "requestMethod": "GET"
  },
  "category": "Squidex.Web.Pipeline.RequestExceptionMiddleware",
  "exception": {
    "type": "System.ArgumentException",
    "message": "String parameter cannot be null or empty and cannot contain only blanks. (Parameter \u0027name\u0027)",
    "stackTrace": "   at Squidex.Infrastructure.ThrowHelper.ArgumentException(String message, String paramName) in /src/src/Squidex.Infrastructure/ThrowHelper.cs:line 16\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.ReservedNames.GetName(String name) in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ReservedNames.cs:line 57\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.ReservedNames.get_Item(String name) in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ReservedNames.cs:line 18\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents.SchemaInfo.Build(IEnumerable\u00601 schemas, ReservedNames typeNames)\u002BMoveNext() in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/SchemaInfo.cs:line 59\n   at System.Linq.Enumerable.WhereEnumerableIterator\u00601.MoveNext()\n   at Squidex.Infrastructure.CollectionExtensions.AddRange[T](ICollection\u00601 target, IEnumerable\u00601 source) in /src/src/Squidex.Infrastructure/CollectionExtensions.cs:line 193\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Builder.BuildSchema(IEnumerable\u00601 schemas) in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Builder.cs:line 67\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.CachingGraphQLResolver.CreateModelAsync(App app) in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLResolver.cs:line 96\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.CachingGraphQLResolver.\u003C\u003Ec__DisplayClass12_0.\u003C\u003CGetModelEntryAsync\u003Eb__0\u003Ed.MoveNext() in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLResolver.cs:line 79\n--- End of stack trace from previous location ---\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.CachingGraphQLResolver.GetSchemaAsync(App app) in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLResolver.cs:line 63\n   at Squidex.Domain.Apps.Entities.Contents.GraphQL.CachingGraphQLResolver.ExecuteAsync(ExecutionOptions options, ExecutionDelegate next) in /src/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLResolver.cs:line 55\n   at GraphQL.DocumentExecuter.\u003C\u003Ec__DisplayClass7_0.\u003C\u003CBuildExecutionDelegate\u003Eb__1\u003Ed.MoveNext() in /_/src/GraphQL/Execution/DocumentExecuter.cs:line 67\n--- End of stack trace from previous location ---\n   at GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware.ExecuteRequestAsync(HttpContext context, GraphQLRequest request, IServiceProvider serviceProvider, IDictionary\u00602 userContext) in /_/src/Transports.AspNetCore/GraphQLHttpMiddleware.cs:line 454\n   at GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware.HandleRequestAsync(HttpContext context, RequestDelegate next, GraphQLRequest gqlRequest) in /_/src/Transports.AspNetCore/GraphQLHttpMiddleware.cs:line 333\n   at GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /_/src/Transports.AspNetCore/GraphQLHttpMiddleware.cs:line 186\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeResultAsync\u003Eg__Logged|22_0(ResourceInvoker invoker, IActionResult result)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextResultFilterAsync\u003Eg__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()\n--- End of stack trace from previous location ---\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextResourceFilter\u003Eg__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\n--- End of stack trace from previous location ---\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeAsync\u003Eg__Logged|17_1(ResourceInvoker invoker)\n   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n   at Squidex.Web.Pipeline.UsageMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /src/src/Squidex.Web/Pipeline/UsageMiddleware.cs:line 39\n   at Squidex.Web.Pipeline.UsageMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in /src/src/Squidex.Web/Pipeline/UsageMiddleware.cs:line 77\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.\u003C\u003Ec__DisplayClass2_0.\u003C\u003CCreateMiddleware\u003Eb__0\u003Ed.MoveNext()\n--- End of stack trace from previous location ---\n   at Squidex.Web.Pipeline.RequestExceptionMiddleware.InvokeAsync(HttpContext context, IActionResultExecutor\u00601 writer, ILogger\u00601 log) in /src/src/Squidex.Web/Pipeline/RequestExceptionMiddleware.cs:line 42"
  }
}

I’m submitting a…

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

Current behavior

Updating the version number from 7.9.0 to 7.10.0 in our Terraform scripts produces NullReferenceException and don’t let us fetch content or schema information.

Expected behavior

The migrations will be executed proper and all APIs work fine.

Minimal reproduction of the problem

  • The Version 7.9.0 is installed at Kubernetes with a MongoDB Database
  • Update to version 7.10.0
  • Try to show content in admin inerface

Environment

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

Version: 7.10.0

Browser:

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

Others:

I think this is actually the same error. Would you be able to send me a backup of your database?

OMG. I have written a fallback serializer (because the format has changed slightly), I have written tests for that, but I have forgotten to register it :frowning:

Can you test squidex/squidex:dev-7836 If it works, I can publish a new release asap.

Hi,

thanks for the quick feedback

At 5pm CEST I am able to test the new version.

Hi Sebastian,

the selection of an actual schema of the schemas page works fine now.
But selecting one of the schemas in the content page fails with:

image

Here the exception from the logs:

"category": "Squidex.Web.ApiExceptionFilterAttribute",
  "exception": {
    "type": "System.FormatException",
    "message": "Required element \u0027dl\u0027 for property \u0027IsDeleted\u0027 of class Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentEntity is missing.",
    "stackTrace": "   at MongoDB.Bson.Serialization.BsonClassMapSerializer\u00601.DeserializeClass(BsonDeserializationContext context)\n   at MongoDB.Bson.Serialization.BsonClassMapSerializer\u00601.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)\n   at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer\u00601 serializer, BsonDeserializationContext context)\n   at MongoDB.Driver.Core.Operations.CursorBatchDeserializationHelper.DeserializeBatch[TDocument](RawBsonArray batch, IBsonSerializer\u00601 documentSerializer, MessageEncoderSettings messageEncoderSettings)\n   at MongoDB.Driver.Core.Operations.FindOperation\u00601.CreateFirstCursorBatch(BsonDocument cursorDocument)\n   at MongoDB.Driver.Core.Operations.FindOperation\u00601.CreateCursor(IChannelSourceHandle channelSource, IChannelHandle channel, BsonDocument commandResult)\n   at MongoDB.Driver.Core.Operations.FindOperation\u00601.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Operations.FindOperation\u00601.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)\n   at MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync[TResult](IReadBinding binding, IReadOperation\u00601 operation, CancellationToken cancellationToken)\n   at MongoDB.Driver.MongoCollectionImpl\u00601.ExecuteReadOperationAsync[TResult](IClientSessionHandle session, IReadOperation\u00601 operation, ReadPreference readPreference, CancellationToken cancellationToken)\n   at MongoDB.Driver.MongoCollectionImpl\u00601.UsingImplicitSessionAsync[TResult](Func\u00602 funcAsync, CancellationToken cancellationToken)\n   at MongoDB.Driver.IAsyncCursorSourceExtensions.ToListAsync[TDocument](IAsyncCursorSource\u00601 source, CancellationToken cancellationToken)\n   at Squidex.Infrastructure.MongoDb.MongoExtensions.ToListRandomAsync[T](IFindFluent\u00602 find, IMongoCollection\u00601 collection, Int64 take, CancellationToken ct) in /src/src/Squidex.Infrastructure.MongoDb/MongoDb/MongoExtensions.cs:line 236\n   at Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations.Extensions.QueryContentsAsync(IMongoCollection\u00601 collection, FilterDefinition\u00601 filter, ClrQuery query, Q q, CancellationToken ct) in /src/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Extensions.cs:line 149\n   at Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations.QueryByQuery.QueryAsync(Schema schema, Q q, CancellationToken ct) in /src/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryByQuery.cs:line 98\n   at Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentCollection.QueryAsync(App app, Schema schema, Q q, CancellationToken ct) in /src/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentCollection.cs:line 206\n   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentQueryService.QueryCoreAsync(Context context, Q q, Schema schema, CancellationToken ct) in /src/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs:line 270\n   at Squidex.Domain.Apps.Entities.Contents.Queries.ContentQueryService.QueryAsync(Context context, String schemaIdOrName, Q q, CancellationToken ct) in /src/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs:line 132\n   at Squidex.Areas.Api.Controllers.Contents.ContentsController.GetContentsPost(String app, String schema, QueryDto query) in /src/src/Squidex/Areas/Api/Controllers/Contents/ContentsController.cs:line 124\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeActionMethodAsync\u003Eg__Logged|12_1(ControllerActionInvoker invoker)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeNextActionFilterAsync\u003Eg__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State\u0026 next, Scope\u0026 scope, Object\u0026 state, Boolean\u0026 isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.\u003CInvokeInnerFilterAsync\u003Eg__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.\u003CInvokeNextExceptionFilterAsync\u003Eg__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"
  }

Kind regards

it is squidex/squidex:dev-7838

1 Like

Hi,

it works fine now :slight_smile:
We can query all contents.

We will use your dev image until the new version is deployed.
Thanks for the fast support!

Kind regards

1 Like