Nixpkgs: nss lookups on many non-NixOS distros broken after glibc upgrade (whoami: "cannot find name for user ID", openssh (ssh): "no user exists for uid", emacs: "user has no home directory")

Created on 15 Nov 2017  路  8Comments  路  Source: NixOS/nixpkgs

Issue description

E.g. Arch Linux has this in /etc/nsswitch.conf:
passwd: compat mymachines systemd

... but libnss_compat is no longer included with glibc (it's apparently at https://github.com/thkukuk/libnss_compat instead).

Steps to reproduce

$ nix-build -A coreutils $ ./result/bin/whoami ./result/bin/whoami: cannot find name for user ID 1000

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.9.53-1-lts, Arch Linux, noversion
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 1.11.15
  • channels(tmtynkky): "nixpkgs-18.03pre120393.eac38d0b1e"
  • nixpkgs: /home/tmtynkky/.nix-defexpr/channels/nixpkgs
regression non-nixos

Most helpful comment

035b5892457d7d198090dc6a68cac2b99d2fec52 should fix this when it reaches master. See https://bugs.archlinux.org/task/54592.

All 8 comments

Hmm, it's no longer included, but perhaps we might combine the builds of glibc and libnss_compat into the same set of outputs – then things might work as before.

Yup.

Though, now you somehow need to run autoconf on that during bootstrapping...

One manifestation of this issue is emacs failing to load the user's configuration with the error message:

Error (initialization): User USERNAME has no home directory

(posting this here in case people try to search for this error message)

One-off impure workaround:
export LD_PRELOAD=/usr/lib/libnss_compat.so.2

note, this is probably unstable if nix glibc and arch glibc start to vary too much from eachother.

If you are not using the compatibility mode offered by nsswitch.conf(5), you can edit /etc/nsswitch.conf and replace compat by files.

035b5892457d7d198090dc6a68cac2b99d2fec52 should fix this when it reaches master. See https://bugs.archlinux.org/task/54592.

@orivej What's the easiest way to check when that happens, apart from git branch --contains 035b589 on a clone of the repo?

This issue will be closed then :)
(Now we are waiting for the jobs queued at https://hydra.nixos.org/eval/1412641 to finish in order to merge.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edolstra picture edolstra  路  3Comments

yawnt picture yawnt  路  3Comments

teto picture teto  路  3Comments

tomberek picture tomberek  路  3Comments

langston-barrett picture langston-barrett  路  3Comments