Title: Help needed debugging NonNullableValueCoercedAsNullException · graphql-java/graphql-java · Discussion #2760 · GitHub
Open Graph Title: Help needed debugging NonNullableValueCoercedAsNullException · graphql-java/graphql-java · Discussion #2760
X Title: Help needed debugging NonNullableValueCoercedAsNullException · graphql-java/graphql-java · Discussion #2760
Description: Help needed debugging NonNullableValueCoercedAsNullException
Open Graph Description: I'm seeing random NonNullableValueCoercedAsNullExceptions from our servers running graphql-java 17.3 with graphql-java-tools 12.0.2. I've logged the entire GraphQL query, variables, and operation n...
X Description: I'm seeing random NonNullableValueCoercedAsNullExceptions from our servers running graphql-java 17.3 with graphql-java-tools 12.0.2. I've logged the entire GraphQL query, variables, and ope...
Opengraph URL: https://github.com/graphql-java/graphql-java/discussions/2760
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Help needed debugging NonNullableValueCoercedAsNullException","text":"\u003cp dir=\"auto\"\u003eI'm seeing random \u003ccode class=\"notranslate\"\u003eNonNullableValueCoercedAsNullException\u003c/code\u003es from our servers running graphql-java 17.3 with graphql-java-tools 12.0.2. I've logged the entire GraphQL query, variables, and operation name, and I cannot reproduce the exception. The stack trace looks like this:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"graphql.execution.NonNullableValueCoercedAsNullException: Field '' has coerced Null value for NonNull type 'String!'\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:493)\n\tat graphql.execution.ValuesResolver.lambda$externalValueToInternalValueForList$2(ValuesResolver.java:604)\n\tat java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)\n\tat java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)\n\tat java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\n\tat java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValueForList(ValuesResolver.java:605)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:507)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValueForObject(ValuesResolver.java:570)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:510)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:491)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValueForVariables(ValuesResolver.java:412)\n\tat graphql.execution.ValuesResolver.coerceVariableValues(ValuesResolver.java:94)\n\tat graphql.analysis.QueryTraverser.coerceVariables(QueryTraverser.java:64)\n\tat graphql.analysis.QueryTraverser.\u0026lt;init\u0026gt;(QueryTraverser.java:60)\n\tat graphql.analysis.QueryTraverser.\u0026lt;init\u0026gt;(QueryTraverser.java:40)\n\tat graphql.analysis.QueryTraverser$Builder.build(QueryTraverser.java:297)\n\tat graphql.analysis.MaxQueryDepthInstrumentation.newQueryTraverser(MaxQueryDepthInstrumentation.java:92)\n\tat graphql.analysis.MaxQueryDepthInstrumentation.lambda$beginValidation$2(MaxQueryDepthInstrumentation.java:57)\n\tat graphql.execution.instrumentation.SimpleInstrumentationContext.onCompleted(SimpleInstrumentationContext.java:51)\n\tat graphql.execution.instrumentation.ChainedInstrumentation$ChainedInstrumentationContext.lambda$onCompleted$1(ChainedInstrumentation.java:238)\n\tat graphql.com.google.common.collect.ImmutableList.forEach(ImmutableList.java:405)\n\tat graphql.execution.instrumentation.ChainedInstrumentation$ChainedInstrumentationContext.onCompleted(ChainedInstrumentation.java:238)\n\tat graphql.GraphQL.validate(GraphQL.java:600)\n\tat graphql.GraphQL.parseAndValidate(GraphQL.java:562)\n\tat graphql.GraphQL.lambda$parseValidateAndExecute$10(GraphQL.java:531)\n\tat graphql.execution.preparsed.NoOpPreparsedDocumentProvider.getDocument(NoOpPreparsedDocumentProvider.java:15)\n\tat graphql.GraphQL.parseValidateAndExecute(GraphQL.java:533)\n\tat graphql.GraphQL.executeAsync(GraphQL.java:502)\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003egraphql.execution.NonNullableValueCoercedAsNullException: Field '' has coerced Null value for NonNull type 'String!'\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:493)\n\tat graphql.execution.ValuesResolver.lambda$externalValueToInternalValueForList$2(ValuesResolver.java:604)\n\tat java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)\n\tat java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)\n\tat java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\n\tat java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValueForList(ValuesResolver.java:605)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:507)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValueForObject(ValuesResolver.java:570)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:510)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValue(ValuesResolver.java:491)\n\tat graphql.execution.ValuesResolver.externalValueToInternalValueForVariables(ValuesResolver.java:412)\n\tat graphql.execution.ValuesResolver.coerceVariableValues(ValuesResolver.java:94)\n\tat graphql.analysis.QueryTraverser.coerceVariables(QueryTraverser.java:64)\n\tat graphql.analysis.QueryTraverser.\u0026lt;init\u0026gt;(QueryTraverser.java:60)\n\tat graphql.analysis.QueryTraverser.\u0026lt;init\u0026gt;(QueryTraverser.java:40)\n\tat graphql.analysis.QueryTraverser$Builder.build(QueryTraverser.java:297)\n\tat graphql.analysis.MaxQueryDepthInstrumentation.newQueryTraverser(MaxQueryDepthInstrumentation.java:92)\n\tat graphql.analysis.MaxQueryDepthInstrumentation.lambda$beginValidation$2(MaxQueryDepthInstrumentation.java:57)\n\tat graphql.execution.instrumentation.SimpleInstrumentationContext.onCompleted(SimpleInstrumentationContext.java:51)\n\tat graphql.execution.instrumentation.ChainedInstrumentation$ChainedInstrumentationContext.lambda$onCompleted$1(ChainedInstrumentation.java:238)\n\tat graphql.com.google.common.collect.ImmutableList.forEach(ImmutableList.java:405)\n\tat graphql.execution.instrumentation.ChainedInstrumentation$ChainedInstrumentationContext.onCompleted(ChainedInstrumentation.java:238)\n\tat graphql.GraphQL.validate(GraphQL.java:600)\n\tat graphql.GraphQL.parseAndValidate(GraphQL.java:562)\n\tat graphql.GraphQL.lambda$parseValidateAndExecute$10(GraphQL.java:531)\n\tat graphql.execution.preparsed.NoOpPreparsedDocumentProvider.getDocument(NoOpPreparsedDocumentProvider.java:15)\n\tat graphql.GraphQL.parseValidateAndExecute(GraphQL.java:533)\n\tat graphql.GraphQL.executeAsync(GraphQL.java:502)\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eCan someone please give me some general directions on what the error means?\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI know if I put a \u003ccode class=\"notranslate\"\u003enull\u003c/code\u003e inside an array that requires non null values in \u003ccode class=\"notranslate\"\u003evariables\u003c/code\u003e, I can cause an error with the same error message. However, if you look at the stack trace, the exception was thrown at \u003ccode class=\"notranslate\"\u003egraphql.GraphQL.executeAsync\u003c/code\u003e, meaning I'm not even getting a result from it.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAlso for the record, this is what my \u003ccode class=\"notranslate\"\u003evariables\u003c/code\u003e looks like:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n \u0026quot;accountId\u0026quot;: \u0026quot;133...63\u0026quot;,\n \u0026quot;userId\u0026quot;: \u0026quot;133...63\u0026quot;,\n \u0026quot;userInput\u0026quot;: {\n \u0026quot;accountId\u0026quot;: \u0026quot;133...63\u0026quot;,\n \u0026quot;id\u0026quot;: \u0026quot;133...63\u0026quot;\n }\n}\"\u003e\u003cpre class=\"notranslate\"\u003e{\n \u003cspan class=\"pl-ent\"\u003e\"accountId\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e133...63\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"userId\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e133...63\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"userInput\"\u003c/span\u003e: {\n \u003cspan class=\"pl-ent\"\u003e\"accountId\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e133...63\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"id\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e133...63\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eI do not have arrays or nulls in my \u003ccode class=\"notranslate\"\u003evariables\u003c/code\u003e.\u003c/p\u003e","upvoteCount":1,"answerCount":4,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eLet me give you some generalised information about \u003ccode class=\"notranslate\"\u003eNonNullableValueCoercedAsNullException\u003c/code\u003e and then I will look further.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode class=\"notranslate\"\u003eNonNullableValueCoercedAsNullException\u003c/code\u003e is thrown when a field that declares itself to be non nullable in fact at runtime does return a null value (say \u003ccode class=\"notranslate\"\u003ename : String!\u003c/code\u003e which then returns a null name value say)\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHowever looking at this stack trace I can see its no field execution but rather the \u003ccode class=\"notranslate\"\u003eMaxQueryDepthInstrumentation\u003c/code\u003e traversing a input query and trying to get certain values.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e(The \u003ccode class=\"notranslate\"\u003eField '' has coerced Null \u003c/code\u003e is a bug - we should fix that useless error message)\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI am a little puzzled here because this is \"input arguments\" and not output field values.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eI need to sit down and spend some time on this to find a cause.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e(also as an aside I think we have an opportunity to make this \"field argument value\" work lazy. \u003ccode class=\"notranslate\"\u003eMaxQueryDepthInstrumentation \u003c/code\u003e code is not interested in argument values and hence this should be lazy in the \u003ccode class=\"notranslate\"\u003eQueryTraverser\u003c/code\u003e... but thats another improvement for another time)\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/graphql-java/graphql-java/discussions/2760#discussioncomment-2348466"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:c5c30431-a468-18bf-13c4-cc010030777f |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | B7C2:326CF:218F1A2:2E29DC6:6A609EFC |
| html-safe-nonce | 62cafbb78706aaac3e7aa3c27a0562a669b1afe25048375bbb62246dfd5013f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0MyOjMyNkNGOjIxOEYxQTI6MkUyOURDNjo2QTYwOUVGQyIsInZpc2l0b3JfaWQiOiI2MjYzNTczMDI2ODU0NDQ0Nzk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fbffe373ea3e02ec64ee601ee5c051aef85a546551a9d6bfe0ee7b25ad829b34 |
| hovercard-subject-tag | discussion:3932143 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/graphql-java/graphql-java/2760/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/7bf6ca3befa0265123245fe548972d2c201ac7cd86531d477d7ed2ff26099aea/graphql-java/graphql-java/discussions/2760 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7bf6ca3befa0265123245fe548972d2c201ac7cd86531d477d7ed2ff26099aea/graphql-java/graphql-java/discussions/2760 |
| og:image:alt | I'm seeing random NonNullableValueCoercedAsNullExceptions from our servers running graphql-java 17.3 with graphql-java-tools 12.0.2. I've logged the entire GraphQL query, variables, and operation n... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5142d23feb6a650085422edf60d68c93777dfa6c4b0c9151eb464d3e4969f618 |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 38602457 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38602457 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b2111e158bcd758ab9d0446577ae8f5dd78fcca8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width