Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 724384 - www-apps/redmine-4.1.1: /var/lib/redmine/config.ru should be installed as redmine:redmine
Summary: www-apps/redmine-4.1.1: /var/lib/redmine/config.ru should be installed as red...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Azamat H. Hackimov
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-05-21 04:54 UTC by Adam Purkrt
Modified: 2020-06-15 10:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,5.22 KB, text/plain)
2020-05-21 04:54 UTC, Adam Purkrt
Details

Note You need to log in before you can comment on or make changes to this bug.
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(-)