-
Notifications
You must be signed in to change notification settings - Fork 594
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
Syft tries to create the cache directory at a location that has no permission #2984
Comments
It is also crashing on windows
Crashing on Debian WSL with this configuration:
|
Hi @kzantow, thanks for your changes. I'll try to build and check. I also worked on pure Linux machine (before I saw your commit) to check and doing change of settings, and found out: When I have search-local-mod-cache-licenses setting to true, I get a crash. golang: In case it's false, program works as usual. |
Hi @Joerki -- I think I've addressed the issues you've raised here, where invalid directories would result in panics rather than being handled properly. Apologies for that, this seems like a case that probably should have been accounted for from the get-go. Please let us know if the latest release continues to give you issues! |
What happened:
Hi @kzantow,
the new cache implementation is partially not working. Without changing my previous configuration (#2798). If, in a Docker container syft tries to create the cache subdirectory at an unusual place (root dir, $HOME is missing), this operation failes and syft crashes later on.
When I add -e HOME=/tmp to the docker command line it does not crash.
[0000] WARN unable to get filesystem cache at /.cache/syft: unable to create directory at '/.cache/syft//.cache/syft': mkdir /.cache: permission denied
What you expected to happen:
Syft should check writing permissions of the directory where cache shall be created and reports the problem with explicit directory when this operation fails.
Steps to reproduce the issue:
Set HOME to a directory without write permissions.
Scan an Docker image with Go binaries (like mongo)
Enable settings to fetch packages to identify licenses (see settings below).
I created a Docker image with syft binary to use it in differend environments. In the case that HOME is "/", syft crashes.
If I change HOME to "/" in my usual, local environment (WSL), syft is reporting the warning, but does not crash.
Anything else we need to know?:
Environment:
Output of
syft version
:It is newest Syft version 1.7.0
OS (e.g:
cat /etc/os-release
or similar):Linux, on Debian WSL also in self-created Docker container based on Debian image.
The text was updated successfully, but these errors were encountered: