Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JDOFatalUserException for long reference URLs from OSS Index #3650

Commits on Apr 28, 2024

  1. Fix JDOFatalUserException for long reference URLs from OSS Index

    When a reference URL won't fit in the respective database column, try to drop its query parameters first, and if that doesn't help (unlikely), make a hard cut at 255 characters.
    
    Example occurrence of the exception in question:
    
    ```
    javax.jdo.JDOFatalUserException: Attempt to store value "https://ossindex.sonatype.org/vulnerability/CVE-2023-47108?component-type=golang&component-`name=go.opentelemetry.io%2Fcontrib%2Finstrumentation%2Fgoogle.golang.org%2Fgrpc%2Fotelgrpc&utm_source=dependency-track&utm_medium=integration&utm_content=v4.11.0-SNAPSHOT" in column "REFERENCE_URL" that has maximum length of 255. Please correct your data!at org.datanucleus.api.jdo.JDOAdapter.getJDOExceptionForNucleusException(JDOAdapter.java:678) at org.datanucleus.api.jdo.JDOTransaction.commit(JDOTransaction.java:160) at alpine.persistence.AbstractAlpineQueryManager.persist(AbstractAlpineQueryManager.java:428) at org.dependencytrack.persistence.VulnerabilityQueryManager.addVulnerability(VulnerabilityQueryManager.java:218) at org.dependencytrack.persistence.QueryManager.addVulnerability(QueryManager.java:740) at org.dependencytrack.tasks.scanners.OssIndexAnalysisTask.processResults(OssIndexAnalysisTask.java:303)
    ...
    ```
    
    Signed-off-by: nscuro <nscuro@protonmail.com>
    nscuro committed Apr 28, 2024
    Configuration menu
    Copy the full SHA
    afb5cca View commit details
    Browse the repository at this point in the history