Project

General

Profile

undefined method `include?' for nil after Upgrade to 4.1

Added by Philipp Burch about 3 years ago

Hi everyone,

I've run Redmine 4.0.5 since end of 2019 without problems. Today, I wanted to upgrade to the latest release of the 4.0-stable branch using the info from https://www.redmine.org/projects/redmine/wiki/RedmineUpgrade:

- Backup
- svn update
- bundle update
- bundle exec rake db:migrate RAILS_ENV=production
- bundle exec rake redmine:plugins:migrate RAILS_ENV=production
- bundle exec rake tmp:cache:clear RAILS_ENV=production

All these command completed without complaining. But after a starting the Redmine process again and also the Apache2 proxy, the browser now only displays a blank page when accessing the Redmine installation. The log shows the following traceback:

Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528638 #10047] ERROR -- : app error: undefined method `include?' for nil:NilClass (NoMethodError)
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528725 #10047] ERROR -- : /usr/lib/ruby/vendor_ruby/rack/utils.rb:482:in `include?'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528755 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/runtime.rb:27:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528782 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528802 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528818 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.4.2/lib/action_dispatch/middleware/static.rb:127:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528835 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528852 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/rack-2.2.3/lib/rack/content_length.rb:17:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528869 #10047] ERROR -- : /home/redmine/redmine-4.0/vendor/bundle/ruby/2.5.0/gems/railties-5.2.4.2/lib/rails/engine.rb:524:in `call'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528886 #10047] ERROR -- : /var/lib/gems/2.5.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:605:in `process_client'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528901 #10047] ERROR -- : /var/lib/gems/2.5.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:700:in `worker_loop'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528924 #10047] ERROR -- : /var/lib/gems/2.5.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:548:in `spawn_missing_workers'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528946 #10047] ERROR -- : /var/lib/gems/2.5.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:144:in `start'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.528975 #10047] ERROR -- : /var/lib/gems/2.5.0/gems/unicorn-5.5.1/bin/unicorn_rails:209:in `<top (required)>'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.529001 #10047] ERROR -- : /usr/local/bin/unicorn_rails:23:in `load'
Mar 05 16:13:29 swisensdata.ch unicorn_rails[10034]: E, [2021-03-05T16:13:29.529024 #10047] ERROR -- : /usr/local/bin/unicorn_rails:23:in `<main>'

I then switched to the 4.1-stable branch to test this as well, but the error is the same. This seems to be very basic, but I'm not experienced with Ruby/Rails and really don't have an idea what could cause such a behaviour.

Redmine version: 4.1-stable, r20761
OS: Debian 10
DB: MariaDB 10.3
Ruby: 2.5.5
Rails: 5.2.2.1

Any help is greatly appreciated.

Thank you and best regards,
Philipp

UPDATE: The problem does not seem to be directly related with the upgrade of Redmine itself. Setting up a new installation of 4.0.5 with the same settings and database shows the same behaviour when run with unicorn. However, everything works normally when running it using WEBrick (bundle exec rails server webrick -e production).


Replies (1)

RE: undefined method `include?' for nil after Upgrade to 4.1 - Added by Philipp Burch about 3 years ago

Got it working. I suppose that the version of the system-wide unicorn_rails package did not match one of the upgraded gems, leading to the error. Installing the unicorn_rails gem using bundle install fixed the issue, now it works with Redmine 4.1.1.

Regards,
Philipp

    (1-1/1)