Redmine stopped to work after two years and an update of Passenger

Added by Hervé Thouzard almost 6 years ago


Two years ago I installed Redmine with a Debian package and everything worked well (I'm using Myslq).
Recently, 2018-07-30, Passenger was updated by the system and stopped to work.

In /var/log/apache2/error.log I have this message:

config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  • development - set it to false
  • test - set it to false (unless you use a tool that preloads your test environment)
  • production - set it to true

/usr/lib/ruby/vendor_ruby/active_record/connection_adapters/connection_specification.rb:257:in `resolve_symbol_connection': 'development' database is not configured. Available: ["production"] (ActiveRecord::AdapterNotSpecified)
from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/connection_specification.rb:224:in `resolve_connection'
from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/connection_specification.rb:152:in `resolve'
from /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/connection_specification.rb:182:in `spec'
from /usr/lib/ruby/vendor_ruby/active_record/connection_handling.rb:50:in `establish_connection'
from /usr/lib/ruby/vendor_ruby/active_record/railtie.rb:129:in `block (2 levels) in <class:Railtie>'
from /usr/lib/ruby/vendor_ruby/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /usr/lib/ruby/vendor_ruby/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /usr/lib/ruby/vendor_ruby/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /usr/lib/ruby/vendor_ruby/active_support/lazy_load_hooks.rb:27:in `each'
from /usr/lib/ruby/vendor_ruby/active_support/lazy_load_hooks.rb:27:in `on_load'
from /usr/lib/ruby/vendor_ruby/active_record/railtie.rb:118:in `block in <class:Railtie>'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
from /usr/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /usr/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /usr/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /usr/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /usr/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
from /usr/lib/ruby/vendor_ruby/rails/application.rb:300:in `initialize!'
from /usr/share/redmine/config/environment.rb:14:in `<top (required)>'
from /usr/share/redmine/public/dispatch.fcgi:4:in `require'
from /usr/share/redmine/public/dispatch.fcgi:4:in `<main>'

The 3 files, development.rb, production.rb and test.rb in /usr/share/redmine/config/environments/ seems correct.
Here is, for example, the production.rb file:

Rails.application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both threaded web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local = false
  config.action_controller.perform_caching = true

  # Disable delivery errors
  config.action_mailer.raise_delivery_errors = false

  # No email in production log
  config.action_mailer.logger = nil

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

In /etc/redmine/default/database.yml I have this:

  adapter: mysql2
  database: redmine_default
  host: localhost
  username: xxxxxxxxxxxxxxxx
  password: xxxxxxxxxxxxxxxx
  encoding: utf8

I have verified, from line 2 to the end, every line starts with two spaces.

Lastly, in Apache's vhost, I have:

<VirtualHost *:80>
        DocumentRoot /usr/share/redmine/public

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        RailsEnv production
        SetEnv RAILS_ENV "production" 

        RailsBaseURI /redmine
        PassengerAppRoot /usr/share/redmine/public

     <Directory /usr/share/redmine/public>
        Options -Indexes +FollowSymLinks -MultiViews +ExecCGI
        AllowOverride All
        Require all granted
        Order deny,allow
        Allow from all

Folder /usr/share/redmine/public is owned by www-data.

Here is my server configuration:
  • Ubuntu 15.04
  • ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux-gnu]
  • Rails 4.2.3
  • Redmine 2.5.2
  • Apache/2.4.10
  • Phusion Passenger 5.3.4

When I try to access Redmine, I have an error 500.
I'm searching for a solution since 5 days.


Replies (2)

RE: Redmine stopped to work after two years and an update of Passenger - Added by Hervé Thouzard almost 6 years ago

The only solution I found was to install a new version on a new server (Ubuntu, Apache & Mysql) and to migrate my data with the help of the following pages: