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
Could not perform Node Audit analysis #3717
Comments
wanted to bump this, in hopes we can get some help. Thanks! |
We are observing the same failure, and so far it looks flaky. We cannot see anything in the affected package.json or package-lock.json that could trigger this error. |
Also getting lots of these errors when trying to implement Dependency-Check into our project. We have a fairly large project with many sub-projects that each have their own package-lock.json, and it works fine for many and gives the above error for others. We haven't been able to find anything in the failing ones that differentiates them from the passing ones to cause the error. |
Pretty sure this will be fixed in 6.5.0 which was slightly delayed but should be released this weekend. |
@jeremylong it doesn't seem to be fixed for us. Can you point me to the code change that supposed to fix the problem. What information do you need to get the insides you need to better understand the issue we face? |
6.5.0 did not fix this for us. Seems to be due to package-locks generated with newer versions of npm (7, 8) |
Can confirm, it’s totally broken on package-lock.json files generated with latest stable version of npm (8). For us, this is on multiple projects, not sure if it’s every case. This has been an issue for a while, hoping it can get a bump in priority. |
We have the same issue with package-lock.json files generated by npm 8, so many of our CI/CD pipelines are breaking. The current workaround to allow the dependency scan job to fail is not really a good approach, so we would also love if the priority of this issue could be bumped. Just an idea, but maybe the change from lockfileVersion 1 to lockfileVersion 2 causes some troubles? |
Interestingly, I'm finding that:
Whereas:
So this seems to confirm @racedale, @StudentBlake and @Samuel-Schober-USU's suspicions; and makes it clear that there is a sort-of-workaround for now (i.e. force Node 14 and regenerate Hopefully @jeremylong this is helpful to you in narrowing down the issue. Perhaps you can experiment locally with NodeJS 16 and thereby identify the root of the problem. Oh, and I upgraded to the very latest Dependency-Check 6.5.3 - same behaviour. |
Same thing happening here. CI/CD are failing with this error and the move was to live with the existing findings. |
I had the same problem. In my case the situation was that on dev machine After some try-and-error I solved it by removing node14/npm6, deleting node_modules and package-lock.json then installing node16/npm8 and recreating node_modules and package-lock.json (by npm install) on dev and commited new package-lock.json which now had lockfileVersion 2. DependencyCheck now runs fine on both dev and CI. It's also probably worth mentioning that I'm running DependencyCheck as maven plugin 7.0.0 |
So, I understand that we cannot use DependencyCheck anymore with Node 16+ or npm 7/8 and a package-lock.json with lockFileVersion 2 ? |
That's correct, the payload which is sent to the NPM API is invalid resulting in an error being returned by the API. The |
There is an other ticket around this checker (and the problem ? ) |
I made an interesting observation. I took the submitted payload from the logfile and posted it using curl in a shell. Surprisingly it worked and I got an HTTP status 200 and a valid response. Then I tried it with a small Java program that uses code snippets from the owasp dependency check. That didn't work. The difference I noticed, after looking at the curl request in detail was the content-type header. Curl, per default, posts files as "application/x-www-form-urlendoded". After changing the code to set the same header as curl does, it worked. Changing the header in curl got me a 400 Bad request likewise. It looks like a strange behaviour to me, does anyone have any documentation for die npm audit api? |
I've been doing a bit of digging and one of the things I found was that the content-type needs to be set as application/json if running using curl, as suggested by @mum-viadee. The second thing I found was that since npm v7 the npm/cli project uses Arborist to generate the dependency tree. It looks like it then submits the tree to the |
the same isuue with:
if i grep "error" depcheck.log:
could the fact that the package-lock.json file is 2.5 megabytes be a problem? |
Hello, Is there a fix planned and or identified :) ? |
We already had our package-lock.json upgraded to |
@jeremylong Has this version/fix been releases? |
@alex-arzaghi FYI in our pipelines, we're still using Node 14 specifically for |
Check this #3716 (comment) |
Is there a way to specify the endpoint for the cli? I don't see that param in the documentation. |
The option does not exist on command line but can be provided using the properties file. Add the following to your existing properties file And if not already using a properties file, create one and then add |
What seemed to work for me was to reinstate the resolved and integrity values in package-lock.json that npm v8 had lost by running npx npm@6.14.18 install && npm install After which the previously failing Node Audit analysis completed without error. |
This still happens in 8.2.1, with node 18.x. |
Did anyone found a workaround for this issue? I am facing same problem with command:
|
My team has been working over the last couple of days to understand why this error is being thrown in our Jenkins build pipeline:
I have attached the package.json file and the package-lock.json file for this project in the issue. Can you give me some guidance on what could be causing the above issue, and how to fix it, given this information?
dependency check attachments - package and package-lock.zip
The text was updated successfully, but these errors were encountered: