-
Notifications
You must be signed in to change notification settings - Fork 81
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
actions-runner-controller: install-nix.sh: line 20: USER: unbound variable #122
Comments
Hit this today while trying to use Nix at work |
Alright, I went down the rabbit hole on this and a number of things are involved in this failure. Firstly, there's an issue where the default config of The simple solution is to set the following in your spec:
template:
spec:
image: "summerwind/actions-runner-dind"
dockerdWithinRunnerContainer: true This will avoid the installer failing due to the sandbox not being able to work. Secondly, there's the issue of spec:
template:
spec:
env:
- name: USER
value: runner Once the above are out of the way, we're still in trouble because the installation script here will trigger this bit of code: install-nix-action/lib/install-nix.sh Lines 42 to 48 in b2b9fc6
And L46 there is, I believe, wrong on two levels:
If you attempt to work around this by Finally, you can avoid using this action altogether and just manually doing what it would (kind of): jobs:
test-nix:
runs-on: [self-hosted, linux, x64]
steps:
- name: install nix
run : |
sh <(curl -L https://nixos.org/nix/install) --no-daemon --no-channel-add
mkdir -p ~/.config/nix
touch ~/.config/nix/nix.conf
echo "max-jobs = auto" >> ~/.config/nix/nix.conf
echo "cores = 0" >> ~/.config/nix/nix.conf
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH"
echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
echo "NIX_PATH=nixpkgs=channel:nixos-unstable" >> "$GITHUB_ENV"
- name: nix-hello
run: nix run nixpkgs\#hello @bbigras, can you try this out? |
Oh, another thing, if you're running your cluster on GKE you need to force your node pool to use the |
I'm still encountering this issue using
Any ideas? |
Are you running those runners yourself? |
Yeah I am, corporate restrictions means I need to self-host our runners. I do however have complete control over the runner image as it’s homebrewed. I set the env: to have USER=runner like the other poster but it wasn’t happy still |
Did you see the post above from @lovesegfault how to set $USER correctly? |
I'm still having issues @domenkozar but these are relating to my custom runner image in use. I will leave this for now and revisit when I have some time to resolve this. |
Did this ever get a confirmed resolution? We are also seeing this problem with runners deployed via the actions runner controller |
@gthomson31 could you post the full log and other specific things about your environment? |
We are also using the Actions-Runner-Controller to manage the runners -
Have tested using images built from the following versions Have not yet implemented the steps above mentioned to enabled Dockerfile for Image
Error Message
|
Also tried to set the ENV variable as part of the workflow run which threw up a new error. Workflow
Error
|
Could you try this workaround: NixOS/nix#4107 (comment) |
@domenkozar trying to get this to work but it is not allowing me to unmount the directory within the summerwind image. |
I'm trying to use install-nix action with https://github.com/actions-runner-controller/actions-runner-controller and I get:
If I set
USER
torunner
, I get permission error on/etc
.If I run
sudo chmod 777 /etc
, it fails when trying to mount /proc.cc @hiroqn beacuse of #43 (comment)
The text was updated successfully, but these errors were encountered: