NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.46k stars 12.95k forks source link

Teleport unable to find getent binary #315389

Open attilaolah opened 1 month ago

attilaolah commented 1 month ago

Describe the bug

When running the Teleport service, while it is functional, it logs errors complaining that it can't find the getent binary:

May 28 17:47:10 home systemd[1]: Started teleport.service.
May 28 17:47:12 home teleport[3086968]: ERRO             "Error during temporary user cleanup: cant find getent binary\n\texec: \"getent\": executable file not found in $PATH" srv/usermgmt.go:469

Might just need some careful application of patchelf?

Steps To Reproduce

Steps to reproduce the behavior:

  1. Set services.teleport.enable = true;.
  2. Connect to a host using tsh ssh ….
  3. systemctl status teleport and check for the error logs.

Expected behavior

There should be no errors logged to the journal.

Notify maintainers

@freezeboy, @arianvp, @justinas, @sigma, @tomberek, @techknowlogick (sorry for the mass mention).

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

L1 ao@home ~ $ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.31, NixOS, 24.11 (Vicuña), 24.11.20240524.bfb7a88`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.90.0-beta.1-lixpre20240506-b6799ab`
 - channels(root): `""`
 - nixpkgs: `/nix/store/z71lmgd0ydfnax1b13zbrls5idf1y7ak-source`

Add a :+1: reaction to issues you find important.

justinas commented 1 month ago

Sounds like we need to add getent into Teleport's PATH, either only for the Teleport systemd service, or for the teleport binary. We already do a similar thing for tsh https://github.com/NixOS/nixpkgs/blob/c01818d57c9d47b9d9b85ab84b5dc04e6c830d63/pkgs/servers/teleport/generic.nix#L163

Could you test with:

systemd.services.teleport.path = [ pkgs.getent ];

and verify that it helps?

There's a few other external binaries that Teleport calls if you're using the host user creation feature, so we might want to include those as well. https://github.com/gravitational/teleport/blob/631c1fcae219d8f33b119059b70a27638a0da470/lib/utils/host/hostusers.go

attilaolah commented 3 weeks ago

Sorry for the absence here, sure, I'll give it a try and report back.