Nixpkgs: Redmine service fails to start

Created on 8 Dec 2015  ·  10Comments  ·  Source: NixOS/nixpkgs

On nixos-unstable channel as of today. (Testing Redmine in NixOS for the first time.)

configuration.nix snippet:

  services = {
    redmine.enable = true;
    redmine.databasePassword = "mypassword";
    postgresql.enable = true;
    postgresql.package = pkgs.postgresql;
  };

Journal output:

systemd[1]: Starting redmine.service...
redmine-pre-start[10288]: Please configure your config/database.yml first
redmine-pre-start[10288]: rake aborted!
redmine-pre-start[10288]: Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.1.1. Prepending `bundle exec` to your command may solve this.
redmine-pre-start[10288]: /nix/store/8nk4d5ks8q5as7af20jc5mrij1g10a5q-bundler-1.10.6/lib/ruby/gems/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:34:in `block in setup'
redmine-pre-start[10288]: /nix/store/8nk4d5ks8q5as7af20jc5mrij1g10a5q-bundler-1.10.6/lib/ruby/gems/2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:19:in `setup'
redmine-pre-start[10288]: /nix/store/8nk4d5ks8q5as7af20jc5mrij1g10a5q-bundler-1.10.6/lib/ruby/gems/2.2.2/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup'
redmine-pre-start[10288]: /nix/store/8nk4d5ks8q5as7af20jc5mrij1g10a5q-bundler-1.10.6/lib/ruby/gems/2.2.2/gems/bundler-1.10.6/lib/bundler/setup.rb:18:in `<top (required)>'
redmine-pre-start[10288]: /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/config/boot.rb:6:in `<top (required)>'
redmine-pre-start[10288]: /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/config/application.rb:1:in `<top (required)>'
redmine-pre-start[10288]: /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/Rakefile:5:in `<top (required)>'
redmine-pre-start[10288]: LoadError: cannot load such file -- bundler/setup
redmine-pre-start[10288]: /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/config/boot.rb:6:in `<top (required)>'
redmine-pre-start[10288]: /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/config/application.rb:1:in `<top (required)>'
redmine-pre-start[10288]: /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/Rakefile:5:in `<top (required)>'
redmine-pre-start[10288]: (See full trace by running task with --trace)
systemd[1]: redmine.service: Control process exited, code=exited status=1
systemd[1]: Failed to start redmine.service.
systemd[1]: redmine.service: Unit entered failed state.
systemd[1]: redmine.service: Failed with result 'exit-code'.
bug nixos

Most helpful comment

Oh... yeah this issue is ancient news. I forgot about this issue. In the 18.09 release I resurrected redmine from the dead with an overhaul. I'm now actively maintaining redmine and ensuring it is kept up to date.

Please go ahead and close this issue. Thanks for the ping!

All 10 comments

Why does it complain about config/database.yml? It seems to setup by the NixOS module just fine (to my untrained eyes):

$ ls -l /var/redmine/config/database.yml
lrwxrwxrwx 1 root root 56 Dec  8 23:04 /var/redmine/config/database.yml -> /nix/store/i46zxflb4fjrnzf3vqhdvhw96g0lpd3a-database.yml
$ cat /var/redmine/config/database.yml
production:
  adapter: postgresql
  database: redmine
  host: 127.0.0.1
  password: mypassword
  username: redmine
  encoding: utf8

Not only that but it also doesn't manage to load bundler/setup. Can you take a look at the unit and it's working directory ? I suspect it's running under /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine

Exactly: WorkingDirectory=/nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine

And the pre-start script does this:

cd /nix/store/w337k0r0r0n73dfgnbj9xn3cjvkvvc77-redmine-2.5.2/share/redmine/
/nix/store/zlda74jdqrxq1mw4cm7mfcxd4hrg17aa-ruby-2.2.2-p0/bin/rake db:migrate

This is the first time "rake" is called in the pre-start script, so I guess that is where it fails.

It seem to be copying everything into the stateDir including the config and then change directory to the immutable package directory to run rake db:migrate. I don't know how that strategy can be successful. It would be best to generate a new derivation that includes both the original code and the correct config, and symlink the mutable directories like log/ to the stateDir.

https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/redmine.nix#L200

If we have to refactor the module, maybe we should look at this: https://github.com/NixOS/nixpkgs/issues/5984.

Bump. Is nobody is using Redmine on NixOS? (EDIT: I just tested on NixOS 16.03. Still broken.)

I have tried, with no success. Unfortunately not enough time to debug.

(triage) is it still broken?

@aanderse You “recently” did some changes related to redmine. Could you confirm this is no longer a current issue?

Oh... yeah this issue is ancient news. I forgot about this issue. In the 18.09 release I resurrected redmine from the dead with an overhaul. I'm now actively maintaining redmine and ensuring it is kept up to date.

Please go ahead and close this issue. Thanks for the ping!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  ·  3Comments

spacekitteh picture spacekitteh  ·  3Comments

ghost picture ghost  ·  3Comments

matthiasbeyer picture matthiasbeyer  ·  3Comments

tomberek picture tomberek  ·  3Comments