project-koku / masu

This is a READ ONLY repo. See https://github.com/project-koku/koku for current masu implementation
GNU Affero General Public License v3.0
5 stars 6 forks source link

SQL Insert violates unique constraint when cleaning temporary files. #483

Closed dccurtis closed 5 years ago

dccurtis commented 5 years ago

Describe the bug

[SQL: INSERT INTO public.reporting_common_costusagereportstatus (report_name, last_completed_datetime, last_started_datetime, etag, manifest_id) VALUES (%(report_name)s, %(last_completed_datetime)s, %(last_started_datetime)s, %(etag)s, %(manifest_id)s) RETURNING public.reporting_common_costusagereportstatus.id]
[parameters: {'report_name': '16a38c53-1283-489f-9471-15f430527feb-hccm-nise-data-00-1.csv.gz', 'last_completed_datetime': None, 'last_started_datetime': None, 'etag': None, 'manifest_id': 7096}]
(Background on this error at: http://sqlalche.me/e/gkpj )
query transaction failed: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "reporting_common_costusagereportstatus_report_name_key"
DETAIL:  Key (report_name)=(16a38c53-1283-489f-9471-15f430527feb-hccm-nise-data-00-1.csv.gz) already exists.

The above error is seen on the masu-worker and masu-listener. This is preventing temporary files from being removed.

To Reproduce

  1. Ingest multiple reports for OCP or AWS. Expected behavior A clear and concise description of what you expected to happen.
adberglund commented 5 years ago

This is also possibly linked to preventing the data summary task from running.

dchorvat1 commented 5 years ago

Verified, commit 09647cabe5bfba02634765c26a720637a1e76d26