Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 724384

Summary: www-apps/redmine-4.1.1: /var/lib/redmine/config.ru should be installed as redmine:redmine
Product: Gentoo Linux Reporter: Adam Purkrt <adam>
Component: Current packagesAssignee: Azamat H. Hackimov <azamat.hackimov>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/15949
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge-info.txt

Description Adam Purkrt 2020-05-21 04:54:05 UTC
Created attachment 640610 [details]
emerge-info.txt

After the installation of www-apps/redmine, the file /var/lib/redmine/config.ru is owned by "root:root". This prevents redmine from starting.

With "PassengerLogLevel 1" in "/etc/apache2/modules.d/30_mod_passenger.conf", restart of apache, and attempt to access redmine (localhost:3000), the following appears in /var/log/apache2/error_log:

[ E 2020-05-21 06:35:49.4154 9224/Tj age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /var/lib/redmine: The application encountered the following error: Bundler::PermissionError (Bundler::PermissionError)
  Error ID: eb3bb417
  Error details saved to: /tmp/passenger-error-YxjUXD.html

[ E 2020-05-21 06:35:49.4262 9224/T8 age/Cor/Con/CheckoutSession.cpp:274 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is eb3bb417. Please see earlier logs for details about the error.


peering  into /tmp/passenger-error-YxjUXD.html, there is a "Bundler::PermissionError" and in stdout/stderr of the subprocess, there is "Please configure your config/database.yml first"

But the database is in fact configured, and the rights/owner of the /var/lib/redmine/config/database.yml seems fine.

After some investigation, I've found it is the owner of /var/lib/redmine/config.ru which causes the issues. Look into "/etc/apache2/modules.d/30_mod_passenger.conf", there is a note:

...
# Under no circumstances will Rails applications be run as root. If
# environment.rb is owned by root or by an unknown user, then the Rails
# application will run as the user specified by PassengerDefaultUser.
PassengerDefaultUser apache

but in fact it is not the "environment.rb" file owner that determines the user, it is the "config.ru" file (thanks to #ruby channel at freenode for help).

After "chown redmine:redmine /var/lib/redmine/config.ru", redmine works fine.
Comment 1 Larry the Git Cow gentoo-dev 2020-06-15 10:57:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f41bc627b6b7c6a5618fd62d1f4e6075965d23e0

commit f41bc627b6b7c6a5618fd62d1f4e6075965d23e0
Author:     Azamat H. Hackimov <azamat.hackimov@gmail.com>
AuthorDate: 2020-06-15 10:54:43 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-06-15 10:57:15 +0000

    www-apps/redmine: fixing bugs
    
    Fixed bugs based on reports from Bugzilla:
    
    * #724384 - changed file permissions for config.ru to redmine:redmine
    * #724388 - updated Apache2's 10_redmine_vhost.conf to comply 2.4 syntax
    * #724464 - relaxing rails version to ~>5.2.4
    
    Closes: https://bugs.gentoo.org/724384
    Closes: https://bugs.gentoo.org/724388
    Closes: https://bugs.gentoo.org/724464
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-apps/redmine/files/10_redmine_vhost.conf |   3 +-
 www-apps/redmine/redmine-4.1.1-r1.ebuild     | 231 +++++++++++++++++++++++++++
 2 files changed, 232 insertions(+), 2 deletions(-)