JSS FormatException: DebugOnly

Created: 12 Dec 2018, last update: 30 Jan 2022

JSS FormatException: DebugOnly

When Upgrading from JSS tech preview to Sitecore 9.1 with Sitecore JavaScript Services 11.0 I got a Error about my GraphQL endpoint configuration. Or when you use the master GraphQL endpoint example on  https://jss.sitecore.com/ it is easy to fix.

Take the sample from \App_Config\Sitecore\Services.GraphQL

Or change:

 <gui role:require="!ContentDelivery">DebugOnly (follow web.config compilation setting)</gui>

to

 <gui role:require="!ContentDelivery">false</gui>

and this error is gone:

Server Error in '/' Application.


String was not recognized as a valid Boolean.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: String was not recognized as a valid Boolean.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[FormatException: String was not recognized as a valid Boolean.]
   System.Boolean.Parse(String value) +14660180
   System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) +132

[FormatException: DebugOnly (follow web.config compilation setting) is not a valid value for Boolean.]
   System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) +372
   Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, PropertyInfo property, Object value) +228
   Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, String name, Object value) +207
   Sitecore.Configuration.DefaultFactory.AssignProperties(Object obj, Object[] properties) +1512
   Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +620
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +320
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +68
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode) +242
   Sitecore.Services.GraphQL.Hosting.Configuration.GraphQLEndpointManager.CreateEndpoint(XmlNode node) +40

[InvalidOperationException: Unable to create GraphQL endpoint due to a factory error. The faulted endpoint definition was <master type="Sitecore.Services.GraphQL.Hosting.GraphQLEndpoint, Sitecore.Services.GraphQL.NetFxHost" url="/sitecore/api/graph/items/master" resolve="true"><url>$(url)</url><enabled>true</enabled><gui>DebugOnly (follow web.config compilation setting)</gui><schema hint="list:AddSchemaProvider"><!-- defaults are defined in Sitecore.Services.GraphQL.Content.config --><content ref="/sitecore/api/GraphQL/defaults/content/schemaProviders/systemContent" param1="master" /></schema><!-- Determines the security of the service. Defaults are defined in Sitecore.Services.GraphQL.config --><security ref="/sitecore/api/GraphQL/defaults/security/systemService" /><!-- Determines how performance is logged for the service. Defaults are defined in Sitecore.Services.GraphQL.config --><performance ref="/sitecore/api/GraphQL/defaults/performance/standard" /><!--
                            Cache improves the query performance by caching parsed queries.
                            It is also possible to implement query whitelisting by implementing an authoritative query cache;
                            WhitelistingGraphQLQueryCache is an example of this, capturing queries to files in open mode and allowing only captured queries in whitelist mode.
                        --><cache type="Sitecore.Services.GraphQL.Hosting.QueryTransformation.Caching.GraphQLQueryCache, Sitecore.Services.GraphQL.NetFxHost"><param desc="name">$(url)</param><param desc="maxSize">10MB</param></cache><!-- 
                            Extenders allow modifying schema types after they are created by a schema provider but before they are added to the final schema.
                            This is useful when you want to _extend_ a generated schema, for example to add external API
                            data onto the item API, or to add in custom internal data (e.g. custom layout data to power an app)
                            without having to directly modify a schema provider.

                            Extenders must derive from SchemaExtender.
                        --><extenders hint="list:AddExtender"><!-- enables the 'jss' property on item fields, which is appropriate to pass to field helper components in any JSS language --><jssExtender type="Sitecore.JavaScriptServices.GraphQL.JssExtender, Sitecore.JavaScriptServices.GraphQL" resolve="true" /></extenders></master>]
   Sitecore.Services.GraphQL.Hosting.Configuration.GraphQLEndpointManager.CreateEndpoint(XmlNode node) +166
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +238
   System.Linq.WhereEnumerableIterator`1.MoveNext() +124
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +436
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +69
   Sitecore.Services.GraphQL.Hosting.Configuration.GraphQLEndpointManager..ctor() +302
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCreateInstance(CreateInstanceCallSite createInstanceCallSite, ServiceProviderEngineScope scope) +152
   Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) +125
   Microsoft.Extensions.DependencyInjection.ServiceLookup.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope) +141
   Microsoft.Extensions.DependencyInjection.ConstructorMatcher.CreateInstance(IServiceProvider provider) +125
   Sitecore.Configuration.DefaultFactory.CreateFromServiceProvider(XmlNode configNode, Boolean assert) +481

[ConfigurationException: Could not create object from service provider . Config XML: <handler type="Sitecore.Services.GraphQL.Content.EventHandlers.TemplateUpdateHandler, Sitecore.Services.GraphQL.Content" method="OnItemCopied" resolve="true" patch:source="Sitecore.Services.GraphQL.Content.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />]
   Sitecore.Configuration.DefaultFactory.CreateFromServiceProvider(XmlNode configNode, Boolean assert) +641
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +138
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +68
   Sitecore.Events.EventSubscribers.Add(String eventName, XmlNode configNode) +556
   Sitecore.Events.Event.BuildConfigSubscribersFromConfiguration() +348
   Sitecore.DependencyInjection.LazyResetable`1.get_Value() +150
   Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters) +392
   Sitecore.ContentSearch.Maintenance.IndexDatabasePropertyStore.Get(String key) +205
   Sitecore.ContentSearch.SolrProvider.SolrIndexSummary.get_LastUpdatedTimestamp() +82
   Sitecore.ContentSearch.Maintenance.Strategies.BaseAsynchronousStrategy.LogStrategyInitialization(ISearchIndex index) +94
   Sitecore.ContentSearch.Maintenance.Strategies.BaseAsynchronousStrategy.Initialize(ISearchIndex searchIndex) +83
   Sitecore.ContentSearch.Maintenance.Strategies.IntervalAsynchronousStrategy.Initialize(ISearchIndex searchIndex) +18
   Sitecore.ContentSearch.TypeActionHelper.Call(Action`1 action, IEnumerable`1 instances) +197
   Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +180
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169
   (Object , Object ) +9
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Nexus.Web.HttpModule.Application_Start() +215
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +1164
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +581
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): Could not create object from service provider . Config XML: <handler type="Sitecore.Services.GraphQL.Content.EventHandlers.TemplateUpdateHandler, Sitecore.Services.GraphQL.Content" method="OnItemCopied" resolve="true" patch:source="Sitecore.Services.GraphQL.Content.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714