Area: Product
Sub-Area: Metadata Management
Applies to: OSS + Cloud
Issue
A structured property was deleted, but assets still hold values of it. Writes of structured properties on those assets fail, or the old values still show.
Error messages you can see:
Cannot apply a soft deleted Structured Property valueStructured properties write rejected for <asset urn>: no valid property assignments remain after removing values for non-existent propertiesUnexpected null value found for <property urn> Structured Property Definition.
You Might Be Asking
- Why can't I update structured properties on certain assets?
- How do I remove stale structured property values from assets?
- What happens to the values on assets when I delete a structured property that's in use?
- Can I undo the delete of a structured property?
Cause
DataHub has two kinds of delete for a structured property.
A soft delete keeps the property and its values stored. Reads hide the values. DataHub rejects a write that adds a value of a soft deleted property, with Cannot apply a soft deleted Structured Property value. A soft delete is reversible.
A hard delete removes the property. Then DataHub removes its values from every asset in the background. A hard delete cannot be undone. Deleting a property in the DataHub UI hard deletes it. In DataHub v1.8.0 and later and DataHub Cloud v2.2.0 and later, the UI does a soft delete first.
Until the background cleanup finishes, an asset can still hold a value of a property that no longer exists. In DataHub v1.6.0 and later and DataHub Cloud v2.0.0 and later, DataHub drops that value on the next write by default, logs a warning, and saves the rest. The write fails only when no valid value is left. A self-hosted deployment that sets STRUCTURED_PROPERTIES_DROP_MISSING_PROPERTY_VALUES_WITH_WARNING to false uses strict validation. Then the stale value makes the write fail. Before those versions, each write that includes the stale value fails with Unexpected null value found.
Which assets fail depends on which assets hold a value of the deleted property. The source platform, for example Looker, does not matter.
Solution
- If you might need the property again, soft delete it with
datahub delete --urn "<property urn>". Do not use the UI delete, which also hard deletes. - For a soft deleted property, remove that property from your write. Or restore the property: set
removedtofalsein itsstatusaspect, as shown in Soft Delete. - For a hard deleted property on self-hosted DataHub v1.6.0 or later, keep
STRUCTURED_PROPERTIES_DROP_MISSING_PROPERTY_VALUES_WITH_WARNINGat its default,true. Restart GMS after you change it. - To remove one stale value from one asset, remove only that property, as shown in Remove Structured Property Value.
- Do not run a script that reads the
structuredPropertiesaspect of every asset and writes it back. Reads hide the values of soft deleted properties, so the write removes those values for good. - On DataHub Cloud, if writes still fail after a hard delete, contact DataHub Support with the property URN and the full error message.
The delete steps and the write behavior are in Delete Structured Properties and Orphaned assignments and write behavior.
To change the type, cardinality or allowed values of a property that is in use, see Update Structured Property With Breaking Schema Changes.
Related Documentation
Tags: structured-properties, stale-references, soft-delete, hard-delete, property-deletion, cleanup