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

Error: Invalid array length sometimes occurs when severity_threshold is set and exceeded #150

Open
2 of 3 tasks
frankgrimes97 opened this issue Aug 29, 2024 · 2 comments · May be fixed by #151
Open
2 of 3 tasks

Comments

@frankgrimes97
Copy link

frankgrimes97 commented Aug 29, 2024

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

As reported on #10 (comment) it seems the issue still persists even when using the latest v3/v3.0.0 release.

I have created a standalone repo and workflow which demonstrates the error: frankgrimes97/ghaction-container-scan-tests#1

Expected behaviour

It should output:

Container image is unhealthy. Following your desired severity threshold (HIGH), the job has been marked as failed.

Actual behaviour

It outputs:

Error: Invalid array length

Steps to reproduce

We're sometimes getting this "Invalid array length" error on our scans so it appears that it may not be entirely fixed by #12.

Some of our image scans with severity_threshold work as expected, and others get Error: Invalid array length so it appears to depend on the actual Trivy output.

Repository URL

frankgrimes97/ghaction-container-scan-tests#1

Workflow run URL

https://github.com/frankgrimes97/ghaction-container-scan-tests/actions/runs/10618322367/job/29433472519

YAML workflow

https://github.com/frankgrimes97/ghaction-container-scan-tests/blob/bug/severity-threshold-invalid-array-length-reproducer/.github/workflows/workflow.yml

Workflow logs

No response

Additional info

No response

@frankgrimes97 frankgrimes97 changed the title Error: Invalid array length sometimes occurs when severity_threshold is set and exceeded Error: Invalid array length sometimes occurs when severity_threshold is set and exceeded Aug 29, 2024
@frankgrimes97
Copy link
Author

FWIW, I've done a little bit of local debugging and believe this may address the issue: #151

@frankgrimes97
Copy link
Author

@crazy-max Could you not also simply use String.prototype.padEnd() to accomplish the same more simply and in a less error-prone way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant