You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should correctly build the database for all 5 DB types (this hasn't been tested yet....).
APIKEYIS_LEGACY
2025-05-07 17:51:12,179 ERROR [Datastore] Error thrown executing CREATE TABLE "APIKEY"
2025-05-07T17:51:12.181410000Z (
2025-05-07T17:51:12.181475000Z "ID" BIGINT NOT NULL AUTO_INCREMENT,
2025-05-07T17:51:12.181881000Z "COMMENT" VARCHAR(255) BINARY NULL,
2025-05-07T17:51:12.182054000Z "CREATED" TIMESTAMP NULL,
2025-05-07T17:51:12.182261000Z "IS_LEGACY" BIT NOT NULL DEFAULT 'false',
2025-05-07T17:51:12.182344000Z "LAST_USED" TIMESTAMP NULL,
2025-05-07T17:51:12.182436000Z "PUBLIC_ID" VARCHAR(8) BINARY NULL,
2025-05-07T17:51:12.182514000Z "SECRET_HASH" VARCHAR(64) BINARY NULL,
2025-05-07T17:51:12.182541000Z CONSTRAINT "APIKEY_PK" PRIMARY KEY ("ID")
2025-05-07T17:51:12.182595000Z ) ENGINE=INNODB : Invalid default value for 'IS_LEGACY'
2025-05-07T17:51:12.182629000Z java.sql.SQLSyntaxErrorException: Invalid default value for 'IS_LEGACY'
This one is odd because the only reference I see to this is in the upgrade script v4130_1Updater.java.
This one is a bit more complicated, removing the upgrade script (and references to it) allows MySQL to finish building the database and start succesfully.
gbennett-squarespace
changed the title
Invalid default value for 'ONLY_LATEST_PROJECT_VERSION'
Invalid default value's causing MySQL to not start
May 7, 2025
Did you also try a newer DT version? 4.7.x is over two years old. I know it might not make a difference, but the docs also state MySQL is not really recommended: https://docs.dependencytrack.org/getting-started/database-support/. More to troubles are reported in #271 (comment) Considering the future of DT will probably only support Postgres it might be worth migrating to that.
Sorry, this is my error. I'm running the most recent version of DT.
It may not be worth fixing if MySQL is on the short end, but since it's currently listed as supported (and I believe both of the things I ran into are fairly recent changes) I figured I'd mention it.
Current Behavior
When testing MySQL for another change, creating the DB from scratch throws errors.
From Policy.java:
While most DBs handle
false
just fine, MySQL chokes on it. Changing to:Should correctly build the database for all 5 DB types (this hasn't been tested yet....).
APIKEY
IS_LEGACY
This one is odd because the only reference I see to this is in the upgrade script
v4130_1Updater.java
.This one is a bit more complicated, removing the upgrade script (and references to it) allows MySQL to finish building the database and start succesfully.
Steps to Reproduce
Start up DT with MySQL.
Using MySQL 5.7.
Env Vars:
Expected Behavior
MySQL based DB starts without issue.
Dependency-Track Version
4.13.x
Dependency-Track Distribution
Container Image
Database Server
MySQL
Database Server Version
5.7
Browser
N/A
Checklist
The text was updated successfully, but these errors were encountered: