nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
639 stars 24 forks source link

lorri daemon exits with error status 111 #98

Closed Hyzual closed 3 months ago

Hyzual commented 8 months ago

Describe the bug Ater upgrading to Fedora 39, lorri service fails to start. Here is an extract of journalctl --user -u lorri.service

nov. 09 11:29:11 auriel systemd[3226]: Started lorri.service - Lorri Daemon.
nov. 09 11:29:11 auriel lorri[5446]: Nov 09 11:29:11.598 INFO ready
nov. 09 11:29:11 auriel lorri[5446]: Nov 09 11:29:11.599 ERRO IO error binding to socket: Read-only file system (os error 30)
nov. 09 11:29:11 auriel systemd[3226]: lorri.service: Main process exited, code=exited, status=111/n/a
nov. 09 11:29:11 auriel systemd[3226]: lorri.service: Failed with result 'exit-code'.
nov. 09 11:29:11 auriel systemd[3226]: lorri.service: Scheduled restart job, restart counter is at 1.
nov. 09 11:29:11 auriel systemd[3226]: Started lorri.service - Lorri Daemon.
nov. 09 11:29:11 auriel lorri[5481]: Nov 09 11:29:11.781 INFO ready
nov. 09 11:29:11 auriel lorri[5481]: Nov 09 11:29:11.781 ERRO IO error binding to socket: Read-only file system (os error 30)
nov. 09 11:29:11 auriel systemd[3226]: lorri.service: Main process exited, code=exited, status=111/n/a
nov. 09 11:29:11 auriel systemd[3226]: lorri.service: Failed with result 'exit-code'.
nov. 09 11:29:12 auriel systemd[3226]: lorri.service: Scheduled restart job, restart counter is at 2.

It repeats until it reaches the restart counter 5, at which point systemd stops it from restarting.

Workaround:

  1. edit the file at ~/.config/systemd/user/lorri.service and change it like so:

    -ProtectHome=read-only
    +ProtectHome=false
  2. systemctl --user daemon-reload
  3. systemctl --user start lorri.service

The lorri daemon now runs without error.

To Reproduce Steps to reproduce the behavior:

  1. Install lorri on Fedora 38
  2. Upgrade to Fedora 39 (sorry, since this is what I did, I don't have a shorter path to reproduce 😓...)
  3. cd to a repository where lorri was init. There is a message stating that the lorri daemon is not started.

Expected behavior I expected lorri to function the same way as on Fedora 38.

Metadata

Lorri daemon crashed with ERRO IO error binding to socket: Read-only file system (os error 30)

$ lorri info --shell-file shell.nix 
GC roots exist, shell_gc_root: /home/<my-username>/.cache/lorri/gc_roots/2bde048f056dc7952c2048f21c79cccf/gc_root/shell_gc_root
$ uname -a
Linux auriel 6.5.10-300.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov  2 20:01:06 UTC 2023 x86_64 GNU/Linux

Additional context

I don't know what more to include. I don't know what changed between Fedora 38 and 39 that could explain this. I can run more commands to gather context, please ask.

SKyletoft commented 7 months ago

Same issue on NixOS unstable (both home-manager and system pin: 85f1ba3e51676fa8cc604a3d863d729026a6b8eb)

kini commented 7 months ago

Same issue on NixOS 23.11 (naturally). Thanks @Hyzual for the workaround. I actually don't understand why ProtectHome=read-only is there in the service file; doesn't the lorri daemon need to write to ~/.cache/lorri/? Or does that only ever get written to by the user shell level lorri commands, e.g. in .envrc? :thinking:

pkel commented 6 months ago

Fix and more information in nixpkgs PR https://github.com/NixOS/nixpkgs/pull/275024