Open glen-84 opened 1 year ago
I'm observing a similar error on HC 13.8.1. Suddenly my api is in this state, and keep hitting the error on all queries. Unfortunately I don't know how to reproduce.
HotChocolate.SchemaException: For more details look at the Errors
property.
Operation is not valid due to the current state of the object. (HotChocolate.Types.UuidType)
at HotChocolate.Configuration.TypeInitializer.DiscoverTypes()
at HotChocolate.Configuration.TypeInitializer.Initialize()
at HotChocolate.SchemaBuilder.Setup.InitializeTypes(SchemaBuilder builder, IDescriptorContext context, IReadOnlyList`1 types)
at HotChocolate.SchemaBuilder.Setup.Create(SchemaBuilder builder, LazySchema lazySchema, IDescriptorContext context)
at HotChocolate.SchemaBuilder.Create(IDescriptorContext context)
at HotChocolate.SchemaBuilder.HotChocolate.ISchemaBuilder.Create(IDescriptorContext context)
at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaAsync(ConfigurationContext context, RequestExecutorSetup setup, RequestExecutorOptions executorOptions, IServiceProvider schemaServices, TypeModuleChangeMonitor typeModuleChangeMonitor, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaServicesAsync(ConfigurationContext context, RequestExecutorSetup setup, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.GetRequestExecutorNoLockAsync(String schemaName, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.GetRequestExecutorAsync(String schemaName, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorProxy.GetRequestExecutorAsync(CancellationToken cancellationToken)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.<>c__DisplayClass19_0.<
It throws an InvalidOperationException in TypeSystemObjectBase.MarkInitialized() (for the UuidType), as _status = TypeStatus.Finalized
I just watch with --no-hot-reload
.
Hi guys, I switched from 2 separate projects (1 Blazor WASM with dev server and 1 Backend API) to a hosted WASM solution (still two projects, but the backend has a dependency to the WASM project, builds and hosts it). Now this error occurs during hot reload and it is a really strange thing. I can change anything on the backend code and it rebuilds just fine using hot reload, but if I dare to add a CSS class or a tag in a razor page, hot reload kicks in and after that this error happens. The problem is, that my client application (the WASM Blazor) only gets an error 500 on all graphql calls and the exception page doesn't show anything because HotChocolate prevents the error from bubbling up. So I replaced the Error Page with an error handler to inspect the mentioned "Errrors" property which was so gravefully covered and here is the StackTrace it gave me:
at HotChocolate.Types.Descriptors.Convention`1.AssertUninitialized()
at HotChocolate.Types.Descriptors.Convention`1.Initialize(IConventionContext context)
at HotChocolate.Types.Descriptors.DescriptorContext.MergeExtensions(IConventionContext context, Convention convention, IList`1 extensions)
at HotChocolate.Types.Descriptors.DescriptorContext.GetConventionOrDefault[T](Func`1 defaultConvention, String scope)
at HotChocolate.Data.FilterDescriptorContextExtensions.GetFilterConvention(IDescriptorContext context, String scope)
at HotChocolate.Types.FilterObjectFieldDescriptorExtensions.<>c__DisplayClass5_0.<UseFiltering>b__1(IDescriptorContext c, ObjectFieldDefinition definition)
at HotChocolate.Types.Descriptors.DescriptorBase`1.<>c__DisplayClass19_0.<OnBeforeCreate>b__0(IDescriptorContext c, IDefinition d)
at HotChocolate.Types.Descriptors.Definitions.CreateConfiguration.Configure(IDescriptorContext context)
at HotChocolate.Types.Descriptors.DescriptorBase`1.CreateDefinition()
at HotChocolate.Types.Descriptors.ObjectTypeDescriptor.OnCreateDefinition(ObjectTypeDefinition definition)
at HotChocolate.Types.Descriptors.DescriptorBase`1.CreateDefinition()
at HotChocolate.Types.ObjectType`1.CreateDefinition(ITypeDiscoveryContext context)
at HotChocolate.Types.TypeSystemObjectBase`1.Initialize(ITypeDiscoveryContext context)
at HotChocolate.Configuration.TypeRegistrar.InitializeType(TypeSystemObjectBase typeSystemObject, String scope, Boolean isInferred)
The only way this exception @glen-84 mentions Operation is not valid due to the current state of the object.
could be triggered is when the definition is initialized but null. So my wild guess is, that hot reload somehow kills the definition object and let the initializer run once more, resulting in this behavior.
I also tried to get some information on how hot reload internally works because it seems a bit odd, that I change something in project A and things disappear in project B, but that's out of my league :/
If @michaelstaib can point me in a direction I would gladly contribute a PR.
Cheers
Is there an existing issue for this?
Product
Hot Chocolate
Describe the bug
With Hot Reload enabled for a while, I start seeing the exception listed below.
Steps to reproduce
dotnet watch
.(I'm not able to be more specific.)
Relevant log output
Additional Context?
No response
Version
13.0.0-rc.7