Upgrading Redmine 1.3.1 to 1.4.5

Added by Vincent Lizzi over 7 years ago

I've just spent too much time upgrading Redmine 1.3.1 to 1.4.5 (and had to type this twice), so hopefully this will save someone else the same trouble. My environment:

- Windows 2003
- Mongrel
- Apache as load balancer

I basically followed the guide at http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade?version=53, and did some digging at each error. Here's the step by step:

  1. stop mongrel services
  2. back up database and files
  3. upgrade plugins that need upgrading (default queries per project, better gantt chart)
  4. rename the old redmine folder, and extract the new redmine .zip in its place.
  5. copy configuration files database.yml and configuration.yml
  6. copy config/initializers/mongrel.rb
  7. edit and copy customizations in config/environment.rb and config/environments/production.rb
  8. copy files and installed plugins
  9. run rake generate_session_store. Received an error message. Did the following:
    • delete gemfile and gemfile.lock from vendor\plugins\redmine_better_gantt_chart
    • run gem install bundler
    • run bundle install --without development test rmagick
    • then run rake generate_session_store
  10. run rake db:migrate RAILS_ENV=production. Error message about mysql driver version. Researched and found this. Did the following:
    1. Download mysql-connector-c-noinstall-6.0.2-win32.zip
    2. Rename c:\Ruby187\bin\libmysql.dll and replace with the libmysql.dll from the downloaded file.
    3. Then run rake db:migrate RAILS_ENV=production
  11. run rake db:migrate_plugins RAILS_ENV=production
  12. run rake tmp:cache:clear
  13. run rake tmp:sessions:clear
  14. start mongrel services

At this point opening Redmine in a browser showed the HTML without rendering it. Obviously the content type header was not being set. After some digging I found the solution within this post. Here's what I did:

  1. Edit C:\Ruby187\lib\ruby\gems\1.8\gems\mongrel-1.1.5-x86-mingw32\lib\mongrel\cgi.rb and before the line ~82: REMOVED_KEYS.each {|k| options.delete(k) } add two lines (be careful to keep leading whitespace the same as the line above):
    • @head['cookie'] = options['cookie'] if options['cookie']
    • options.delete('cookie')
  2. Edited config\initializers\mongrel.rb to add '2.3.14' to the list of rails versions
  3. Restart mongrel services

Open Redmine in a browser again. Redmine is working now and on version 1.4.5. As suggested in the upgrade guide I checked Admin -> Roles & Permissions (had to add Manage Related Issues), and checked that repositories were ok.

The cgi.rb and mongrel.rb files I modified are attached.

mongrel.rb Magnifier - redmine\config\initializers\mongrel.rb (2.52 KB)

cgi.rb Magnifier - Ruby187\lib\ruby\gems\1.8\gems\mongrel-1.1.5-x86-mingw32\lib\mongrel\cgi.rb (6.99 KB)

Replies (1)

RE: Upgrading Redmine 1.3.1 to 1.4.5 - Added by Vincent Lizzi over 7 years ago

Update: Redmine is accessible at it's root URL and works fine after logging in. Direct links to pages aren't working though unless the browser session has at least visited Redmine's root URL. Inspecting the headers shows content type text/plain with no content. It looks like the error is related to Mongrel, as the logs have this:

** Mongrel 1.1.5 available at
** Use CTRL-C to stop.
 `split' called for nil:NilClass>
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/cgi_process.rb:52:in `dispatch_cgi'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:27:in `dispatch'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/rails.rb:76:in `process'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/rails.rb:74:in `synchronize'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/rails.rb:74:in `process'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:159:in `process_client'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:158:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:158:in `process_client'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:285:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:285:in `initialize'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:285:in `new'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:285:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:268:in `initialize'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:268:in `new'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel.rb:268:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/configurator.rb:282:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/configurator.rb:281:in `each'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/configurator.rb:281:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/mongrel_rails:128:in `run'
C:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/bin/../lib/mongrel/command.rb:212:in `run'
C:/Ruby187/bin/mongrel_rails:19:in `load'

I've found some information here: https://rails.lighthouseapp.com/projects/8994/tickets/4690 and the solution was here: https://github.com/rack/rack/commit/f6f3c60938ea3b08f3292a2480e6753c293584e5 and involves editing utils.rb in rack.

Edit \lib\ruby\gems\1.8\gems\rack-1.1.3\lib\rack\utils.rb, and around line 344 replace one line with two:

      def [](k)
        # super(@names[k] ||= @names[k.downcase])
        super(@names[k]) if @names[k]

Restart mongrel services and Redmine is working properly again.