Open
Description
Hello, I am facing a cache issue, and I would like your help. In our provenance_scan_results table there are some new duplicate scan results which share the same vcs_url and vcs_revision , but different scanner_configuration and scan_summary.
ORT started failing with the following message:
17:45:25.573 [main] WARN Exposed - Transaction attempt #2 failed: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “provenance_scan_results_artifact_url_artifact_hash_scanner_name”
7529 Detail: Key (artifact_url, artifact_hash, scanner_name, scanner_version, scanner_configuration)=(https://registry.npmjs.org/@types/webpack/-/webpack-4.41.32.tgz, a7bab03b72904070162b2f169415492209e94212, ScanCode, 32.0.6, --copyright --license --info --strip-root --timeout 300 --json-pp) already exists.. Statement(s): INSERT INTO provenance_scan_results (artifact_hash, artifact_url, scan_summary, scanner_configuration, scanner_name, scanner_version, vcs_revision, vcs_type, vcs_url) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
7530org.jetbrains.exposed.exceptions.ExposedSQLException: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “provenance_scan_results_artifact_url_artifact_hash_scanner_name”
So, it looks like the cache is read despite the scanner config is different. Is this behavior intentional, or could it be considered a bug?