Skip to content

Error saving concept set #2430

@chrisknoll

Description

@chrisknoll

Users in the Atlas are getting an error when attempting to save a concept set expression.

When looking at the logs:

Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into webapi.concept_set_version (archived, asset_json, comment, created_by_id, created_date, asset_id, version) values (('FALSE'::boolean), ('[]'), (NULL), ('1025'::int8), ('2025-02-26 15:11:02.313+00'), ('9356'::int8), ('1'::int4)) was aborted: ERROR: insert or update on table "concept_set_version" violates foreign key constraint "fk_concept_set_version_asset_id"
  Detail: Key (asset_id)=(9356) is not present in table "concept_set".  Call getNextException to see other errors in the batch.

sampleJson.txt

Steps to reproduce:

  1. Create a new concept set
  2. Go to Import tab and use the above JSON to import
  3. Change the name to 'Save Error Test' and click save
  4. Observe: concept set saves
  5. Change the name to 'Save Error Test RENAME
  6. Observe error in logs

Note: This is not always reproducable. It is unclear if there's a sync issue between the versioning of the asset or a race condition of saving of the asset: is it possible that while the versioning save is being done, the save operation of the concept set is ongoing which leads to a delete-insert of the data while the version is looking for the foreign key?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions