snyk / snyk-gradle-plugin

Basic Snyk CLI plugin for Gradle support
Other
25 stars 19 forks source link

Execution failed for task ':snykResolvedDepsJson'. > java.util.ConcurrentModificationException (no error message) #270

Closed cookieMr closed 11 months ago

cookieMr commented 11 months ago

Expected behaviour

Gradle task snykResolvedDepsJson passes and reports vulnerabilities.

Actual behaviour

I observer this issue when i updated SpringFramework Boot Gradle Plugin from 3.1.5 to 3.1.6 (same issue is when i update it to 3.2.0).

The reported line (in a file on my local /var/folders/94/9kpdzysj3f53fpxq41f0l9d40000gq/T/tmp-32034-fKjko8xrsZmb--init.gradle) is the same line (i judged content, not line nr) as in this repo.

FAILURE: Build failed with an exception.

* Where:
Initialization script '/var/folders/94/9kpdzysj3f53fpxq41f0l9d40000gq/T/tmp-32034-fKjko8xrsZmb--init.gradle' line: 311

* What went wrong:
Execution failed for task ':snykResolvedDepsJson'.
> java.util.ConcurrentModificationException (no error message)

Steps to reproduce

Run the cmd from the top of this description.

I'm also able to reproduce this in this repo (use branch snyk-gradle-concurrency-issue) (The 1st repo i observed this is a work repo).


Debug logs:

SNYK_TOKEN=XXX snyk test --debug
Error: 
Testing /Users/cookieMr/Documents/repos/project-x...

Gradle Error (short):
> java.util.ConcurrentModificationException (no error message)
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

===== DEBUG INFORMATION START =====

------------------------------------------------------------
Gradle 7.6.3
------------------------------------------------------------

Build time:   2023-10-04 15:59:47 UTC
Revision:     1694251d59e0d4752d547e1fd5b5020b798a7e71

Kotlin:       1.7.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          17.0.9 (Amazon.com Inc. 17.0.9+8-LTS)
OS:           Mac OS X 13.0 aarch64

>>> command: '/Users/cookieMr/Documents/repos/project-x/gradlew' 'snykResolvedDepsJson' '-q' '--build-file' '/Users/cookieMr/Documents/repos/project-x/build.gradle' '-Dorg.gradle.parallel=' '-Dorg.gradle.console=plain' '-PonlySubProject=.' '-I' '/var/folders/94/9kpdzysj3f53fpxq41f0l9d40000gq/T/tmp-57260-XQLF4weZmE96--init.gradle' '--no-configuration-cache'
>>> exit code: 1
>>> stdout:
SNYKECHO Current project: project-x-service
SNYKECHO snykResolvedDepsJson task is executing via doLast

>>> stderr:

FAILURE: Build failed with an exception.

* Where:
Initialization script '/var/folders/94/9kpdzysj3f53fpxq41f0l9d40000gq/T/tmp-57260-XQLF4weZmE96--init.gradle' line: 311

* What went wrong:
Execution failed for task ':snykResolvedDepsJson'.
> java.util.ConcurrentModificationException (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 363ms

===== DEBUG INFORMATION END =====

Error running Gradle dependency analysis.

Please ensure you are calling the `snyk` command with correct arguments.
If the problem persists, contact support@snyk.io, providing the full error
message from above, starting with ===== DEBUG INFORMATION START =====.
    at test (/snapshot/project/dist/cli/webpack:/snyk/src/cli/commands/test/index.ts:286:19)
    at runCommand (/snapshot/project/dist/cli/webpack:/snyk/src/cli/main.ts:51:25)
    at main (/snapshot/project/dist/cli/webpack:/snyk/src/cli/main.ts:319:11)
    at /snapshot/project/dist/cli/webpack:/snyk/src/cli/index.ts:13:3
    at Object.callHandlingUnexpectedErrors (/snapshot/project/dist/cli/webpack:/snyk/src/lib/unexpected-error.ts:28:5)
anthogez commented 11 months ago

@cookieMr we have applied this change, that soon will be available within a newest version of cli and will solve your issue.

anthogez commented 11 months ago

Waiting for this pull request to be approved/merged

anthogez commented 11 months ago

Solved https://github.com/snyk/cli/pull/4955 @cookieMr if additional issues, feel free to reach out. Thanks!

cookieMr commented 11 months ago

Thx you guys for such fast fix.