DependencyTrack / helm-charts

Helm Charts for Dependency-Track
https://dependencytrack.org
Apache License 2.0
13 stars 14 forks source link

Database connectivity issues #66

Closed numa1985 closed 1 month ago

numa1985 commented 1 month ago

Hi ,

Had deployed the release to production using Microsoft SQL Server as database with the below values.yaml after analyzing the statefulset under api-server. Currently I don't see any errors in the api-server pod logs, but the query is was it connected to the SQL server database or is it using internal database, since I don't see any tables or objects created under the database. PFB snapshots.

Values.yaml

apiServer: resources: requests: cpu: "2" memory: "4Gi" limits: cpu: "2" memory: "4Gi" persistentVolume: enabled: true size: 30Gi nodeSelector: agentpool: npuser3 kubernetes.io/os: linux extraEnv: ALPINE_DATABASE_MODE: "external" ALPINE_DATABASE_URL: "jdbc:sqlserver://.database.windows.net:1433;databaseName=SBOM;sendStringParametersAsUnicode=false;trustServerCertificate=false" ALPINE_DATABASE_DRIVER: "com.microsoft.sqlserver.jdbc.SQLServerDriver" ALPINE_DATABASE_USERNAME: "-admin@*" ALPINE_DATABASE_PASSWORD: "****" extraEnv: SYSTEM_REQUIREMENT_CHECK_ENABLED: "false" initContainers:

Database Snapshot

image

Pod Log Details

