In NixOS 21.05 (and probably unstable too), the version of jre is not supported by the gocd-server and gocd-agent versions, and there's no way for the user to choose a different one.
Steps To Reproduce
Steps to reproduce the behavior:
Enable gocd-server in your configuration: services.gocd-server.enable = true;
Run nixos-rebuild switch
Run systemctl status gocd-server. The output is:
● gocd-server.service - GoCD Server
Loaded: loaded (/nix/store/cjx4fsk53vgn69zxjqsq71rk41f9lla3-unit-gocd-server.service/gocd-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-09-02 21:13:09 BST; 1h 5min ago
Process: 1040 ExecStart=/nix/store/nqb0ixadyh0wvvx7svx8ql2m5zrlr2s3-unit-script-gocd-server-start/bin/gocd-server-start (code=exited, status=1/FAILURE)
Main PID: 1040 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 2.261s
Sep 02 21:13:06 systemd[1]: Started GoCD Server.
Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:07 BST 2021] Starting process:
Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:08 BST 2021] Working directory : /var/lib/go-server
Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:08 BST 2021] Application arguments: []
Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:08 BST 2021] GoCD Version: 19.3.0-8959
Sep 02 21:13:09 gocd-server-start[1051]: Running GoCD requires Java version >= VERSION_1_8 and <= 12. You are currently running with Java version 13. GoCD will now exit!
Sep 02 21:13:09 systemd[1]: gocd-server.service: Main process exited, code=exited, status=1/FAILURE
Sep 02 21:13:09 systemd[1]: gocd-server.service: Failed with result 'exit-code'.
Sep 02 21:13:09 systemd[1]: gocd-server.service: Consumed 2.261s CPU time, no IP traffic.
4. See that there's an option, [`services.gocd-server.packages`](https://search.nixos.org/options?channel=21.05&from=0&size=50&sort=relevance&type=packages&query=gocd), whose default value includes `pkgs.jre`. Try overriding it to use an older version of java:
5. nixos-rebuild switch
6. gocd-server ins't automatically restarted. No change to the version error, even after manually restarting.
Turns out the script used to launch the service from `nixos/modules/services/continuous-integration/gocd-server/default.nix` always uses `pkgs.jre`:
```nix
script = ''
${pkgs.git}/bin/git config --global --add http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
${pkgs.jre}/bin/java -server ${concatStringsSep " " cfg.startupOptions} \
${concatStringsSep " " cfg.extraOptions} \
-jar ${pkgs.gocd-server}/go-server/go.jar
'';
Expected behavior
The version of java used in the script should be something that works, and/or there should be an option for the user to choose the java package (I've seen some other nixos modules which do this, given the wide variety of different java package versions, vendors and licenses).
I don't know if there are any potential issues with having different versions of java used in the script and the path.
Notify maintainers
@swarren83
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
Describe the bug
In NixOS 21.05 (and probably unstable too), the version of
jre
is not supported by the gocd-server and gocd-agent versions, and there's no way for the user to choose a different one.Steps To Reproduce
Steps to reproduce the behavior:
services.gocd-server.enable = true;
nixos-rebuild switch
systemctl status gocd-server
. The output is:Sep 02 21:13:06 systemd[1]: Started GoCD Server. Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:07 BST 2021] Starting process: Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:08 BST 2021] Working directory : /var/lib/go-server Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:08 BST 2021] Application arguments: [] Sep 02 21:13:08 gocd-server-start[1051]: [Thu Sep 02 21:13:08 BST 2021] GoCD Version: 19.3.0-8959 Sep 02 21:13:09 gocd-server-start[1051]: Running GoCD requires Java version >= VERSION_1_8 and <= 12. You are currently running with Java version 13. GoCD will now exit! Sep 02 21:13:09 systemd[1]: gocd-server.service: Main process exited, code=exited, status=1/FAILURE Sep 02 21:13:09 systemd[1]: gocd-server.service: Failed with result 'exit-code'. Sep 02 21:13:09 systemd[1]: gocd-server.service: Consumed 2.261s CPU time, no IP traffic.
Expected behavior
The version of java used in the script should be something that works, and/or there should be an option for the user to choose the java package (I've seen some other nixos modules which do this, given the wide variety of different java package versions, vendors and licenses). I don't know if there are any potential issues with having different versions of java used in the script and the path.
Notify maintainers
@swarren83
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information: