Hello. Why i get this error in graphql? ```query{ ...
# troubleshoot
c
Hello. Why i get this error in graphql?
Copy code
query{
  dataset(urn:"urn:li:dataset:(urn:li:dataPlatform:vertica,da.analytics.prod_subs_state,PROD)"){
    urn
    aspects {
      aspectName
    }
  }
}
Error message
Copy code
{
  "errors": [
    {
      "message": "An unknown error occurred.",
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "path": [
        "dataset",
        "aspects"
      ],
      "extensions": {
        "code": 500,
        "type": "SERVER_ERROR",
        "classification": "DataFetchingException"
      }
    }
  ],
  "data": {
    "dataset": {
      "urn": "urn:li:dataset:(urn:li:dataPlatform:vertica,da.analytics.prod_subs_state,PROD)",
      "aspects": null
    }
  }
}
b
hey Nikita! it looks like you're getting a 500 error which means there must be something wrong with your graphql server. Can you check the logs of GMS to see if it's healthy?
c
Copy code
15:28:57.359 [I/O dispatcher 1] INFO  c.l.m.k.e.ElasticsearchConnector:41 - Successfully feeded bulk request. Number of events: 1 Took time ms: -1
15:28:57.374 [I/O dispatcher 1] INFO  c.l.m.k.e.ElasticsearchConnector:41 - Successfully feeded bulk request. Number of events: 1 Took time ms: -1
15:58:01.325 [Thread-102895] ERROR c.l.d.g.e.DataHubDataFetcherExceptionHandler:21 - Failed to execute DataFetcher
java.util.concurrent.CompletionException: java.lang.NullPointerException
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1606)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: null
15:58:01.327 [Thread-102893] ERROR c.datahub.graphql.GraphQLController:93 - Errors while executing graphQL query: "query{\n  dataset(urn:\"urn:li:dataset:(urn:li:dataPlatform:vertica,da.analytics.prod_subs_state,PROD)\"){\n    urn\n    aspects {\n      aspectName\n    }\n  }\n}", result: {errors=[{message=An unknown error occurred., locations=[{line=4, column=5}], path=[dataset, aspects], extensions={code=500, type=SERVER_ERROR, classification=DataFetchingException}}], data={dataset={urn=urn:li:dataset:(urn:li:dataPlatform:vertica,da.analytics.prod_subs_state,PROD), aspects=null}}}, errors: [DataHubGraphQLError{path=[dataset, aspects], code=SERVER_ERROR, locations=[SourceLocation{line=4, column=5}]}]
This error is just after graphql request. Should i try to find something earlier?
b
ahh alright looks like a null pointer exception - i was able to replicate this as well. looking into it!
yup i figured out where it's coming from! putting up a fix for this now
but also one more thing is that you will need to update your query since
aspects
takes in an input - so it should look likethis:
Copy code
query{
  dataset(urn:"urn:li:dataset:(urn:li:dataPlatform:vertica,da.analytics.prod_subs_state,PROD)"){
    urn
    aspects (input: { autoRenderOnly: true }) {
      aspectName
    }
  }
}
and change
true
->
false
if you so desire
c
if i set
false
, i get same error. if set
true
, i get empty aspects
b
yup same here (fixing the error for when it's false right now)
c
what means
autoRenderOnly
?
b
it means that if the aspect has
autoRender: true
then we will default display it on the entity page in a tab - here's the docs on the aspect annotation: https://datahubproject.io/docs/metadata-modeling/extending-the-metadata-model/#aspect
^ originally sent the wrong link but fixed now
c
if i set
autoRenderOnly: true
in query, some aspects should be displayed in answer, right?
b
hm not if there are no aspects with autoRender: true - that's an experimental feature and not typical I believe. if it's false that's when you'll get aspects that you would expect
c
thanks!
b
here's the PR fixing the null pointer exception! https://github.com/datahub-project/datahub/pull/5857