ubuntu@NARU-Pr5530:~/sbom$ kubectl logs sbom-dependency-track-api-server-0 -n sbom Defaulted container "dependency-track-api-server" out of: dependency-track-api-server, fix-permissions (init) 2024-05-23 12:21:57,418 INFO [EmbeddedJettyServer] alpine-executable-war v2.2.5 (c3a1a709-acdc-4ca7-96dd-5eaab858ee32) built on: 2024-02-29T20:30:01Z 2024-05-23 12:21:59,427 INFO [Config] -------------------------------------------------------------------------------- 2024-05-23 12:21:59,430 INFO [Config] OS Name: Linux 2024-05-23 12:21:59,430 INFO [Config] OS Version: 5.15.0-1059-azure 2024-05-23 12:21:59,430 INFO [Config] OS Arch: amd64 2024-05-23 12:21:59,431 INFO [Config] CPU Cores: 2 2024-05-23 12:21:59,432 INFO [Config] Max Memory: 3.2 GB (3,437,756,416.0 bytes) 2024-05-23 12:21:59,433 INFO [Config] Java Vendor: Eclipse Adoptium 2024-05-23 12:21:59,434 INFO [Config] Java Version: 21.0.3+9-LTS 2024-05-23 12:21:59,434 INFO [Config] Java Home: /opt/java/openjdk 2024-05-23 12:21:59,434 INFO [Config] Java Temp: /tmp 2024-05-23 12:21:59,434 INFO [Config] User: dtrack 2024-05-23 12:21:59,435 INFO [Config] User Home: /data/ 2024-05-23 12:21:59,435 INFO [Config] -------------------------------------------------------------------------------- 2024-05-23 12:21:59,435 INFO [Config] Initializing Configuration 2024-05-23 12:21:59,435 INFO [Config] System property alpine.application.properties not specified 2024-05-23 12:21:59,436 INFO [Config] Loading application.properties from classpath 2024-05-23 12:21:59,442 INFO [Config] -------------------------------------------------------------------------------- 2024-05-23 12:21:59,442 INFO [Config] Application: Dependency-Track 2024-05-23 12:21:59,443 INFO [Config] Version: 4.11.1 2024-05-23 12:21:59,443 INFO [Config] Built-on: 2024-05-19T16:40:32Z 2024-05-23 12:21:59,443 INFO [Config] -------------------------------------------------------------------------------- 2024-05-23 12:21:59,443 INFO [Config] Framework: Alpine 2024-05-23 12:21:59,443 INFO [Config] Version : 2.2.5 2024-05-23 12:21:59,443 INFO [Config] Built-on: 2024-02-29T20:30:01Z 2024-05-23 12:21:59,443 INFO [Config] -------------------------------------------------------------------------------- 2024-05-23 12:21:59,548 WARN [ExecutorServiceMetrics] Failed to bind as java.util.concurrent.Executors$AutoShutdownDelegatedExecutorService is unsupported. 2024-05-23 12:21:59,584 INFO [RequirementsVerifier] Initializing requirements verifier 2024-05-23 12:21:59,585 WARN [RequirementsVerifier] Dependency-Track requires a minimum of 4GB RAM (heap). We highly recommand to use 4GB RAM. Dependency-Track will continue to start, but may not function properly. https://docs.dependencytrack.org/getting-started/deploy-docker/#container-requirements-api-server 2024-05-23 12:21:59,585 INFO [MetricsInitializer] Registering system metrics 2024-05-23 12:21:59,642 INFO [UpgradeInitializer] Initializing upgrade framework 2024-05-23 12:22:01,745 INFO [PersistenceManagerFactory] Initializing persistence framework 2024-05-23 12:22:01,747 INFO [PersistenceManagerFactory] Creating transactional connection pool 2024-05-23 12:22:01,871 INFO [PersistenceManagerFactory] Creating non-transactional connection pool 2024-05-23 12:22:02,200 INFO [PersistenceManagerFactory] Registering DataNucleus metrics 2024-05-23 12:22:02,215 INFO [HealthCheckInitializer] Registering health checks 2024-05-23 12:22:02,216 INFO [DefaultObjectGenerator] Initializing default object generator 2024-05-23 12:22:02,219 INFO [DefaultObjectGenerator] Synchronizing permissions to datastore 2024-05-23 12:22:02,440 INFO [DefaultObjectGenerator] Adding default users and teams to datastore 2024-05-23 12:22:04,166 INFO [DefaultObjectGenerator] Synchronizing SPDX license definitions to datastore 2024-05-23 12:22:06,994 INFO [DefaultObjectGenerator] Adding default license group definitions to datastore 2024-05-23 12:22:07,341 INFO [DefaultObjectGenerator] Synchronizing default repositories to datastore 2024-05-23 12:22:07,393 INFO [DefaultObjectGenerator] Synchronizing config properties to datastore 2024-05-23 12:22:07,499 INFO [DefaultObjectGenerator] Synchronizing notification publishers to datastore 2024-05-23 12:22:07,610 INFO [EventSubsystemInitializer] Initializing asynchronous event subsystem 2024-05-23 12:22:07,647 INFO [NotificationSubsystemInitializer] Initializing notification service 2024-05-23 12:22:07,649 INFO [IndexSubsystemInitializer] Building lucene indexes if required 2024-05-23 12:22:07,677 INFO [IndexManager] Checking the health of index PROJECT 2024-05-23 12:22:07,678 WARN [IndexManager] The index PROJECT does not exist 2024-05-23 12:22:07,678 INFO [IndexManager] (Re)Building index project 2024-05-23 12:22:07,679 INFO [IndexManager] Checking the health of index COMPONENT 2024-05-23 12:22:07,679 WARN [IndexManager] The index COMPONENT does not exist 2024-05-23 12:22:07,679 INFO [IndexManager] (Re)Building index component 2024-05-23 12:22:07,680 INFO [IndexManager] Checking the health of index SERVICECOMPONENT 2024-05-23 12:22:07,680 WARN [IndexManager] The index SERVICECOMPONENT does not exist 2024-05-23 12:22:07,680 INFO [IndexManager] (Re)Building index servicecomponent 2024-05-23 12:22:07,680 INFO [IndexManager] Checking the health of index VULNERABILITY 2024-05-23 12:22:07,680 WARN [IndexManager] The index VULNERABILITY does not exist 2024-05-23 12:22:07,680 INFO [IndexManager] (Re)Building index vulnerability 2024-05-23 12:22:07,680 INFO [IndexManager] Checking the health of index LICENSE 2024-05-23 12:22:07,680 WARN [IndexManager] The index LICENSE does not exist 2024-05-23 12:22:07,680 INFO [IndexManager] (Re)Building index license 2024-05-23 12:22:07,680 INFO [IndexManager] Checking the health of index VULNERABLESOFTWARE 2024-05-23 12:22:07,680 WARN [IndexManager] The index VULNERABLESOFTWARE does not exist 2024-05-23 12:22:07,681 INFO [IndexManager] (Re)Building index vulnerablesoftware 2024-05-23 12:22:07,684 INFO [ProjectIndexer] Starting reindex task. This may take some time. 2024-05-23 12:22:07,684 INFO [IndexManager] Deleting project index 2024-05-23 12:22:07,698 INFO [AlpineServlet] Starting Dependency-Track 2024-05-23 12:22:08,039 INFO [ProjectIndexer] Reindexing of 0 projects completed in PT0.007362077S 2024-05-23 12:22:08,065 INFO [ComponentIndexer] Starting reindex task. This may take some time. 2024-05-23 12:22:08,065 INFO [IndexManager] Deleting component index 2024-05-23 12:22:08,091 INFO [ComponentIndexer] Reindexing of 0 components completed in PT0.004203244S 2024-05-23 12:22:08,094 INFO [ServiceComponentIndexer] Starting reindex task. This may take some time. 2024-05-23 12:22:08,095 INFO [IndexManager] Deleting servicecomponent index 2024-05-23 12:22:08,118 INFO [ServiceComponentIndexer] Reindexing of 0 services completed in PT0.002128722S 2024-05-23 12:22:08,119 INFO [VulnerabilityIndexer] Starting reindex task. This may take some time. 2024-05-23 12:22:08,119 INFO [IndexManager] Deleting vulnerability index 2024-05-23 12:22:08,143 INFO [VulnerabilityIndexer] Reindexing of 0 vulnerabilities completed in PT0.004893251S 2024-05-23 12:22:08,145 INFO [LicenseIndexer] Starting reindex task. This may take some time. 2024-05-23 12:22:08,145 INFO [IndexManager] Deleting license index 2024-05-23 12:22:08,668 INFO [LicenseIndexer] Reindexing of 704 licenses completed in PT0.488989294S 2024-05-23 12:22:08,670 INFO [VulnerableSoftwareIndexer] Starting reindex task. This may take some time. 2024-05-23 12:22:08,670 INFO [IndexManager] Deleting vulnerablesoftware index 2024-05-23 12:22:08,685 INFO [VulnerableSoftwareIndexer] Reindexing of 0 VulnerableSoftwares completed in PT0.00194332S 2024-05-23 12:22:10,809 INFO [KeyManager] Generating new key pair 2024-05-23 12:22:12,452 INFO [KeyManager] Saving key pair 2024-05-23 12:22:12,479 INFO [AlpineServlet] Dependency-Track is ready 2024-05-23 12:22:12,482 INFO [NvdMirrorServlet] Initializing NVD mirror 2024-05-23 12:22:12,482 INFO [FileSystemResourceServlet] Initializing filesystem resource servlet 2024-05-23 12:22:17,643 INFO [PortfolioMetricsUpdateTask] Executing portfolio metrics update 2024-05-23 12:22:17,647 INFO [VulnerabilityMetricsUpdateTask] Executing metrics update on vulnerability database 2024-05-23 12:22:17,659 INFO [ClearComponentAnalysisCacheTask] Clearing ComponentAnalysisCache 2024-05-23 12:22:17,663 INFO [OsvDownloadTask] Google OSV mirroring is disabled. No ecosystem selected. 2024-05-23 12:22:17,670 INFO [ClearComponentAnalysisCacheTask] Complete 2024-05-23 12:22:17,673 INFO [PortfolioMetricsUpdateTask] Completed portfolio metrics update in 00:00:027 2024-05-23 12:22:17,708 INFO [VulnerabilityMetricsUpdateTask] Completed metrics update on vulnerability database in 00:00:060 2024-05-23 12:23:07,644 INFO [VulnDbSyncTask] Starting VulnDB mirror synchronization task 2024-05-23 12:23:07,645 INFO [VulnDbSyncTask] VulnDB mirror directory does not exist. Skipping. 2024-05-23 12:23:07,647 WARN [NistMirrorTask] The NVD is planning to retire the legacy data feeds used by Dependency-Track (https://nvd.nist.gov/General/News/change-timeline); Consider enabling mirroring via NVD REST API in the settings: https://docs.dependencytrack.org/datasources/nvd/#mirroring-via-nvd-rest-api 2024-05-23 12:23:07,648 INFO [NistMirrorTask] Starting NIST mirroring task 2024-05-23 12:23:07,648 INFO [NistMirrorTask] Mirrored data directory created successfully 2024-05-23 12:23:07,655 INFO [NistMirrorTask] Downloading files at Thu May 23 12:23:07 UTC 2024 2024-05-23 12:23:07,656 INFO [NistMirrorTask] Initiating download of https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2024.json.gz 2024-05-23 12:23:08,458 INFO [NistMirrorTask] Downloading... 2024-05-23 12:23:08,935 INFO [NistMirrorTask] Uncompressing nvdcve-1.1-2024.json.gz 2024-05-23 12:23:09,048 INFO [NvdParser] Parsing nvdcve-1.1-2024.json 2024-05-23 12:23:37,831 INFO [NistMirrorTask] Initiating download of https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2024.meta 2024-05-23 12:23:38,066 INFO [NistMirrorTask] Downloading... 2024-05-23 12:23:38,068 INFO [NistMirrorTask] Initiating download of https://nvd.nist.gov/feeds/json/cve/1.1/nvdcve-1.1-2023.json.gz 2024-05-23 12:23:38,209 INFO [NistMirrorTask] Downloading... 2024-05-23 12:23:39,012 INFO [NistMirrorTask] Uncompressing nvdcve-1.1-2023.json.gz

Does this chart doesn't support external databases ?

image

Kindly do the needful.

Thanks

nscuro commented 1 month ago

You have extraEnv defined twice:

extraEnv:
  ALPINE_DATABASE_MODE: "external"
  ALPINE_DATABASE_URL: "jdbc:sqlserver://.database.windows.net:1433;databaseName=SBOM;sendStringParametersAsUnicode=false;trustServerCertificate=false"
  ALPINE_DATABASE_DRIVER: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
  ALPINE_DATABASE_USERNAME: "-admin@"
  ALPINE_DATABASE_PASSWORD: "***"
extraEnv:
  SYSTEM_REQUIREMENT_CHECK_ENABLED: "false"

I'm guessing Helm will only render the latter of the two, which would omit the database settings you provided.

numa1985 commented 1 month ago

@nscuro : My bad as mentioned after removing the duplicate entry , I was able to connect the database and able to fetch the results. Thanks