Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Checkov has failed to run on a file (cloudFormation template) #114

Open
lagrianitis opened this issue May 20, 2022 · 2 comments
Open

Checkov has failed to run on a file (cloudFormation template) #114

lagrianitis opened this issue May 20, 2022 · 2 comments

Comments

@lagrianitis
Copy link

lagrianitis commented May 20, 2022

After opening a file, checkov attempts to scan it and then fails.

Logs show the following:

bootstrap

2022-05-20 06:37:40,659 [MainThread  ] [INFO ]  You are using an API key and did not set the --include-all-checkov-policies flag, so policies that only exist in Checkov, and not the BC / PC platform, will be skipped.
2022-05-20 06:37:40,660 [MainThread  ] [DEBUG]  Checkov version: 2.0.1147
2022-05-20 06:37:40,660 [MainThread  ] [DEBUG]  Python executable: /usr/local/bin/python
2022-05-20 06:37:40,660 [MainThread  ] [DEBUG]  Python version: 3.10.4 (main, Apr 20 2022, 01:09:52) [GCC 10.3.1 20211027]
2022-05-20 06:37:40,660 [MainThread  ] [DEBUG]  Checkov executable (argv[0]): /usr/local/bin/checkov
2022-05-20 06:37:40,660 [MainThread  ] [DEBUG]  Command Line Args:   -d /checkovScan -s --bc-api-key **** --repo-id jetbrains/extension -o json
Defaults:
  --framework:       ['all']
  --branch:          master
  --download-external-modules:False
  --external-modules-download-path:.external_modules
  --evaluate-variables:True
2022-05-20 06:15:07,910 [MainThread  ] [INFO ]  You are using an API key and did not set the --include-all-checkov-policies flag, so policies that only exist in Checkov, and not the BC / PC platform, will be skipped.
2022-05-20 06:15:07,910 [MainThread  ] [DEBUG]  Checkov version: 2.0.1147
2022-05-20 06:15:07,910 [MainThread  ] [DEBUG]  Python executable: /usr/local/bin/python
2022-05-20 06:15:07,910 [MainThread  ] [DEBUG]  Python version: 3.10.4 (main, Apr 20 2022, 01:09:52) [GCC 10.3.1 20211027]
2022-05-20 06:15:07,910 [MainThread  ] [DEBUG]  Checkov executable (argv[0]): /usr/local/bin/checkov
2022-05-20 06:15:07,910 [MainThread  ] [DEBUG]  Command Line Args:   -d /checkovScan -s --bc-api-key **** --repo-id jetbrains/extension -o json
Defaults:
  --framework:       ['all']
  --branch:          master
  --download-external-modules:False
  --external-modules-download-path:.external_modules
  --evaluate-variables:True
...

...
    "summary": {
        "passed": 15,
        "failed": 8,
        "skipped": 0,
        "parsing_errors": 0,
        "resource_count": 7,
        "checkov_version": "2.0.1147"
    },
    "url": "Add an api key '--bc-api-key <api-key>' to see more detailed insights via https://bridgecrew.cloud"
}�

To report: open a issue at https://github.com/bridgecrewio/checkov-jetbrains-ide/issues

2022-05-20 08:37:46,083 [ 101180]   INFO - STDERR - org.json.JSONException: JSONObject["summary"] not found.
2022-05-20 08:37:46,083 [ 101180]   INFO - STDERR - 	at org.json.JSONObject.get(JSONObject.java:587)
2022-05-20 08:37:46,083 [ 101180]   INFO - STDERR - 	at org.json.JSONObject.getJSONObject(JSONObject.java:797)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.bridgecrew.CheckovResultKt.getFailedChecksFromObj(CheckovResult.kt:81)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.bridgecrew.CheckovResultKt.getFailedChecksFromResultString(CheckovResult.kt:45)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.bridgecrew.services.CheckovScanService.getGroupedResults(CheckovScanService.kt:138)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.bridgecrew.services.CheckovScanService.analyzeScan(CheckovScanService.kt:110)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.bridgecrew.services.CheckovScanService.access$analyzeScan(CheckovScanService.kt:40)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.bridgecrew.services.CheckovScanService$ScanTask.run(CheckovScanService.kt:165)
2022-05-20 08:37:46,084 [ 101181]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
2022-05-20 08:37:46,085 [ 101182]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
2022-05-20 08:37:46,085 [ 101182]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
2022-05-20 08:37:46,085 [ 101182]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
2022-05-20 08:37:46,085 [ 101182]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
2022-05-20 08:37:46,085 [ 101182]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
2022-05-20 08:37:46,085 [ 101182]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
2022-05-20 08:37:46,086 [ 101183]   INFO - STDERR - 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2022-05-20 08:37:46,087 [ 101184]   INFO - STDERR - 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2022-05-20 08:37:46,087 [ 101184]   INFO - STDERR - 	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
2022-05-20 08:37:46,087 [ 101184]   INFO - STDERR - 	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
2022-05-20 08:37:46,087 [ 101184]   INFO - STDERR - 	at java.base/java.security.AccessController.doPrivileged(Native Method)
2022-05-20 08:37:46,087 [ 101184]   INFO - STDERR - 	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
2022-05-20 08:37:46,087 [ 101184]   INFO - STDERR - 	at java.base/java.lang.Thread.run(Thread.java:829)

Checkov Intelliij plugin version: 0.0.20

INTELLIJ

2022-05-20 08:01:39,804 [    169]   INFO - #c.i.i.StartupUtil - IDE: IntelliJ IDEA (build #IU-221.5591.52, 10 May 2022 20:56)

MAC OSX

2022-05-20 08:01:39,806 [    171]   INFO - #c.i.i.StartupUtil - OS: Mac OS X (12.3.1, x86_64)

**JVM Version**

2022-05-20 08:01:39,814 [ 179] INFO - #c.i.i.StartupUtil - JRE: 11.0.14.1+1-b2043.45 (JetBrains s.r.o.)
2022-05-20 08:01:39,815 [ 180] INFO - #c.i.i.StartupUtil - JVM: 11.0.14.1+1-b2043.45 (OpenJDK 64-Bit Server VM)

JVM OPTS

2022-05-20 08:01:39,817 [    182]   INFO - #c.i.i.StartupUtil - JVM options: [-Xms128m, -Xmx750m, -XX:ReservedCodeCacheSize=512m, -XX:+IgnoreUnrecognizedVMOptions, -XX:+UseG1GC, -XX:SoftRefLRUPolicyMSPerMB=50, -XX:CICompilerCount=2, -XX:+HeapDumpOnOutOfMemoryError, -XX:-OmitStackTraceInFastThrow, -ea, -Dsun.io.useCanonCaches=false, -Djdk.http.auth.tunneling.disabledSchemes="", -Djdk.attach.allowAttachSelf=true, -Djdk.module.illegalAccess.silent=true, -Dkotlinx.coroutines.debug=off, -XX:ErrorFile=/Users/user/java_error_in_idea_%p.log, -XX:HeapDumpPath=/Users/user/java_error_in_idea.hprof, -Xmx2048m, -Djb.vmOptionsFile=/Users/user/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions, -Dsplash=true, -Didea.strict.classpath=true, -Didea.jre.check=true, -Didea.executable=idea, -Didea.home.path=/Applications/IntelliJ IDEA.app/Contents, -Djava.system.class.loader=com.intellij.util.lang.PathClassLoader, -Didea.paths.selector=IntelliJIdea2022.1, -Didea.vendor.name=JetBrains]

It looks related to: #108

@lagrianitis
Copy link
Author

lagrianitis commented May 20, 2022

I have tested this with cloudformation and terraform and it seems that this error occurs with cloudformation templates.
With terraform code it outputs the results as intended.

@lagrianitis lagrianitis changed the title Checkov has failed to run on a file Checkov has failed to run on a file (cloudFormation template) May 20, 2022
@tomotway
Copy link

Am hitting the same issue

org.json.JSONException: JSONObject["summary"] not found.

Am using most recent version of Intellij and this plugin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants