Actor URN Overwritten in AuditStampClass during Ingestion Process

Original Slack Thread

Hello, I am using AuditStampClass(time=now, actor=“urn:li:corpuser:ingestion”) in my GlossaryTermsClass() but my logs show that
'auditStamp': AuditStampClass({'time': 1733930638090, 'actor': 'urn:li:corpuser:mira.daniels', 'impersonator': None, 'message': None})})
is used when ingesting the terms. How come the actor urn is overwritten and not using what i have defined in my ingestion porcess?

Hey there! :wave:

<@U06TM7M40RK> Can you help with the questions in this thread?

:information_source: Please continue to tag RunLLM (e.g <@U06TM7M40RK>) to have it continue generating responses!

It seems like the actor URN in your AuditStampClass is being overwritten during the ingestion process. This can happen if there is a mechanism in place that automatically sets the actor based on the context or authentication information available at the time of ingestion.

According to the https://github.com/datahub-project/datahub/blob/master/li-utils/src/main/javaPegasus/com/linkedin/common/urn/UrnUtils.java|UrnUtils.java, the getActorOrDefault method is used to set the actor URN. If the actor is not explicitly provided or is null, it defaults to an “unknown” actor URN. However, if there is an authentication context available, it might be used to derive the actor URN, which could explain why you see a different actor in the logs.

Additionally, the https://github.com/datahub-project/datahub/blob/master/metadata-io/src/main/java/com/linkedin/metadata/entity/EntityUtils.java|EntityUtils.java file shows that the getAuditStamp method sets the current system time and the actor URN. If your ingestion process involves any authentication or context that provides a different actor, it could override the one you specified.

To address this, you can:

  1. Check Authentication Context: Ensure that there is no authentication context or configuration that might be setting the actor URN automatically during ingestion.

  2. Explicitly Set Actor URN: If possible, explicitly set the actor URN in your ingestion script to ensure it is not overridden. You can validate the AuditStampClass to ensure it contains the correct actor URN before ingestion.

  3. Review Ingestion Code: Double-check your ingestion code to ensure that the AuditStampClass is being set correctly and not being modified later in the process.

Would you like more detailed steps on how to check and resolve these issues?

Sources:

Hi :slight_smile: ! Did this interaction resolve your issue or do you still require assistance ?

Please tag @ RunLLM if you still need further assistance !

Or tag @Datahub Community Support if you require a person to take a look :slight_smile:

Hope this helps ! ><