Using MSSQL overloads SQL server
See original GitHub issueWhen i started up Dependacytrack container i noticed that the MSSQL server was using 100% CPU.
Current Behavior:
Dependacytracker seems to be locked in a loop running the following query:
(@P0 nvarchar(4000))SELECT 'org.dependencytrack.model.VulnerableSoftware' AS DN_TYPE,A0.CPE22,A0.CPE23,A0.EDITION,A0.ID,A0."LANGUAGE",A0.OTHER,A0.PART,A0.PRODUCT,A0.PURL,A0.PURL_NAME,A0.PURL_NAMESPACE,A0.PURL_QUALIFIERS,A0.PURL_SUBPATH,A0.PURL_TYPE,A0.PURL_VERSION,A0.SWEDITION,A0.TARGETHW,A0.TARGETSW,A0."UPDATE",A0.UUID,A0.VENDOR,A0.VERSION,A0.VERSIONENDEXCLUDING,A0.VERSIONENDINCLUDING,A0.VERSIONSTARTEXCLUDING,A0.VERSIONSTARTINCLUDING,A0.VULNERABLE FROM VULNERABLESOFTWARE A0 WHERE A0.CPE23 = @P0 AND A0.VERSIONENDEXCLUDING IS NULL AND A0.VERSIONENDINCLUDING IS NULL AND A0.VERSIONSTARTEXCLUDING IS NULL AND A0.VERSIONSTARTINCLUDING IS NULL
Steps to Reproduce:
Start a clean install of dependecytrack against mssql
Expected Behavior:
Environment:
- Dependency-Track Version: 3.8.0
- Distribution: Docker
- BOM Format & Version:
- Database Server:MSSQL Azure
- Browser:
Additional Details:
This is a clean install from docker. I also see that it redownloads all external advisories every time i reboot the container, that might be related or a seperate issue.
My suspesion is that this is some sort of background job, it happens with no users active.
Screenshot of CPU usage: https://imgur.com/a/JnZC9Iq
Only warning in error log: 2:45:41.421 WARN [Datastore] Default type for java type of java.lang.Float was previously jdbc-type=FLOAT but this is not provided by the JDBC driver! Please report this to the DataNucleus developers db_1 | 12:45:41.422 WARN [Datastore] Default type for java type of java.lang.Double was previously jdbc-type=FLOAT but this is not provided by the JDBC driver! Please report this to the DataNucleus developers
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (11 by maintainers)
Top GitHub Comments
It works across all queries being sent to the SQL Server database. What a difference.
All parameters received from the application are now
varchar
Query plan before/after the change (WOW)
Thank you for the help.
Thats fantastic. I’m going to add this to the documentation. Thanks for reporting back.