Bug 201112 - www/redmine is not working after update (2.6.3_3)
Summary: www/redmine is not working after update (2.6.3_3)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-25 17:51 UTC by Miroslav Lachman
Modified: 2016-07-26 17:10 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Lachman 2015-06-25 17:51:19 UTC
I did an upgrade of ports related to Redmine / Ruby and then Redmaine fails to start.

service redmine start shows nothing, log/production.log have no new entries, so I tried to run the bare command in a shell and then I got following error message:

# /usr/local/bin/thin -D -c /usr/local/www/redmine -u www -g www -a 0.0.0.0 -p 8080 -e production start
Changing process privilege to www:www
Using rack adapter
/usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.4/lib/bundler/runtime.rb:34:in `block in setup': You have already activated rack 1.6.4, but your Gemfile requires rack 1.4.7. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
        from /usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.4/lib/bundler/runtime.rb:19:in `setup'
        from /usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.4/lib/bundler.rb:127:in `setup'
        from /usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.4/lib/bundler/setup.rb:8:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:128:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /usr/local/www/redmine/config/boot.rb:6:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/www/redmine/config/application.rb:1:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/www/redmine/config/environment.rb:2:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/www/redmine/config.ru:3:in `block in <main>'
        from /usr/local/lib/ruby/gems/2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
        from /usr/local/lib/ruby/gems/2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
        from /usr/local/www/redmine/config.ru:1:in `new'
        from /usr/local/www/redmine/config.ru:1:in `<main>'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/rack/adapter/loader.rb:33:in `eval'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/rack/adapter/loader.rb:33:in `load'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/rack/adapter/loader.rb:42:in `for'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/thin/controllers/controller.rb:170:in `load_adapter'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/thin/controllers/controller.rb:74:in `start'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/thin/runner.rb:200:in `run_command'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/lib/thin/runner.rb:156:in `run!'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.3/bin/thin:6:in `<top (required)>'
        from /usr/local/bin/thin:23:in `load'
        from /usr/local/bin/thin:23:in `<main>'


It seems like a problem with Rack versions:
"rack 1.6.4, but your Gemfile requires rack 1.4.7"

There is log of what was done in during upgrade (Redmine worked before)

Jun 24 21:46:50 kurt pkg: pkg upgraded: 1.5.3 -> 1.5.4
Jun 24 21:48:41 kurt pkg: ruby21-gems upgraded: 2.4.7 -> 2.4.8
Jun 24 21:48:41 kurt pkg: rubygem-multi_json upgraded: 1.11.0 -> 1.11.1
Jun 24 21:48:41 kurt pkg: rubygem-rack upgraded: 1.4.5_1,3 -> 1.4.7,3
Jun 24 21:48:41 kurt pkg: rubygem-activesupport upgraded: 3.2.21 -> 3.2.22
Jun 24 21:48:42 kurt pkg: rubygem-rack16-1.6.4 installed
Jun 24 21:48:42 kurt pkg: rubygem-sprockets22 upgraded: 2.2.3 -> 2.2.3_1
Jun 24 21:48:42 kurt pkg: rubygem-rack-test upgraded: 0.6.3 -> 0.6.3_1
Jun 24 21:48:42 kurt pkg: rubygem-rack-cache upgraded: 1.2 -> 1.2_1
Jun 24 21:48:42 kurt pkg: rubygem-json upgraded: 1.8.2 -> 1.8.3
Jun 24 21:48:42 kurt pkg: rubygem-activemodel upgraded: 3.2.21 -> 3.2.22
Jun 24 21:48:42 kurt pkg: rubygem-rack-ssl upgraded: 1.4.1,1 -> 1.4.1_1,1
Jun 24 21:48:42 kurt pkg: rubygem-actionpack upgraded: 3.2.21_1 -> 3.2.22
Jun 24 21:48:43 kurt pkg: sqlite3 upgraded: 3.8.10.1 -> 3.8.10.2
Jun 24 21:48:44 kurt pkg: rubygem-railties upgraded: 3.2.21_2 -> 3.2.22
Jun 24 21:48:44 kurt pkg: rubygem-jquery-rails upgraded: 3.1.2 -> 3.1.3
Jun 24 21:48:44 kurt pkg: rubygem-bundler upgraded: 1.10.2 -> 1.10.4
Jun 24 21:48:44 kurt pkg: rubygem-activeresource upgraded: 3.2.21 -> 3.2.22
Jun 24 21:48:44 kurt pkg: rubygem-activerecord upgraded: 3.2.21 -> 3.2.22
Jun 24 21:48:44 kurt pkg: rubygem-actionmailer upgraded: 3.2.21 -> 3.2.22
Jun 24 21:48:44 kurt pkg: pcre upgraded: 8.37 -> 8.37_1
Jun 24 21:48:47 kurt pkg: ImageMagick-nox11 upgraded: 6.9.1.4,1 -> 6.9.1.6,1
Jun 24 21:48:47 kurt pkg: rubygem-thin upgraded: 1.6.3 -> 1.6.3_1
Jun 24 21:48:47 kurt pkg: rubygem-rubytree upgraded: 0.9.5 -> 0.9.6
Jun 24 21:48:48 kurt pkg: rubygem-redcarpet upgraded: 3.2.3 -> 3.3.1
Jun 24 21:48:49 kurt pkg: rubygem-rbpdf upgraded: 1.18.5 -> 1.18.6
Jun 24 21:48:49 kurt pkg: rubygem-rails upgraded: 3.2.21 -> 3.2.22
Jun 24 21:48:49 kurt pkg: rubygem-rack-openid upgraded: 1.4.2_1 -> 1.4.2_2
Jun 24 21:48:50 kurt pkg: proftpd upgraded: 1.3.5_7 -> 1.3.5a
Jun 24 21:48:52 kurt pkg: php55 upgraded: 5.5.25 -> 5.5.26
Jun 24 21:48:56 kurt pkg: vim-lite upgraded: 7.4.729 -> 7.4.752
Jun 24 21:48:56 kurt pkg: smartmontools upgraded: 6.3 -> 6.4
Jun 24 21:49:08 kurt pkg: redmine upgraded: 2.6.3_2 -> 2.6.3_3
Jun 24 21:49:08 kurt pkg: proftpd-mod_sql_mysql upgraded: 1.3.5_7 -> 1.3.5a
Jun 24 21:49:08 kurt pkg: php55-zlib upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:08 kurt pkg: php55-xml upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:08 kurt pkg: php55-simplexml upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:08 kurt pkg: php55-session upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:09 kurt pkg: php55-mysqli upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:09 kurt pkg: php55-mysql upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:09 kurt pkg: php55-mbstring upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:09 kurt pkg: php55-iconv upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:09 kurt pkg: php55-bz2 upgraded: 5.5.25 -> 5.5.26
Jun 24 21:49:09 kurt pkg: lsof upgraded: 4.89.d,8 -> 4.89.e,8
Jun 24 21:49:09 kurt pkg: libgd upgraded: 2.1.0_5,1 -> 2.1.0_6,1

List of currently installed related packages:

# pkg info -E redmine\* ruby\*
redmine-2.6.3_3
ruby-2.1.6,1
ruby21-gems-2.4.8
rubygem-actionmailer-3.2.22
rubygem-actionpack-3.2.22
rubygem-activemodel-3.2.22
rubygem-activerecord-3.2.22
rubygem-activeresource-3.2.22
rubygem-activesupport-3.2.22
rubygem-ansi-1.5.0
rubygem-arel3-3.0.3,1
rubygem-builder-3.0.4
rubygem-bundler-1.10.4
rubygem-coderay-1.1.0
rubygem-coffee-rails-3.2.2_1
rubygem-coffee-script-2.4.1
rubygem-coffee-script-source-1.9.1.1
rubygem-daemons-1.2.2
rubygem-erubis-2.7.0_1
rubygem-eventmachine-1.0.7
rubygem-execjs-2.5.2
rubygem-fastercsv-1.5.5
rubygem-hike-1.2.3,1
rubygem-i18n-0.7.0,2
rubygem-journey-1.0.4
rubygem-jquery-rails-3.1.3
rubygem-json-1.8.3
rubygem-json_pure-1.8.2
rubygem-mail25-2.5.4_1,2
rubygem-mime-types1-1.25.1
rubygem-minitest-5.7.0
rubygem-multi_json-1.11.1
rubygem-mysql2-0.3.18
rubygem-net-ldap-0.11
rubygem-polyglot-0.3.5
rubygem-rack-1.4.7,3
rubygem-rack-cache-1.2_1
rubygem-rack-openid-1.4.2_2
rubygem-rack-ssl-1.4.1_1,1
rubygem-rack-test-0.6.3_1
rubygem-rack16-1.6.4
rubygem-rails-3.2.22
rubygem-railties-3.2.22
rubygem-rake-10.4.2
rubygem-rbpdf-1.18.6
rubygem-rdoc3-3.12.2
rubygem-redcarpet-3.3.1
rubygem-request_store-1.1.0_1
rubygem-rmagick-2.15.2
rubygem-ruby-openid-2.7.0
rubygem-rubytree-0.9.6
rubygem-sass-3.4.14
rubygem-sass-rails-3.2.6_4
rubygem-sprockets22-2.2.3_1
rubygem-sqlite3-1.3.10
rubygem-structured_warnings-0.2.0
rubygem-thin-1.6.3_1
rubygem-thor-0.19.1
rubygem-tilt-2.0.1
rubygem-tilt1-1.4.1
rubygem-treetop-1.6.2
rubygem-turn-0.9.7
rubygem-tzinfo03-0.3.44
rubygem-uglifier-2.7.1

Packages were built on my poudriere machine few days ago without any errors.

What can I do to solve this problem / what details I should provide?
Comment 1 Miroslav Lachman 2015-06-30 16:39:17 UTC
I really don't know if this is the right way. It is working workaround.
According to this post http://www.redmine.org/boards/2/topics/39093?r=39833
I added "bundler exec" in front of thin command and it works:

# bundle exec /usr/local/bin/thin -D -c /usr/local/www/redmine -u www -g www -a 0.0.0.0 -p 8080 -e production start
Changing process privilege to www:www
Using rack adapter
Thin web server (v1.6.3 codename Protein Powder)
Debugging ON
Maximum connections set to 1024
Listening on 0.0.0.0:8080, CTRL+C to stop


So I modified redmine rc script to:

cd /usr/local/www/redmine
command_args="-d -D -c /usr/local/www/redmine -u ${redmine_user} -g ${redmine_group}"
start_cmd="/usr/local/bin/bundle exec /usr/local/bin/thin ${command_args} ${redmine_flags} start"


I hope it will be fixed "thi right way" in ports tree soon.
Comment 2 Michael Moll freebsd_committer freebsd_triage 2015-09-19 17:44:44 UTC
I can't reproduce this with a recent portstree, could you please check and report back? You will need at least r397333 to avoid another (unrelated) problem.
Comment 3 Miroslav Lachman 2015-11-04 11:17:22 UTC
(In reply to Michael Moll from comment #2)

I am sorry for my late reply. I was busy with another work.
I did upgrade on mantioned server yeasterday. The OS was upgraded from FreeBSD 8.4 to 10.2 and Redmine reinstalled from 2.6.3_3 to 2.6.3_4.

The problem with start remains!

I tried uninstall redmine, move /usr/local/www/redmine elsewhere and then clean install of Redmine. Even this clean installation didn't start.

# /usr/local/bin/thin -D -c /usr/local/www/redmine -u www -g www -a 0.0.0.0 -p 8080 -e production start
/usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/thin/backends/base.rb:103: warning: epoll is not supported on this platform
Changing process privilege to www:www
Using rack adapter
Please configure your config/database.yml first
/usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:34:in `block in setup': You have already activated rack 1.6.4, but your Gemfile requires rack 1.4.7. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
        from /usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:19:in `setup'
        from /usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup'
        from /usr/local/lib/ruby/gems/2.1/gems/bundler-1.10.6/lib/bundler/setup.rb:8:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:128:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /usr/local/www/redmine/config/boot.rb:6:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/www/redmine/config/application.rb:1:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/www/redmine/config/environment.rb:2:in `<top (required)>'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/lib/ruby/site_ruby/2.1/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/www/redmine/config.ru:3:in `block in <main>'
        from /usr/local/lib/ruby/gems/2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
        from /usr/local/lib/ruby/gems/2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
        from /usr/local/www/redmine/config.ru:1:in `new'
        from /usr/local/www/redmine/config.ru:1:in `<main>'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `eval'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `load'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/rack/adapter/loader.rb:42:in `for'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/thin/controllers/controller.rb:170:in `load_adapter'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/thin/controllers/controller.rb:74:in `start'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/thin/runner.rb:200:in `run_command'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/lib/thin/runner.rb:156:in `run!'
        from /usr/local/lib/ruby/gems/2.1/gems/thin-1.6.4/bin/thin:6:in `<top (required)>'
        from /usr/local/bin/thin:23:in `load'
        from /usr/local/bin/thin:23:in `<main>'
Comment 4 Michael Moll freebsd_committer freebsd_triage 2015-11-10 19:11:59 UTC
I see. This is specific to the thin option used and I don't think there's an easy fix.

Here is what I think is happening:

Redmine 2.6 is using Rails 3.2 which is locked to rack 1.4. After an security update to the rack ports we decided to have all ports that depend onto rack >=1.4 depending onto the rack16 port in order to pull in this newer version which also has better security support. Amongst them is thin (and maybe some other gem that's somewhere in the chain here), so there's the rack 1.4.x vs. 1.6.x clash coming from.

The real fix here is to find somebody that has the time to upgrade the redmine port to a newer version which is also using a newer Rails so we can finally purge Rails 3 from the ports tree.

I _think_ the current redmine port still works with passenger (or maybe also with puma), so maybe try that (or if all else fails "rails start").


Off topic rant:
In regard to the thin and passenger ports options, I'm really against having this handled by an app's port in general as there are more Ruby app servers that can/should be equially supported then and patching thin into the Gemspec has always been a major pain as that's a patch on top of the gem version patches.

If something like that should be part of a future redmine port, it could be done at least like Foreman is handling its bundler.d dir (https://github.com/theforeman/foreman/blob/develop/Gemfile#L33-L35) so for each app server an independent file can be dropped into bundler.d. That might also help porting of redmine plugins which are handled by some ports magic currently.
Comment 5 Miroslav Lachman 2016-07-26 17:10:46 UTC
Fixed by newer versions