Skip to content
New issue

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

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

Already on GitHub? # to your account

Reports are not generating because it could not create temp file #144

Open
arsharthpugazhendhi opened this issue Dec 23, 2024 · 2 comments

Comments

@arsharthpugazhendhi
Copy link

When trying to generate a report using Scan2html plugin, I'm getting this following error, can someone help me with this?

trivy -d scan2html image tag --scan2html-flags --output interactive_report.html
2024-12-23T14:54:08.717+0530 INFO Scan2html started
2024-12-23T14:54:08.717+0530 INFO RetrievePluginFlagsAndCommand: [/home/appuser/.trivy/plugins/scan2html/scan2html -d 99205e5760d7 --scan2html-flags --output interactive_report.html]
2024-12-23T14:54:08.717+0530 INFO RetrievePluginFlagsAndCommand - pluginFlags: map[--output:interactive_report.html --report-title:Trivy Report --scan2html-flags:]
2024-12-23T14:54:08.717+0530 INFO RetrievePluginFlagsAndCommand - trivyFlags: [/home/appuser/.trivy/plugins/scan2html/scan2html -d 99205e5760d7 --format json --output /tmp/scan2html-temp-report.json]
2024-12-23T14:54:08.721+0530 INFO Run the Trivy command: trivy -d image tag --format json --output /tmp/scan2html-temp-report.json
2024-12-23T14:54:10.152+0530 INFO GenerateHtmlReport: map[--output:interactive_report.html --report-title:Trivy Report --scan2html-flags:]
2024-12-23T14:54:10.152+0530 INFO Base Directory: /home/appuser/.trivy/plugins/scan2html

2024-12-23T14:54:10.152+0530 INFO With EPSS: false

2024-12-23T14:54:10.152+0530 INFO Report Title: Trivy Report

2024-12-23T14:54:10.152+0530 INFO Report Name: interactive_report.html

2024-12-23T14:54:10.154+0530 FATAL Error generating HTML report: failed to replace report title in interactive_report.html: could not create temp file: open /tmp/modified_2055264813: permission denied
Error: plugin error: plugin exec: exit status 1
Usage:
trivy scan2html [flags]

Flags:
-h, --help help for scan2html

Global Flags:
--cache-dir string cache directory (default "/home/appuser/.cache/trivy")
-c, --config string config path (default "trivy.yaml")
-d, --debug debug mode
--generate-default-config write the default config to trivy-default.yaml
--insecure allow insecure server connections
-q, --quiet suppress progress bar and log output
--timeout duration timeout (default 5m0s)
-v, --version show version

2024-12-23T14:54:10.156+0530 FATAL plugin error: plugin exec: exit status 1

@fatihtokus
Copy link
Owner

fatihtokus commented Dec 25, 2024

Hi @arsharthpugazhendhi ,

Thanks for reporting this. Can you try the below command and let me know if "-d" is the problem?

trivy scan2html image tag --scan2html-flags --output interactive_report.html

Also, on which OS are you running this?

@arsharthpugazhendhi
Copy link
Author

Hi @fatihtokus,

The issue occurred because the temporary JSON report file (/tmp/scan2html-temp-report.json) was not found, which caused the HTML report generation to fail. This happens if the Trivy command to generate the JSON report did not execute correctly or if the file was not created in the /tmp directory.

It is Linux environment.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants