Calibre-server: Failed to determine user credentials: No such process

I am trying to setup a calibre-server to sync my ebook collection, but I always get the error failed to determine user credentials: No such process which stops the calibre-server service.

This is my current config

let
user = "calibre";
group = "calibre";
in
services = {
      calibre-server = {
        enable = true;

        host = "0.0.0.0";
        port = 8194;
        libraries = [ "/var/lib/calibre-server" ];
        auth.enable = false;
        inherit user group;
      };
      calibre-web = {
        enable = true;
        listen = {
          ip = "0.0.0.0";
          port = 8094;
        };
        options = {
          enableBookConversion = true;
          enableBookUploading = true;
          reverseProxyAuth.enable = true;
          calibreLibrary = "/var/lib/calibre-server";
        };
        inherit user group;
      };
    };

Does anyone have an idea how I could solve this problem?

My guess is that the calibre user and group don’t exist as the services only create the calibre-server and calibre-web users and groups by default.

As such, you can either create them yourself, or you can perhaps just re-use the calibre-server user and group for the calibre-web service instead:

{
  services = {
    calibre-server = {
      enable = true;

      host = "0.0.0.0";
      port = 8194;
      libraries = [ "/var/lib/calibre-server" ];
      auth.enable = false;
    };

    calibre-web = {
      enable = true;
      listen = {
        ip = "0.0.0.0";
        port = 8094;
      };
      options = {
        enableBookConversion = true;
        enableBookUploading = true;
        reverseProxyAuth.enable = true;
        calibreLibrary = "/var/lib/calibre-server";
      };

      user = "calibre-server";
      group = "calibre-server";
    };
  };
}