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

Nix cannot be installed on subsequent runs on hosted runners #191

Closed
peperunas opened this issue Aug 25, 2023 · 6 comments
Closed

Nix cannot be installed on subsequent runs on hosted runners #191

peperunas opened this issue Aug 25, 2023 · 6 comments

Comments

@peperunas
Copy link

I switched to a self-hosted runner from ubuntu-latest and only the first action was able to complete successfully. The followings fail at installing Nix as it results already installed from the previous run.

It seems the installation in the self-hosted runner is not sandboxed, i.e., Nix is not installed on a per-action basis / contained.

Any hints?

Thank you!

@sandydoo
Copy link
Member

Could you paste the error you're seeing?

@peperunas
Copy link
Author

peperunas commented Sep 11, 2023 via email

@vbgl
Copy link

vbgl commented Feb 6, 2024

I’ve just witnessed a similar situation: first run on a self-hosted runner went nicely, the following one failed with:

~~> Checking for artifacts of previous installs
Before I try to install, I'll check for signs Nix already is or has
been installed on this system.

---- oh no! --------------------------------------------------------------------
I back up shell profile/rc scripts before I add Nix to them.
I need to back up /etc/bash.bashrc to /etc/bash.bashrc.backup-before-nix,
but the latter already exists.

@vbgl
Copy link

vbgl commented Feb 6, 2024

But it seems to have been fixed already: with version 25 of this action, in a similar setting I get:

Aborting: Nix is already installed at /nix/var/nix/profiles/default/bin/nix

@guidodobboletta
Copy link

I still see this with version 25

---- oh no! --------------------------------------------------------------------
  I back up shell profile/rc scripts before I add Nix to them.
  I need to back up /etc/bashrc to /etc/bashrc.backup-before-nix,
  but the latter already exists.

@sandydoo
Copy link
Member

It seems the installation in the self-hosted runner is not sandboxed, i.e., Nix is not installed on a per-action basis / contained.

This is a common misconception with self-hosted runners. There's no sandboxing by default. GitHub leaves it up to you to figure out how to set this up.

I’ve just witnessed a similar situation: first run on a self-hosted runner went nicely, the following one failed with...

I still see this with version 25

The action checks whether nix is in the PATH. If Nix is already installed on your runner, but the action can't find it, then there's likely something wrong with your environment. You may have to modify your runner to make this work.

A lot of this was already discussed in #98, so I'm closing this as a duplicate.

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

No branches or pull requests

4 participants