Skip to content

duplicate key value violates unique constraint / key already exists #606

@module0x90

Description

@module0x90

What is the issue ?

  • the component that you are creating this issue about: api server
  • linux distribution, version of python, version of ara and ansible: Red Hat 8.8, Python 3.11, Ara 1.7.0, Ansible 2.14.2
  • how is ara installed (python pip installation locally) and how you are running it (psql)
  • Pruned logs at the bottom.
  • Ran via "./site.yml -vvv -kK -i inventory/PROD --limit "$HG" --tags motd --extra-vars '$VAR=tom-testing-ansible'"
  • Ansible is run on the same system where api server is running

What should be happening ?

No DB error.

2025-08-11 06:25:52.597 PDT [3561864] ERROR: duplicate key value violates unique constraint "files_path_playbook_id_0eb834c6_uniq" 2025-08-11 06:25:52.597 PDT [3561864] DETAIL: Key (path, playbook_id)=(/ansibleproduction/site.yml, 2421) already exists. 2025-08-11 06:25:52.597 PDT [3561864] STATEMENT: INSERT INTO "files" ("created", "updated", "path", "content_id", "playbook_id") VALUES ('2025-08-11T13:25:52.590678+00:00'::timestamptz, '2025-08-11T13:25:52.590688+00:00'::timestamptz, '/ansibleproduction/site.yml', 1011, 2421) RETURNING "files"."id"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions