Troubleshooting
View function logs
from cognite.client import CogniteClient
client = CogniteClient()
calls = client.functions.calls.list(
function_external_id="data-quality-validation",
limit=10,
)
logs = client.functions.calls.get_logs(call_id=calls[0].id)
print(logs)
Check workflow execution status
executions = client.workflows.executions.list(
workflow_external_id="dq-shacl-equipment",
limit=10,
)
for execution in executions:
print(f"Status: {execution.status}, Started: {execution.started_at}")
Workflow not triggering on data changes
Symptoms: Instance changes in DMS don't start the validation workflow.
Check:
- Retrieve the trigger and verify it is active:
- Verify the instance space in the trigger filter matches the space where data changes occur.
- Confirm the workflow version in the trigger matches the deployed workflow version.
- If you deployed with
--skip-trigger, redeploy without that flag.
Uniqueness workflow not deployed
Symptoms: View has dqs:unique in SHACL but no dq-{view}-uniqueness workflow in CDF.
Check:
- Confirm the constraint's
sh:targetClassmatches the view's data model class (deploy scans SHACL for the view'sexternal_id). - For DataProduct/RuleSet mode, verify
RuleSetClient.get_version()returns TTL with the constraint (deploy fetches RuleSet content at deploy time). - Check deploy logs for
Skipping uniqueness workflow ... no SHACL uniqueness constraints foundor SHACL parse warnings. - Ensure
uniqueness_cronis not set tonullin view YAML (that disables the scheduled workflow).
Uniqueness not running after sync
Expected behaviour. Sync-cursor (instance_sync_cursor) runs incremental pyshacl only. Global uniqueness runs on the scheduled dq-{view}-uniqueness workflow, not after each sync completion.
To run on demand: call_validate_shacl() with validation_type: shacl or trigger the uniqueness workflow manually.
Uniqueness duplicates still exist but few/no new failure records
Often expected behaviour. Uniqueness now suppresses repeated failure writes for unchanged instances.
Suppression rule:
- If latest existing failed record for a
focusNodehasrecord.lastUpdatedTime >= instance.lastUpdatedTime, runtime suppresses writing a new failure record.
Check:
- Inspect uniqueness run output fields:
violatingInstanceCountrecordsPostedrecordsSuppressed- If
recordsSuppressedis high andrecordsPostedis low, dedupe is likely working as intended. - Update an affected instance and rerun uniqueness — a new failure record should appear if the violation remains.
From validation records:
- Check grouped uniqueness records for typed overflow signals:
groupViolationType = "global_overflow"(run-level overflow)groupViolationType = "value_overflow"(single-value overflow)- If either overflow type is present, this run hit a guardrail and more duplicate groups may still remain.
- Fix the reported duplicates and rerun uniqueness until overflow records disappear.
Note:
- If no new records are written (for example due to dedupe suppression), users may not see a new overflow record for that run.
- In that case, ask an operator to confirm run-level warnings from workflow/function output.
Grouped uniqueness records are explicitly marked with:
validationType = "group_violation"groupViolationType = "global_overflow" | "value_overflow" | "pass"
"Failed to load SHACL rules"
Symptoms: Function logs show an error loading rules.
Check:
- Verify the SHACL file exists in CDF Files with the expected external ID.
- Confirm the external ID in the view config (
shacl_rules.external_id) matches the file. - Verify the file is in the correct CDF dataset (set in
settings.yamlundershacl_rules.dataset_external_id). - Validate Turtle syntax locally:
"No instances to validate"
Symptoms: Validation completes with zero instances processed.
Check:
- Confirm the DMS filter in the view config or time series config is correct.
- Verify instances exist in the configured space.
- Ensure the view external ID and version match the actual view in CDF.
Zero violations when you expect some
Symptoms: Validation runs but produces no violations for a rule you expect to fire.
Check:
- The
sh:targetClassin the SHACL rule targets a concrete view type, not a CDF interface.
Interfaces (e.g.MMSINumber) are not used asrdf:typein the RDF graph — concrete view types (e.g.NavigationAid) are. A shape targeting an interface silently matches nothing. - Run with
print_output=Trueandverbose=Trueto see per-instance output and zero-instance class warnings. - Check
auto_load_depth— if the rule uses properties from referenced instances, depth0won't load them.
See SHACL rules and CDF data models for details.
Function dependency errors
"ModuleNotFoundError: No module named 'cognite_data_quality'"
The function was deployed before the package was published to PyPI, or is pinned to an old version.
- Publish the latest package:
python -m build && twine upload dist/* - Force redeploy:
python scripts/deploy_infrastructure.py --env <env> --force
RAW table validation issues
"RAW table not found"
- Verify the RAW database and table names in the config match what exists in CDF.
- Confirm the service principal has read access to the RAW table.
"No rows updated since last run"
Normal for incremental validation when no changes occurred. Check RawValidationState in the dataQuality DMS space for last_processed_timestamp to confirm.
Cursor state not saving
- Ensure the
dataQualityspace exists in CDF. - Verify the service principal has write access to the
dataQualityspace. - Run
python scripts/ensure_container.pyto create theFunctionValidationStatecontainer if missing.
Records API returns no results
Symptoms: Filter queries return empty items.
Check:
- Confirm
client.config.headers["cdf-version"] = "alpha"is set before the request. - Verify the stream ID in the query matches
records.stream_idinsettings.yaml. - Check the time range — Records API filters use milliseconds since epoch. Widen
lastUpdatedTimeto confirm records exist.