-
Notifications
You must be signed in to change notification settings - Fork 231
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
using xdg_data_home for report_path #937
Comments
It looks like the issue you're facing is due to permission errors when trying to access the /root/.local/share/garak/garak_runs directory in your GitHub Actions workflow. To fix this, you could adjust Garak to store the report in a directory relative to your project instead of a system directory that requires elevated permissions. You can modify the path in the code to make it relative to your project folder. Here's an approach you could take: Determine the Project Path: You can set up a relative project path by using Python’s os module to find the current project directory: import os Current Line Causing Issues: In garak/garak/command.py, line 68: report_path = _config.transient.data_dir / _config.reporting.report_dir |
Strongly recommend against running garak as root, which seems like it's what's happening here.
Good to know, thanks
We disprefer relative paths because they present a security risk. The XDG pattern is also well-supported across platforms. I think in this case I'd recommend configuring
and then invoke garak with something like |
Summary
I tried using garak within a github workflow and i wanted to upload the report as an artifact. I use a runner as a service with ubuntu, and xdg_data_home returns the path
/root/.local/share
. With the report being placed in/root/.local/share/garak/garak_runs
the github actionactions/upload-artifact@v4
returnsError: EACCES: permission denied, lstat /root/.local/share/garak/garak_runs
.Would it be a possibility to have the folder garak_runs as a path relative to the project? That is, are there clear downsides to using something like :
instead of this line
https://github.com/leondz/garak/blob/1e58295e2f8789ac95f72a9b5df8d9f9276322a0/garak/command.py#L68
or at least have both options ?
Thank you,
Lacramioara
Relevant information
I suppose this issue actions/upload-artifact#192 is related to the error i get.
The text was updated successfully, but these errors were encountered: