Skip to content

Project Classifier "NONE" violates check constraint "PROJECT_CLASSIFIER_check" #4844

@Blackgen

Description

@Blackgen

Current Behavior

After upgrading to 4.13, I cannot create projects with the new "NONE" Classifier.
On a fresh instance this works, but not one one that has been used before version 4.13.

Error Message:

javax.jdo.JDODataStoreException: Insert of object "org.dependencytrack.model.Project@2de39c3d" using statement 
"INSERT INTO "PROJECT" ("ACTIVE","AUTHORS","CLASSIFIER","COLLECTION_LOGIC","COLLECTION_TAG","CPE","DESCRIPTION","DIRECT_DEPENDENCIES","EXTERNAL_REFERENCES","GROUP","IS_LATEST","LAST_BOM_IMPORTED","LAST_BOM_IMPORTED_FORMAT","LAST_RISKSCORE","LAST_VULNERABILITY_ANALYSIS","MANUFACTURER","NAME","PARENT_PROJECT_ID","PUBLISHER","PURL","SUPPLIER","SWIDTAGID","UUID","VERSION")
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" failed : ERROR: new row for relation "PROJECT" violates check constraint `"PROJECT_CLASSIFIER_check"

Failing row contains (77, t, NONE, null, null, null, null, null, null, null, null, null, Test, null, null, null, null, null, [...], null, null, f, null, AGGREGATE_DIRECT_CHILDREN, null).

I think this is related to #4446, and I think the fix to recreate the contraints should be executed after the migration to 4.13

Steps to Reproduce

  1. Have a instance of dependency track @ 4.12.3
  2. Upgrade to 4.13
  3. Try to create a new project with the classifier "NONE". This leads to a 500 Error and a constraint violation exception

Expected Behavior

After upgrading to 4.13, the constraint is updated to accept the new NONE-Classifier

Dependency-Track Version

4.13.0

Dependency-Track Distribution

Container Image, Executable WAR

Database Server

PostgreSQL

Database Server Version

14.12

Browser

N/A

Checklist

Metadata

Metadata

Assignees

Labels

defectSomething isn't workingp2Non-critical bugs, and features that help organizations to identify and reduce risksize/SSmall effort

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions