NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.38k stars 14.33k forks source link

Could not start systemd-vconsole-setup.service during boot #312452

Open JohnRTitor opened 6 months ago

JohnRTitor commented 6 months ago

Describe the bug

During boot, I get an error that systemd could not start vconsole-setup.service. The system does boot successfully though.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Boot
  2. See the error in the boot console

Expected behavior

systemd-vconsole-setup service is successfully started.

Additional context

It happens regardless I configure a console font or keymap using config.console NixOS options. Here's what I was able to recover from journalctl -b | grep vconsole

May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: popen: /nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/share/keymaps/i386/qwerty/us.map.gz: No such file or directory
May 17 19:48:23 Ainz-NIX systemd-vconsole-setup[901]: loadkeys: Unable to open file: us: No such file or directory
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: /nix/store/bjzji701dz67bfrrwx9smqqyy1pnf2c9-kbd-2.6.4/bin/loadkeys failed with exit status 1.
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: KD_FONT_OP_GET failed while trying to get the font metadata: Invalid argument
May 17 19:48:22 Ainz-NIX systemd-vconsole-setup[832]: Fonts will not be copied to remaining consoles
May 17 19:48:22 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
May 17 19:48:22 Ainz-NIX systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.

Notify maintainers

@NixOS/systemd

Metadata

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

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.0-cachyos, NixOS, 24.05 (Uakari), 24.05.20240515.33d1e75`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.22.1`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/0qd773b63yg8435w8hpm13zqz7iipcbs-source`

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

arianvp commented 6 months ago

I can not reproduce this. Can you share more about your setup?

JohnRTitor commented 6 months ago

I am on NixOS unstable, here's my config (https://github.com/JohnRTitor/nix-conf), you might want to use the search functionality if you look for something there. I am not particularly sure what is causing this though.

If I type the command in the terminal like this, it works:

/nix/store/hragmx5p3izmwinv4441hj5706sxy4xs-gzip-1.13/bin/gzip -d -c /etc/kbd/keymaps/i386/qwerty/us.map.gz
nixos-discourse commented 3 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/systemd-1-failed-to-start-virtual-console-setup/44798/3

azazel75 commented 3 months ago

I'm affected by the same problem on a couple of servers since I've upgraded them to 24.05. Here is all the log I've got:

Aug 08 16:53:25 meti systemd[1]: Starting Virtual Console Setup...
Aug 08 16:53:25 meti systemd[1]: Finished Virtual Console Setup.
Aug 08 17:28:02 meti systemd[1]: systemd-vconsole-setup.service: Deactivated successfully.
Aug 08 17:28:02 meti systemd[1]: Stopped Virtual Console Setup.
Aug 08 17:28:08 meti systemd[1]: Starting Virtual Console Setup...
Aug 08 17:28:08 meti systemd-vconsole-setup[2554832]: Failed to lock /dev/console: Input/output error
Aug 08 17:28:08 meti systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 17:28:08 meti systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
Aug 08 17:28:08 meti systemd[1]: Failed to start Virtual Console Setup.
Aug 08 17:28:10 meti systemd[1]: Starting Virtual Console Setup...
Aug 08 17:28:10 meti systemd-vconsole-setup[2555378]: Failed to lock /dev/console: Input/output error
Aug 08 17:28:10 meti systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 17:28:10 meti systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
Aug 08 17:28:10 meti systemd[1]: Failed to start Virtual Console Setup.
-- Boot 7864e5f19ead4ce08a0043754f4e78c5 --
Aug 08 18:01:36 meti systemd[1]: Starting Virtual Console Setup...
Aug 08 18:01:36 meti systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 18:01:36 meti systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
Aug 08 18:01:37 meti systemd[1]: Failed to start Virtual Console Setup.
Aug 08 18:01:37 meti systemd[1]: Starting Virtual Console Setup...
Aug 08 18:01:37 meti systemd-vconsole-setup[1328]: Failed to lock /dev/console: Input/output error
Aug 08 18:01:37 meti systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 18:01:37 meti systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
Aug 08 18:01:37 meti systemd[1]: Failed to start Virtual Console Setup.

Not much to say, rather than investigate if this vconsole-setup service is a new stuff? what does this do?

azazel75 commented 3 months ago

I've done some research and I've found this issue relevant in my case. On the servers where the error happens I had the console= kernel option set as resulted from a cat /proc/cmdline because I'had used a generic configuration but the machine doesn't have a serial connected, hence the error.

JaKooLit commented 3 months ago

boot.kernelParams = [ "systemd.mask=systemd-vconsole-setup.service" "systemd.mask=dev-tpmrm0.device" ];

Not sure if this is right way...

but this stopped that annoying 1.5 mins systemd counter adding startup time and error vconsole.. is gone

JohnRTitor commented 3 months ago

Masking the service would prevent it from starting yes, so no error would occur.

Though I can confirm that boot time has been reduced significantly by this change. Thanks