Hi! We are testing a custom entity we have created...
# troubleshoot
a
Hi! We are testing a custom entity we have created by ingesting some data in the form of JSONs. Our setup is through Docker, so we run these commands to put and get, respectively.
Copy code
datahub put --urn "urn:li:process:(PRC-1,Test_Process_1_Description)" --aspect testProcessProperties --aspect-data prc1.json
datahub get --urn "urn:li:process:(PRC-1,Test_Process_1_Description)"
The put command completes without any errors, but running the get command will produce the following error
Copy code
19:23:22.102 [qtp522764626-22] INFO  c.l.m.filter.RestliLoggingFilter:55 - GET /entitiesV2/urn%3Ali%3Aprocess%3A%28PRC-1%2CTest_Process_1_Description%29 - get - 500 - 1ms
19:23:22.105 [qtp522764626-22] ERROR c.l.m.filter.RestliLoggingFilter:38 - <http://Rest.li|Rest.li> error: 
com.linkedin.restli.server.RestLiServiceException: java.lang.RuntimeException: Failed to get entity with urn: urn:li:process:(PRC-1,Test_Process_1_Description), aspects: null

Caused by: java.lang.RuntimeException: Failed to get entity with urn: urn:li:process:(PRC-1,Test_Process_1_Description), aspects: null
	... 88 common frames omitted
Caused by: java.lang.NullPointerException: null
	... 89 common frames omitted
Any help or insight would be greatly appreciated! @kind-dawn-17532 @bland-balloon-48379 @nice-oil-28310
b
hey Samantha! so did this entity not exist already with other aspects besides this new custom aspect
testProcessProperties
? I think this
datahub put ... --aspect ...
command was meant to be used to update existing entities, as I'm unsure if this will create an entity key aspect. additionally, have you updated
entity_registry.yml
to include your new custom aspect? otherwise that
get
command won't know to look for your new aspect when it's querying by the urn you give it. Here's some docs around extending the metadata model and creating custom aspects (which you may have already seen) https://datahubproject.io/docs/metadata-modeling/extending-the-metadata-model/#optional-step-7-extend-the-datahu[…]iew-your-entity-in-graphql--react
m
@brave-zebra-97479 might be able to help here as they recently worked on adding support for new entities.
a
Thanks for the help! Yes, I did add my new custom aspects to the entity-registry. Turns out we should have run the get request with the aspect that we wanted returned.
b
yeah good question - we allow you to put a parameter on the aspect when defining it in your new .pdl file called
autoRender
(check out these docs: https://datahubproject.io/docs/metadata-modeling/extending-the-metadata-model/#aspect). If you set
"autoRender": true
then we will know to display this aspect as a tab on the entity in the entity profile. we know how to display it based on the
renderSpec
(also talked about in the docs I pasted above, and here's an example pdl). I would check out this README as well which describes this process, what you need to do, giving you one specific example to follow.
a
Does this only work for adding aspects to an existing entity, or would it work for creating an entirely new entity page/profile? If we haven't defined "autoRender", which is defaulted to false, for all aspects of a new custom entity, does that mean the entity profile will not be created at all?
b
that's correct, if it's a custom aspect (whether it's on a custom entity or on an existing, out-of-the-box entity) you need to set autoRender: true on the pdl in order to see it in the UI. Otherwise, you'll have to fork off of datahub and write your own custom changes to the frontend code in order to properly display these aspects you're defining
sorry, the entity profile should be created, but the custom aspects and tabs for them on the profile will not be displayed unless you set autoRender: true