NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.09k stars 14.14k forks source link

paperless-ngx 1.13. on unstable branch not working on stable #228415

Closed Xyz00777 closed 1 year ago

Xyz00777 commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

Steps To Reproduce

Steps to reproduce the behavior:

  1. add unstable branch into nixos config
  2. rewrite package = paperless-ngx; to package = unstable.paperless-ngx;
  3. nixos rebuild

Expected behavior

paperless-ngx works and not getting dependencies error and no start

Screenshots

[root@K-7:~]# journalctl -xe
░░ Subject: A start job for unit paperless-web.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit paperless-web.service has finished successfully.
░░ 
░░ The job identifier is 5553.
Apr 26 23:50:06 K-7 paperless-ngx[57235]: Unknown command: 'qcluster'
Apr 26 23:50:06 K-7 paperless-ngx[57235]: Type 'manage.py help' for usage.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit paperless-scheduler.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-scheduler.service has entered the 'failed' state with result 'exit-code'.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Consumed 1.232s CPU time, no IO, no IP traffic.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-scheduler.service completed and consumed the indicated resources.
Apr 26 23:50:06 K-7 systemd[1]: Stopping Paperless document consumer...
░░ Subject: A stop job for unit paperless-consumer.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A stop job for unit paperless-consumer.service has begun execution.
░░ 
░░ The job identifier is 5554.
Apr 26 23:50:06 K-7 systemd[1]: Stopping Paperless web server...
░░ Subject: A stop job for unit paperless-web.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A stop job for unit paperless-web.service has begun execution.
░░ 
░░ The job identifier is 5555.
Apr 26 23:50:06 K-7 systemd[1]: paperless-consumer.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-consumer.service has successfully entered the 'dead' state.
Apr 26 23:50:06 K-7 systemd[1]: Stopped Paperless document consumer.
░░ Subject: A stop job for unit paperless-consumer.service has finished
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A stop job for unit paperless-consumer.service has finished.
░░ 
░░ The job identifier is 5554 and the job result is done.
Apr 26 23:50:06 K-7 systemd[1]: paperless-consumer.service: Consumed 1.159s CPU time, no IP traffic.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-consumer.service completed and consumed the indicated resources.
Apr 26 23:50:06 K-7 systemd[1]: paperless-web.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-web.service has successfully entered the 'dead' state.
Apr 26 23:50:06 K-7 systemd[1]: Stopped Paperless web server.
░░ Subject: A stop job for unit paperless-web.service has finished
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A stop job for unit paperless-web.service has finished.
░░ 
░░ The job identifier is 5555 and the job result is done.
Apr 26 23:50:06 K-7 systemd[1]: paperless-web.service: Consumed 1.160s CPU time, no IP traffic.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-web.service completed and consumed the indicated resources.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit paperless-scheduler.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Apr 26 23:50:06 K-7 systemd[1]: Stopped Paperless scheduler.
░░ Subject: A stop job for unit paperless-scheduler.service has finished
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A stop job for unit paperless-scheduler.service has finished.
░░ 
░░ The job identifier is 5556 and the job result is done.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Consumed 1.232s CPU time, no IO, no IP traffic.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-scheduler.service completed and consumed the indicated resources.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Start request repeated too quickly.
Apr 26 23:50:06 K-7 systemd[1]: paperless-scheduler.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit paperless-scheduler.service has entered the 'failed' state with result 'exit-code'.
Apr 26 23:50:06 K-7 systemd[1]: Failed to start Paperless scheduler.
░░ Subject: A start job for unit paperless-scheduler.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit paperless-scheduler.service has finished with a failure.
░░ 
░░ The job identifier is 5556 and the job result is failed.
Apr 26 23:50:06 K-7 systemd[1]: Dependency failed for Paperless document consumer.
░░ Subject: A start job for unit paperless-consumer.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit paperless-consumer.service has finished with a failure.
░░ 
░░ The job identifier is 5633 and the job result is dependency.
Apr 26 23:50:06 K-7 systemd[1]: paperless-consumer.service: Job paperless-consumer.service/start failed with result 'dependency'.
Apr 26 23:50:06 K-7 systemd[1]: Dependency failed for Paperless web server.
░░ Subject: A start job for unit paperless-web.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit paperless-web.service has finished with a failure.
░░ 
░░ The job identifier is 5635 and the job result is dependency.
Apr 26 23:50:06 K-7 systemd[1]: paperless-web.service: Job paperless-web.service/start failed with result 'dependency'.

Additional context

added the unstable branch to my stable 22.11 installation so i coul use the newer version becuase of no backporting

Notify maintainers

Maintainers: @lukegb @gador @erikarvstedt 1.13 have come from @e1mo

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 5.15.108, NixOS, 22.11 (Raccoon), 22.11.3889.f5364316e31`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `"nixos-22.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

my config:

{ config, ... }:

let
  unstable = import
    (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/nixos-unstable")
    # reuse the current configuration
    { config = config.nixpkgs.config; };
in

{
  services.paperless = {
    enable = true;
    package = unstable.paperless-ngx;
    dataDir = "/opt/paperless";
    mediaDir = "/opt/paperless/media";
    extraConfig = {
      PAPERLESS_OCR_LANGUAGE = "deu+eng";
    };
    consumptionDir = "/opt/paperless/consume";
    address = "0.0.0.0";
    port = 28981;
  };
}

beside of the 1.13. paperless-ngx version, a few days ago the 1.14 version released who could be build before the next 23.05 release, that would be nice :)

e1mo commented 1 year ago

Paperless 1.10 switched to celery as a task scheduler, that's why the old queue runner commands (aka. qcluster) aren't available anymore, causing your error. This was fixed for nixpkgs unstable in #207754, but not backported to 22.11.

To get paperless working you could either downgrade (tho you'd probably need to restore the database from a backup, I don't know how well rolling the db migrations back via manage.py works) paperless to the version in 22.11. Alternatively you could try to somehow use the module from unstable (mixture of disabledModules = [ "services/misc/paperless.nix" ]; and either fetchurl or just copy & paste). But I don't know if maybe other modules have changed their interfaces or anything else causing either build- or runtime problems. So try at your own risk and have a backup ready! The easiest and guaranteed working option would be to either switch to unstable entirely or wait the roughly 6 weeks or so and then switch to 23.05.

Xyz00777 commented 1 year ago

do you think there is an option for backporting it or not to mutch work and 23.05 is coming next month...?

Atemu commented 1 year ago

23.05 is out and 22.11 is deprecated, so this issue is obviated.

To answer you question though: No. This sort of setup is not supported.
Either use unstable with the newer version or stable with the old one.