cachix / install-nix-action

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Apache License 2.0
520 stars 80 forks source link

fail to run on macos-latest #183

Open yihuang opened 1 year ago

yihuang commented 1 year ago

the action fails on macos-latest with error message:

Could not set environment: 150: Operation not permitted while System Integrity Protection is engaged
  Error: Process completed with exit code 150.

it seems to work after we pin to macos-11 though, which don't have the "System Integrity Protection" feature.

UPDATE: upgrade to install-nix-action@v22

sigprof commented 1 year ago

Apparently this is related to some recent system update, which had not been rolled out on all macos-12 runners yet.

The action succeeds on runners with macOS 12.6.5:

Current runner version: '2.304.0'
Operating System
  macOS
  12.6.5
  21G531
Runner Image
  Image: macos-12
  Version: 20230516.1
  Included Software: https://github.com/actions/runner-images/blob/macOS-12/20230516.1/images/macos/macos-12-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20230516.1
Runner Image Provisioner
  2.0.236.1

The action fails on runners with macOS 12.6.6:

Current runner version: '2.304.0'
Operating System
  macOS
  12.6.6
  21G646
Runner Image
  Image: macos-12
  Version: 20230612.1
  Included Software: https://github.com/actions/runner-images/blob/macOS-12/20230612.1/images/macos/macos-12-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/macOS-12%2F20230612.1
Runner Image Provisioner
  2.0.236.1
sigprof commented 1 year ago

Also I don't seem to be able to trigger the problem now — repeated attempts to run CI got only macOS 12.6.5 runners with the 20230516.1 image, so maybe the update rollout had been stopped after seeing many failures.

The failure also does not happen on the beta macos-13 runners (in that case I got a mix of 20230524.1 and 20230611.2 runner images, both worked, but they have the same macOS 13.4 (22F66) version).

torhovland commented 1 year ago

I actually got the same error on macos-11:

https://github.com/tweag/topiary/actions/runs/5289277405/jobs/9572003650

But macos-13 works.

abathur commented 1 year ago

I haven't seen this myself yet, but going by https://github.com/canonical/multipass/issues/2417 I imagine this line triggers it: https://github.com/cachix/install-nix-action/blob/16b951426ed4927ca0d26d32e8f5a10638579ec8/install-nix.sh#L86

Edit: it looks like a config for this was recently added to Nix (releases 2.15+); maybe that can be a path forward:

domenkozar commented 1 year ago

Looking into it.

domenkozar commented 1 year ago

Released https://github.com/cachix/install-nix-action/releases/tag/v22

hraban commented 1 year ago

Released https://github.com/cachix/install-nix-action/releases/tag/v22

Fixed it for me 👍 thanks

yihuang commented 1 year ago

me too, guess we can close this one now.

peterbecich commented 1 year ago

I agree install-nix-action@v22 solved this for me, thanks: https://github.com/haskell/hackage-server/pull/1219/commits/8a6154732a5f55e6e33babe3d41125ba2d71a896

turion commented 1 year ago

Actually, merging a PR that bumped to v22 broke this for me:

https://github.com/tweag/monad-bayes/actions/runs/5321286079

domenkozar commented 1 year ago

https://github.com/tweag/monad-bayes/actions/runs/5321286079/jobs/9636259584#step:3:3

turion commented 1 year ago

Apologies for the noise, for some orthogonal reason, we include the action twice, and only one was bumped. Hopefully bumping the other will resolve the issue.