Skip to content
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

v0.54.0 is not installing plugins #7273

Closed
2 tasks
DmitriyLewen opened this issue Jul 31, 2024 Discussed in #7272 · 6 comments · Fixed by #7274
Closed
2 tasks

v0.54.0 is not installing plugins #7273

DmitriyLewen opened this issue Jul 31, 2024 Discussed in #7272 · 6 comments · Fixed by #7274
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@DmitriyLewen
Copy link
Contributor

Discussed in #7272

Originally posted by fatihtokus July 31, 2024

Description

Latest version of trivy v0.54.0 is not installation trivy plugins

Desired Behavior

Install plugins without an issue

Actual Behavior

$ curl -s -L -o - https://github.com/aquasecurity/trivy/releases/download/v0.54.0/trivy_0.54.0_Linux-64bit.tar.gz | tar -xz
$ ./trivy plugin install referrer
2024-07-31T10:14:01Z INFO [plugin] Updating the plugin index... url="https://aquasecurity.github.io/trivy-plugin-index/v1/index.yaml"
2024-07-31T10:14:01Z INFO [plugin] Installing the plugin... src="github.com/aquasecurity/trivy-plugin-referrer"

Reproduction Steps

1. trivy plugin install referrer
   trivy plugin list
2.
3.
...

Target

None

Scanner

None

Output Format

None

Mode

None

Debug Output

trivy plugin install referrer
trivy plugin list

Operating System

linux

Version

v0.54.0

Checklist

@DmitriyLewen DmitriyLewen added the kind/bug Categorizes issue or PR as related to a bug. label Jul 31, 2024
@knqyf263
Copy link
Collaborator

knqyf263 commented Jul 31, 2024

@DmitriyLewen I opened a PR, but it's a bit weird. It shows an error in my environment.

2024-07-31T14:51:48+04:00       FATAL   Fatal error     plugin install error: failed to install the plugin: unable to download the execution file (https://github.com/aquasecurity/trivy-plugin-referrer/releases/download/v0.3.1/trivy_plugin_referrer_0.3.1_macOS-ARM64.tar.gz): failed to download https://github.com/aquasecurity/trivy-plugin-referrer/releases/download/v0.3.1/trivy_plugin_referrer_0.3.1_macOS-ARM64.tar.gz: Get "https://github.com/aquasecurity/trivy-plugin-referrer/releases/download/v0.3.1/trivy_plugin_referrer_0.3.1_macOS-ARM64.tar.gz": failed to round trip: failed to get the file content: GET https://api.github.com/repos/aquasecurity/trivy-plugin-referrer/contents/releases/download/v0.3.1: 404 Not Found []

The original report claims that it doesn't fail, but the plugin is not installed. How does it work in your environment?

@DmitriyLewen
Copy link
Contributor Author

hm...
Your changes work correctly for me:

➜  trivy git:(fix/github_releases) ✗ ./trivy -d plugin install referrer
2024-07-31T17:04:52+06:00       DEBUG   Cache dir       dir="/Users/dmitriy/Library/Caches/trivy"
2024-07-31T17:04:52+06:00       INFO    [plugin] Installing the plugin...       src="github.com/aquasecurity/trivy-plugin-referrer"
2024-07-31T17:04:53+06:00       DEBUG   [plugin] Loading the plugin metadata...
2024-07-31T17:04:53+06:00       DEBUG   Installing the plugin...        path="/Users/dmitriy/.trivy/plugins/referrer"
2024-07-31T17:04:53+06:00       DEBUG   Platform found  os="darwin" arch="arm64"
2024-07-31T17:04:53+06:00       DEBUG   Downloading the execution file...       uri="https://github.com/aquasecurity/trivy-plugin-referrer/releases/download/v0.3.1/trivy_plugin_referrer_0.3.1_macOS-ARM64.tar.gz"
2024-07-31T17:04:56+06:00       INFO    [plugin] Plugin successfully installed  name="referrer" version="0.3.1"
➜  trivy git:(fix/github_releases) ✗ ./trivy plugin list
Installed Plugins:
  Name:    referrer
  Version: 0.3.1

@knqyf263
Copy link
Collaborator

OK, so let's merge my PR and cut v0.54.1.

@knqyf263
Copy link
Collaborator

@DmitriyLewen I opened a PR, but it's a bit weird. It shows an error in my environment.

I meant v0.54.0 returned an error and fixed the problem, but the behavior in my environment looks a bit different from the original bug report. Anyway, it's good to fix the bug.

@DmitriyLewen
Copy link
Contributor Author

behavior in my environment looks a bit different from the original bug report

I think author just didn't insert the error.
I see the same error as in your env.

@knqyf263
Copy link
Collaborator

Hopefully, it was fixed in v0.54.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants