Skip to main content
Seasoned ⭐️⭐️
Nov 17, 2026 7:17 AM UTC
Question

cognite-data-quality: incremental sync trigger is not created when a view has many instance spaces

We use cognite-data-quality==0.4.9 to validate an external DataProduct with config_source: dataproduct. Each view reads from 24 instance spaces and has use_sync_cursor_mode: true.

Historic validation runs, but incremental validation does not work. We found two separate length-limit issues.

Trigger metadata is longer than 255 characters

 

The historic orchestrator stores json.dumps(instance_spaces) in the workflow trigger's metadata.instance_spaces.

With 24 spaces, this value is 360 characters. CDF allows at most 255 characters per trigger metadata value, so creating the trigger fails:


[':metadata']: Values are limited to 255 characters
 

The orchestrator catches this error and reports Sync trigger: not created, so it is easy to miss.

 Lock and cursor IDs are longer than 256 characters

The lock and cursor external IDs include the full sorted list of instance spaces. With 24 spaces, they are about 330–335 characters, which is above the 256-character external ID limit:


Sync lock acquire skipped (load error: ... externalId size must be between 1 and 256 ...)

 

When the incremental workflow runs, this lock-read error is reported as:


{"status": "skipped", "reason": "concurrent_execution"}

 

The workflow shows Completed, so it looks as if another run is holding the lock. In reality, the ID is invalid and no data is validated.

How to reproduce

1. Use `cognite-data-quality==0.4.9` with an external DataProduct.
2. Set `use_sync_cursor_mode: true` for a view.
3. Configure enough instance spaces to exceed the limits. We used 24; the exact number depends on the length of the space and view names.
4. Run `deploy_validation_pipeline` for that view.

Expected behavior

  • The incremental trigger is created regardless of the number of instance spaces.
  • Lock and cursor IDs stay within the external ID limit.
  • A lock-read error is reported as an error, not as concurrent_execution.

Temporary workaround

We currently patch the Function code at deployment time:

  • If a lock or cursor ID is longer than 256 characters, we use a SHA-256-based ID instead.
  • If the metadata value is longer than 255 characters, we store `"<count> spaces; sha256=<hash>"`. The full list of spaces is still kept in the trigger input.
  • If the lock cannot be read, we raise an error instead of returning concurrent_execution.

With this workaround, historic and incremental validation work for all 24 spaces.

Questions

  1. Is this a known issue? Is it fixed in a newer version, or is a fix planned?
  2. What is the recommended approach for views with many instance spaces?
     

 

1 reply

Practitioner ⭐️⭐️⭐️
Nov 17, 2026 9:56 AM UTC

Hi @DSTDF — thank you for the clear report and root-cause analysis! All three findings are spot-on.

1. Is this a known issue, and is a fix planned?

Yes — this is still present in 0.5.0, and we are tracking fixes across two issues for an upcoming 0.5.1 release:

 

  • Cursor and lock externalId length (>255 chars):  instance_space_key_from_list() is being updated from "+".join(sorted(instance_spaces)) to a bounded {num_spaces}_{hash} key derived from the sorted deduplicated space list so sync_cursor_* and sync_lock_* IDs stay well under DMS's 255-character externalId limit regardless of space count.
  • Trigger metadata.instance_spaces (>255 chars) & lock-read error masking: T
    1. create_sync_trigger() will summarize metadata.instance_spaces (count + SHA-256 digest) whenever the JSON list exceeds CDF's 255-character metadata value limit, while keeping the full instance_spaces list in trigger.input and the DMS trigger filter.
    2. try_acquire_sync_lock() / handle_instance_sync_cursor_validation() will propagate lock-read API errors (such as 4xx validation or permission errors) instead of returning {"status": "skipped", "reason": "concurrent_execution"}. (try_acquire_sync_lock originally failed closed on load errors so transient failures could never re-initialize and clobber an active lease; raising the error preserves lease safety while letting Workflow task status and retries behave properly.)

 

 

2. Recommended approach for views with many instance spaces

Your current architecture — managing the Data Product externally and validating it with use_sync_cursor_mode: true using a single per-view DMS trigger across all 24 instance spaces — is the recommended setup:

 

  1. Keep managing Data Products externally: We are removing Data Product creation/publishing from cognite-data-quality itself so Data Products are owned and governed externally (via the Data Products API / Toolkit) and cognite-data-quality strictly consumes them to orchestrate validation. Note that under the current Data Products API (20230101-alpha), all non-cdf_* views in a Data Product must reside in that Data Product's schemaSpace (one Data Product per custom schema space).
  2. Keep one trigger + one sync cursor per view (do not split per instance space): CDF has a default limit of 200 workflow triggers per project (Workflow limits). A single no_backfill signal trigger per view with In(["node", "space"], instance_spaces) and use_sync_cursor_mode: true scales cleanly to 24+ spaces (up to 100 spaces per view in Data Products) without exhausting project trigger quotas.
  3. Heads-up on the recent Data Products instanceScope API change while on 0.4.9:
    • In the 20230101-alpha Data Products API, per-view read spaces moved from DataProductVersion.views[*].instanceSpaces up to DataProduct.instanceScope on the Data Product resource itself (source: { type: "view", space, externalId }, read: [...]).
    • cognite-data-quality==0.4.9 only reads the legacy version-level views[*].instanceSpaces.read field (falling back to [view.space] if absent). Until you upgrade to the release with DataProduct.instanceScope support, if you create or update a Data Product against the new instanceScope schema, pass an explicit instance_spaces list in your view YAML config so 0.4.9 doesn't fall back to [schemaSpace].
  4. Tips for your temporary deploy-time workaround:
    • Keep the sync_cursor_{view_space}_{view_external_id}_ and sync_lock_{view_space}_{view_external_id}_ prefixes and hash only the spaces suffix ( matching {num_spaces}_{hash}), as monitoring queries match cursor nodes back to views via {view_space} and {view_external_id} in the externalId.
    • When you upgrade to 0.5.1 and drop the patch, if the hashed suffix differs slightly from your custom hash, the first incremental run will simply start from initial_sync_cutoff on the trigger input (or you can re-run historic handoff).