DependencyTrack / dependency-track

Dependency-Track is an intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain.
https://dependencytrack.org/
Apache License 2.0
2.44k stars 530 forks source link

Dependency Track API fails to start in Fargate Task #3824

Open mikehall-mozz opened 3 weeks ago

mikehall-mozz commented 3 weeks ago

Current Behavior

log-events-viewer-result.csv

Hi there, I am trying to run Dependency Track in a Fargate Task on AWS, and it hangs during startup. I have enabled debug logging, and it doesn't give me much to go on. The last line I see is as follows:

2024-06-07T15:59:39.280Z 2024-06-07 15:59:39,279 INFO [PersistenceManagerFactory] Creating transactional connection pool

There are no further lines logged, and the task is eventually killed as it fails health checks.

I can see that the user has sufficient permissions in the database, because it creates the tables successfully.

Steps to Reproduce

Run dependency track in a Fargate task with the following env vars: nvironment : [ { name : "ALPINE_DATABASE_MODE", value : "external" }, { name : "ALPINE_DATABASE_URL", value : "jdbc:postgresql://\<database URL>" }, { name : "ALPINE_DATABASE_USERNAME", value : "\<user>" }, { name : "ALPINE_DATABASE_PASSWORD", value : "\<password>" }, { name : "ALPINE_DATABASE_POOL_ENABLED", value : "true" }, { name : "ALPINE_DATABASE_POOL_MAX_SIZE", value : "20" }, { name : "ALPINE_DATABASE_POOL_MIN_IDLE", value : "10" }, { name : "ALPINE_DATABASE_POOL_IDLE_TIMEOUT", value : "300000" }, { name : "ALPINE_DATABASE_POOL_MAX_LIFETIME", value : "600000" }, { name: "LOGGING_LEVEL", value: "DEBUG," }, { name : "region", value : "${var.region}" }, { name : "env", value : "${var.environment}" } ]

Expected Behavior

Dependency Track API starts successfully

Dependency-Track Version

4.11.3

Dependency-Track Distribution

Container Image

Database Server

PostgreSQL

Database Server Version

16.1

Browser

Google Chrome

Checklist

nscuro commented 3 weeks ago
{
name : "ALPINE_DATABASE_URL",
value : "jdbc:postgresql://"
},
{
name : "ALPINE_DATABASE_USERNAME",
value : ""
},
{
name : "ALPINE_DATABASE_PASSWORD",
value : ""
},

Did you redact the values or is that how the task is configured?

If the logs stop at:

2024-06-07T15:59:39.280Z 2024-06-07 15:59:39,279 INFO [PersistenceManagerFactory] Creating transactional connection pool

then that's a hint that ALPINE_DATABASE_URL points to a host that can't be reached.

mikehall-mozz commented 3 weeks ago

Yes @nscuro , not sure why they have ended up blank, they contained \<redacted values> :)

Definitely confirmed connection working with another user that didn't have appropriate permissions, who was getting rejected with the unable to create DELETEMEXXXXXX (or whatever it's called) table.

-- edit oh, it's because of the \< and > that those values disappeared in the comment, sorted now

mikehall-mozz commented 2 weeks ago

So I have managed to get it working by setting ALPINE_DATABASE_POOL_ENABLED to "false", so it seems like it is failing to set up the pool correctly. Any ideas as to how to get that working @nscuro ?