Project

General

Profile

2.0.1 to 2.0.3 issues

Added by Tom Bodet over 12 years ago

Trying to upgrade 2.0.1 to .3 on a CentOS 6.2 box. When I first got it going I had a Passenger error talking about the activerecord-mysql-adapter which lead me to believe the whole mysql2 thing was fixed so I updated the database yml to point to mysql2. That gets the system started but when I hit the page I get an error 500.

I finally found an error in the log/development.log file:
Started GET "/" for <IP> at 2012-08-09 13:46:20 -0400
Processing by WelcomeController#index as HTML
(1.1ms) describe `settings`
Completed 500 Internal Server Error in 36ms

NoMethodError (undefined method `accept' for nil:NilClass):
app/models/setting.rb:152:in `check_cache'
app/controllers/application_controller.rb:49:in `user_setup'

Out of curiosity I tried running db:migrate and got this:

rake db:migrate RAILS_ENV=development --trace
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Invoke db:load_config (first_time)
  • Invoke rails_env (first_time)
  • Execute rails_env
  • Execute db:load_config
  • Execute db:migrate
    rake aborted!
    undefined method `accept' for nil:NilClass
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `to_sql'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:38:in `select_values'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:587:in `get_all_versions'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:745:in `migrated'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:668:in `current_version'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:685:in `block in migrate'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:685:in `each'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:685:in `detect'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:685:in `migrate'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:570:in `up'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:551:in `migrate'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/railties/databases.rake:153:in `block (2 levels) in <top (required)>'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
    /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
    /usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `load'
    /usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `<main>'
    Tasks: TOP => db:migrate

So it seems there's still something off. Here's the bundle stack:
bundle show
Gems included by the bundle: * actionmailer (3.2.6) * actionpack (3.2.6) * activemodel (3.2.6) * activerecord (3.2.6) * activerecord-mysql2-adapter (0.0.3) * activeresource (3.2.6) * activesupport (3.2.6) * arel (3.0.2) * builder (3.0.0) * bundler (1.1.3) * coderay (1.0.7) * erubis (2.7.0) * hike (1.2.1) * i18n (0.6.0) * journey (1.0.4) * json (1.7.4) * mail (2.4.4) * mime-types (1.19) * multi_json (1.3.6) * mysql2 (0.3.11) * net-ldap (0.3.1) * polyglot (0.3.3) * prototype-rails (3.2.1) * rack (1.4.1) * rack-cache (1.2) * rack-openid (1.3.1) * rack-ssl (1.3.2) * rack-test (0.6.1) * rails (3.2.6) * railties (3.2.6) * rake (0.9.2.2) * rdoc (3.12) * rmagick (2.13.1) * ruby-openid (2.1.8) * sprockets (2.1.3) * sqlite3 (1.3.6) * thor (0.15.4) * tilt (1.3.3) * treetop (1.4.10) * tzinfo (0.3.33) * yard (0.8.2.1)

Can anyone help?

ETA: Using webrick gives me the exact same results as above; not db:migrate but either the activerecord gem for mysql is missing or if database.yml is set to mysql2 it's the accept method for NilClass error.


Replies (4)

RE: 2.0.1 to 2.0.3 issues - Added by Tom Bodet over 12 years ago

Going back over my steps, I've come to realize I should have been doing the db:migrate first. So I'm actually stuck at the migrate step.

database.yml for development:
development:
adapter: mysql2
database: redmine
host: 192.168.111.22
username: redmine
password: <password no quotes around it>
encoding: utf8

Then as above I do:
rake db:migrate RAILS_ENV=development --trace
and get:
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Invoke db:load_config (first_time)
  • Invoke rails_env (first_time)
  • Execute rails_env
  • Execute db:load_config
  • Execute db:migrate
    rake aborted!
    undefined method `accept' for nil:NilClass
    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `to_sql'
    <snip>

RE: 2.0.1 to 2.0.3 issues - Added by Tom Bodet over 12 years ago

Got this figured out.

When we didn't have the mysql2 entry in the database.yml the passenger error talked about the activerecord-mysql-adapter we thought adding the mysql2 version would help. Well that turned out to be the problem once we fixed the database config. Removing that gem got it up and running.

RE: 2.0.1 to 2.0.3 issues - Added by shreyas kr over 12 years ago

Hi,
I am also facing the same issues.

Can you explain more clearly how to fix the issue.

I have the following entry in database.yml

development:
adapter: mysql2
encoding: utf8
database: blog_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock

RE: 2.0.1 to 2.0.3 issues - Added by LEXO IT Services Switzerland over 12 years ago

Exactly the same issue here. We're trying to upgrade Redmine 2.0.3 to 2.1 and switching from mysql to mysql2 adapter since it's recommended in the upgrade manual.

Our database.yml config:

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: ###
  password: ###
  encoding: utf8

our configuration(s):

# bundle show
Gems included by the bundle:
  * actionmailer (3.2.8)
  * actionpack (3.2.8)
  * activemodel (3.2.8)
  * activerecord (3.2.8)
  * activerecord-mysql2-adapter (0.0.3)
  * activeresource (3.2.8)
  * activesupport (3.2.8)
  * arel (3.0.2)
  * builder (3.0.0)
  * bundler (1.2.1)
  * coderay (1.0.7)
  * erubis (2.7.0)
  * fastercsv (1.5.5)
  * hike (1.2.1)
  * i18n (0.6.1)
  * journey (1.0.4)
  * jquery-rails (2.0.3)
  * json (1.7.5)
  * mail (2.4.4)
  * mime-types (1.19)
  * multi_json (1.3.6)
  * mysql (2.8.1)
  * mysql2 (0.3.11)
  * net-ldap (0.3.1)
  * pg (0.14.1)
  * polyglot (0.3.3)
  * rack (1.4.1)
  * rack-cache (1.2)
  * rack-openid (1.3.1)
  * rack-ssl (1.3.2)
  * rack-test (0.6.1)
  * rails (3.2.8)
  * railties (3.2.8)
  * rake (0.9.2.2)
  * rdoc (3.12)
  * rmagick (2.13.1)
  * ruby-openid (2.1.8)
  * sprockets (2.1.3)
  * sqlite3 (1.3.6)
  * thor (0.16.0)
  * tilt (1.3.3)
  * treetop (1.4.10)
  * tzinfo (0.3.33)

We're using debian squeeze with rubygems 1.8 and ruby 1.9.2.

I really hope someone can figure this out. We'll continue trying and post our results here if we find out something.

Additional note:
the 2.0.3 system runs fine with ruby 1.8 and the mysql database adapter.


update 23.09.2012 - SOLVED (for me)
I've just found out that it works well when using the old "mysql" adapter in the database.yml configuration. This is weird because this is the first try I'm doing with the update and using the mysql adapter with 2.1 has never worked before. But now it did. I guess I did something wrong with the ruby update in the previous updates that did not succeed. Anyway I think it should work with the mysql2 adapter as well since it's recommended by the upgrade manual. Well at least it works for now... not really a solution though but maybe this helps somebody else.


    (1-4/4)