NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.69k stars 13.83k forks source link

Nexus does not start on NixOS 21.05 #130754

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug Sonatype Nexus does not start on NixOS 21.05

To Reproduce

  1. Enable nexus service
    services.nexus = { enable = true; };
  2. The service does not start and journalctl shows
    Jul 20 10:01:50 node1 systemd[1]: Starting Sonatype Nexus3...
    Jul 20 10:01:50 node1 systemd[1]: Started Sonatype Nexus3.
    Jul 20 10:01:50 node1 nexus-start[1194]: No suitable Java Virtual Machine could be found on your system.
    Jul 20 10:01:50 node1 nexus-start[1194]: The version of the JVM must be 1.8.
    Jul 20 10:01:50 node1 nexus-start[1194]: Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
    Jul 20 10:01:50 node1 systemd[1]: nexus.service: Main process exited, code=exited, status=83/n/a
    Jul 20 10:01:50 node1 systemd[1]: nexus.service: Failed with result 'exit-code'.

Expected behavior The service should run.

Additional context The issue seems to be caused by the fact, that the nexus package requires exactly java 1.8. Adding the option

services.nexus.package = pkgs.nexus.override {
    jre_headless = pkgs.jre8_headless;
};

fixes the issue for me.

Notify maintainers

@aespinosa @ironpinguin @zaninime

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

error: opening file '/nix/store/default.nix': No such file or directory
 - system: `0`
 - host os: `Linux 5.10.48, NixOS, 21.05.1555.6b940846e99 (Okapi)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.12`
 - nixpkgs: `/nix/store/k8g2ma0sg58mzfjr1my8hys8gm374yqv-nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: `nexus`
# a list of nixos modules affected by the problem
module: `services.nexus`
Artturin commented 3 years ago

please test #130965

asbachb commented 3 years ago

see Java: https://help.sonatype.com/repomanager2/system-requirements#SystemRequirements-DedicatedOperatingSystemUserAccount