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

Error updating nix store on NFS: removing extended attribute ‘system.nfs4_acl’ #29778

Closed
phi-gamma opened this issue Sep 25, 2017 · 17 comments · Fixed by NixOS/nix#4765
Closed

Comments

@phi-gamma
Copy link
Contributor

Issue description

Was about to update my nix-store a Fedora 25 workstation:

$ nix-channel --update
downloading Nix expressions from ‘https://d3g5gsiof5omrk.cloudfront.net/nixpkgs/nixpkgs-18.03pre116369.14cbeaa892/nixexprs.tar.xz’...
downloading ‘https://d3g5gsiof5omrk.cloudfront.net/nixpkgs/nixpkgs-18.03pre116369.14cbeaa892/nixexprs.tar.xz’... [8991/9145 KiB, 640.3 KiB/s]
$ nix-env -u
error: removing extended attribute ‘system.nfs4_acl’ from ‘/nix/store/ijxblasjbl4l53gd3cg3q49ci8nh6wj1-env-manifest.nix’: Input/output error

This used to work for years.

The store is located on an NFSv4 mount served over network. Its location is
~/.nix-store, bind-mounted at login to /nix.

Steps to reproduce

# set up nix and nixpkgs; then
$ nix-channel --update
$ nix-env -u

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)

    $ uname -a
    Linux drift.m.i2n 4.12.11-200.fc25.x86_64 Compile glibc without -fstack-protector. #1 SMP Fri Sep 8 11:44:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  • Nix version: (run nix-env --version)

    $ nix-env --version
    nix-env (Nix) 1.11.14

  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)

    $ nix-instantiate --eval '' -A lib.nixpkgsVersion
    "18.03pre114739.d0d905668c"

  • Sandboxing enabled: (run grep build-use-sandbox /etc/nix/nix.conf)

Does not apply: Not NixOS.

@edolstra
Copy link
Member

Probably caused by NixOS/nix@d798349.

@phi-gamma
Copy link
Contributor Author

Looks like. Anything I can do?

@edolstra
Copy link
Member

We can probably ignore system.nfs4_acl, as with security.selinux, but we'd have to be sure that this leaves no ACLs behind...

@phi-gamma
Copy link
Contributor Author

Could this be made configurable? I imagine other situations may arise where users need to whitelist attributes because of an exotic setup.

phi-gamma added a commit to phi-gamma/nix that referenced this issue Sep 28, 2017
Fixes NixOS/nixpkgs#29778

Removal of this ACL breaks nix if the store resides on an
NFSv 4.1 mount.
@knedlsepp
Copy link
Member

Just having the same problem on a Lustre file system:

error: removing extended attribute ‘lustre.lov’ from ‘/nix/store/y2y67fng7drrqlgfwf92mlf62lmgg7zj-perl-5.24.3/bin/perl5.24.3’: Permission denied

@tobiasBora
Copy link
Contributor

Hello,
Any news? Because of that error I can't even install nix.

@knedlsepp
Copy link
Member

@tobiasBora If you are willing to compile it manually, you can apply the patch supplied by phi-gamma. I've had success with that solution.
After bootstrapping, the following .config/nixpkgs/config.nix might be what you need:

{ 
  packageOverrides = pkgs: {
    nix = pkgs.nix.overrideAttrs(oldAttrs: {
      prePatch = ''
        substituteInPlace src/libstore/local-store.cc \
          --replace '(eaName == "security.selinux")' \
                    '(eaName == "security.selinux" || eaName == "system.nfs4_acl")'
      '';
    });
  };
}

@tobiasBora
Copy link
Contributor

@knedlsepp : Thank you for the tip, but do you have any idea why this fix is not included upstream?

@adamnovak
Copy link

adamnovak commented May 30, 2018

I'm having this issue in nix 2.0.2, which I just built manually from source. I'm confused as to how to apply the workaround @knedlsepp mentioned (since I'm just learning how to use nix); it looks like after dropping that file (in my home directory? Or somewhere in my nix store or state directories?) I need to use nix to rebuild nix. Is that likely to work if I can't update the channels? And how would I go about doing that?

EDIT: I applied the patch at #1584 by manually patching the nix source and rebuilding. Now I have a new error to solve.

@thomasjm
Copy link
Contributor

I'm having this error in Nix 2.1.3 with a CephFS filesystem:

error: removing extended attribute 'ceph.dir.entries' from ...: Operation not supported

I'd also appreciate if this were made configurable, since indiscriminately removing xattrs from files can cause problems in unusual setups.

@v217
Copy link

v217 commented Oct 24, 2019

Is this error related #71900 ?

@v217
Copy link

v217 commented Oct 25, 2019

Is there an easier workaround like granting the chattr rights to the user, who does the single-user-installation of /nix in ubuntu?
sudo nix-env ... does not work.

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@ymarco
Copy link

ymarco commented Oct 12, 2020

Still important to me. I have the same issue but with btrfs.compression.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 12, 2020
@Kamilcuk
Copy link

Kamilcuk commented Jan 7, 2021

Still important to me. I can't install nix because of this error. Is there any workaround I can do when installing?

@FeepingCreature
Copy link
Contributor

FeepingCreature commented Apr 21, 2021

Note the simple workaround of using NFSv3. (Worked when I ran into it just now.)

@kthommandra
Copy link

Linux kernel NFS client code disables removing system.nfs4_acl xattr
https://github.com/torvalds/linux/blob/9b76d71fa8be8c52dbc855ab516754f0c93e2980/fs/nfs/nfs4proc.c#L5947

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

Successfully merging a pull request may close this issue.