Nixpkgs: Emacs does not find my home directory

Created on 12 Jan 2016  Â·  14Comments  Â·  Source: NixOS/nixpkgs

After installing 'emacs' and launching 'emacs' a "warnings" buffer is shown, saying

Error (initialization): User xyz has no home directory

I am using Nix packages as single-user with a writable /nix/store. My channel is nixos-15.09. The Emacs version is reported as "GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.28) of 2016-01-07 on localhost" when I do 'Alt-X emacs-version'. My host OS is Xubuntu 14.04.3 LTS.

There is nothing special with my home directory, it is /home/xyz and HOME is set in the environment.

bug stale emacs reporter feedback

All 14 comments

Please, supply the outputs of at least

env | grep HOME
stat $HOME
cat /etc/passwd | grep xyz

Hello,

I was having the same problem and, following the advice here http://comments.gmane.org/gmane.linux.distributions.nixos/17480, I solved it by installing nscd:
sudo apt-get install nscd
Of course I presume that it's bad to install a dependency with another package manager and that the emacs package should be fixed instead but I don't know how to do that.

Thanks,
Théo

Without a lot more (detailed) information, we cannot debug this issue.

I have the same issue.
Here are some details:

[+|art@yd-dev:~/]% env | grep HOME
HOME=/home/art
[+|art@yd-dev:~/]% stat $HOME
  File: ‘/home/art’
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: fd01h/64769d    Inode: 131093      Links: 11
Access: (0755/drwxr-xr-x)  Uid: (20364/     art)   Gid: (61119/dpt_bus_dev)
Access: 2016-06-06 15:16:32.271243888 +0300
Modify: 2016-06-06 15:21:57.166440970 +0300
Change: 2016-06-06 15:21:57.166440970 +0300
 Birth: -
[+|art@yd-dev:~/]% cat /etc/passwd | grep art
[+|art@yd-dev:~/]% echo $USER
art
[+|art@yd-dev:~/]% echo $LOGNAME
art

I know, our admins use some centralized authentication solution, that is why there isn't my login in the /etc/passwd.

Please, reopen the Issue.

BTW, installation of nscd really fixes the problem, but this is annoying.

(triage)

Similar issue with Guix on a Fedora host: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19780#115

The culprit is likely that your Emacs is linked against Nix' glibc, but is loading a libnss_sss.so linked to the system's glibc. Running nscd on the system works around this problem, and I'm not seeing an obvious way to fix this in the Nix package without resorting to LD_PRELOAD hacks.

I am also getting this issue w/ Nix installed on Ubuntu 16.04. I also am not in /etc/passwd, I am not sure exactly what out company uses for centralized auth. I have tried installing nscd with apt-get and libnscd with Nix, but neither seem to fix the issue.

Actually I managed to fix this just by adding a fake entry into /etc/passwd. I am not sure if this is a bad idea or not, but it also fixes similar issues with openssh (and git by extension).

@svetlyak40wt

I know, our admins use some centralized authentication solution, that is why there isn't my login in the /etc/passwd.

Is this what's causing the problem? I am in exactly the same situation, no record found in my /etc/passwd

Recently this can happen even without sssd if your /etc/passwd uses "compat" rather than "files". Change that to "files" and it will work.

This is obviously not a solution but launching emacs with emacs --user "" makes the error message disappear.

I had the same issue, with no entry in /etc/passwd due to the way credentials are managed. After reading this, it seems that doing emacs --user "" is effectively a solution. This sets init-file-user to an empty string, allowing emacs to expand the correct path, instead of $HOME/~user which is obviously wrong.

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.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomberek picture tomberek  Â·  3Comments

vaibhavsagar picture vaibhavsagar  Â·  3Comments

domenkozar picture domenkozar  Â·  3Comments

lverns picture lverns  Â·  3Comments

copumpkin picture copumpkin  Â·  3Comments