-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
org.owasp.dependencycheck.analyzer.exception.AnalysisException: Failed to request component-reports due to blank lines in requirements.txt #6731
Comments
Having the same problem but only for some projects. [WARN] An error occurred while analyzing '/Users/[CUT]/Projects/[CUT]/app/init.py' (Sonatype OSS Index Analyzer). |
I've confirmed that it is a regression between 9.1.0 and 9.2.0. 9.1.0 finds 11 vulnerabilities among 5 dependencies
9.2.0 finds 2 vulnerabilities among 1 dependency:
|
@jeremylong any advice of where to look for this regression? the diff between 9.1.0 ... 9.20 is most dependabot and a new unrelated(?) analyzer. |
This issue is also happening with version 10.0.1. It appears to be an issue with connecting to Sonatype OSS. The issue is happening if the OSS Variables (user, password, url) are supplied or not. I saw two issues with the OSS connection.
First error which spams the output for just about every node_module file:
Second Error:
Log Message:
Java Version: |
I had the same issue too with the requirements.txt. The reason was blank lines in this file. Try to remove them. |
The requirements.txt does not have any extra spaces in it, we generate it at the time with pip freeze > requirements.txt. Our build method is to use setup.py to contain all of our dependencies. We use that to install pacakges during the build into a venv and source the venv. The issue is being thrown from the packages under .venv and in node_modules. This may be a documentation update request, but should node_modules and a virtual environment be excluded from the dependency check run? |
It means you have a different error cause than Francis. "An error occurred while analyzing requirements.txt (Sonatype OSS Index Analyzer)." I could reproduce it very easily. Adding a new empty line (in between, not at the end of the requirements.txt) causes the above mentioned error. |
If that truly is the cause of my error, which I haven't verified yet, then this is a bug report. My requirements.txt is generated by |
I have upgraded to 10.0.3 and confirmed the error still occurs for me. I have also confirmed @andriyzhurba comment that removing any blank lines in requirements.txt resolves the issue. I believe that the ODC code which reads requirements.txt should be resilient to the presence of blank lines. In my case, these blank lines are generated by |
Can a sample |
@jeremylong It's pretty easy. It's not spaces, but empty lines. requirements.txt - this file will work
requirements.txt - this one will run into error:
|
Here's an example generated by pip-compile. Just removing the blank line was sufficient to avoid the error, so I don't think the other non-package lines cause a problem but including it for completeness:
|
fix will be included in the next release. |
@jeremylong I'd like to make use of this fix. When can I expect the next release? |
Describe the bug
Dependency Check fails with a 400 error when requesting something from the Sonatype OSS Index, leading to fewer CVEs found in the report and warnings in the job log like
An error occurred while analyzing requirements.txt (Sonatype OSS Index Analyzer).
Version of dependency-check used
The problem occurs using version 9.2.0 of the CLI -- both docker and brew packaging
Log file
https://gist.github.com/francisATgwn/ece673ba589b75110a3aeecc9354708e
To Reproduce
Steps to reproduce the behavior:
Expected behavior
[WARN] An error occurred while analyzing '...' (Sonatype OSS Index Analyzer).
does not appear in logorg.owasp.dependencycheck.analyzer.exception.AnalysisException: Failed to request component-reports
appearing in the Analysis Exceptions section of the HTML reportAdditional context
This does not happen when run with the 8.4.3 docker image from the same environment on the same project at the same time.
The 8.4.3 CLI invocation is similar to the 9.2.0 invocation:
The text was updated successfully, but these errors were encountered: