Defect #1681
closedNoMethodError in WikiController#index
Description
Called the only wikipage (startpage called "wanganui") and got this with #r1694:
undefined method `protected?' for #<WikiPage:0xb6e9d7b4>
RAILS_ROOT: /home/arnen/Documents/privat/RoR/redmine-r1694
Application Trace | Framework Trace | Full Trace
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:251:in `method_missing'
app/models/wiki_page.rb:111:in `editable_by?'
app/controllers/wiki_controller.rb:198:in `editable?'
app/controllers/wiki_controller.rb:51:in `index'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:251:in `method_missing'
app/models/wiki_page.rb:111:in `editable_by?'
app/controllers/wiki_controller.rb:198:in `editable?'
app/controllers/wiki_controller.rb:51:in `index'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
Request
Parameters:
{"id"=>"wanganui"}
Show session dump
---
:user_id: 4
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers:
{"cookie"=>[],
"Cache-Control"=>"no-cache"}
Files
Updated by Thomas Lecavelier over 18 years ago
Updated by A. Ni. over 18 years ago
OK, updated the databases (had to use this fix though), but the error remains. Though the message is shorter:
/var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:251:in `method_missing' app/models/wiki_page.rb:111:in `editable_by?' app/controllers/wiki_controller.rb:198:in `editable?' app/controllers/wiki_controller.rb:51:in `index' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:580:in `call_filters' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/rescue.rb:201:in `perform_action_without_caching' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' /var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache' /var/lib/gems/1.8/gems/activerecord-2.1.0/lib/active_record/query_cache.rb:8:in `cache' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `send' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:529:in `process_without_filters' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/filters.rb:569:in `process_without_session_management_support' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/session_management.rb:130:in `process' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:389:in `process' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:149:in `handle_request' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi' /var/lib/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch' /var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:112:in `handle_dispatch' /var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:78:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /var/lib/gems/1.8/gems/rails-2.1.0/lib/webrick_server.rb:62:in `dispatch' /var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/servers/webrick.rb:66 /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require' /var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' /var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in' /var/lib/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require' /var/lib/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3
Updated by Jean-Philippe Lang over 18 years ago
Did you restart the app ?
Updated by A. Ni. over 18 years ago
Yes, I did restart the app. Also, I installed another webserver (lighttpd) via
and tried to use the app with that. No change, still the error. It's a little bit odd because the wiki thing worked fine in v0.7.3 (rubygems 2.0.1) and before upgrading the database (comment #1) and before upgrading rubygems to 2.1.
Updated by Jean-Philippe Lang over 18 years ago
Updated by A. Ni. over 18 years ago
Updated by Jean-Philippe Lang about 18 years ago
- Status changed from New to Closed
- Affected version (unused) deleted (
devel) - Resolution set to Invalid
Database was not migrated. Please run the migration script on the appropriate environment, just like it's mentioned here: RedmineUpgrade.
Eg.
Updated by Tyler Z about 18 years ago
- Status changed from Closed to Reopened
I have had this happen twice now to applications of mine, where "rake db:migrate RAILS_ENV="production" does not do as expected.
Running console I get the following output:
Loading production environment (Rails 2.1.2)
WikiPage.column_names
=> ["id", "wiki_id", "title", "created_on", "parent_id"]
However, this is after running the migrate command as mentioned at the top and with the file "093_add_wiki_pages_protected.rb" in the "db/migrate/" path.
I manually added it last time, but why is it not migrating properly?
Updated by Tyler Z about 18 years ago
However, if I copy 093_add_wiki_pages_protected.rb to 102_add_my_wiki_pages_protected.rb changing the class to AddMyWikiPagesProtected, it works.
It did not work if I simply copied the file and assigned it a new filename, but it did work once I changed the filename and the class name as shown, not sure if the filename required the change because I did it first.
Updated by Jean-Philippe Lang about 18 years ago
Is there (or have you ever put) an other file in db/migrate that starts with 093_ ?
Updated by Tyler Z about 18 years ago
There is not currently, this is a fresh checkout (not an update) of the svn latest, however, I am using a database that I may have previously had my own 093_, when I manually added "parent_id" for wikis to 0.73 version. Is there something stored in the database that associates with the file?
Updated by Jean-Philippe Lang about 18 years ago
- Status changed from Reopened to Closed
Is there something stored in the database that associates with the file?
Yes, in this table: schema_migrations (see http://api.rubyonrails.org/classes/ActiveRecord/Migration.html).
Redmine migration 93 was not executed because of yours.
Updated by Randy Black almost 18 years ago
- File Picture_7.png Picture_7.png added
- Status changed from Closed to Reopened
I have the same issue going on.
I have tried:
and still get
Loading production environment (Rails 2.1.2) >> WikiPage.column_names => ["id", "wiki_id", "title", "created_on"] >>
which results in the following when I go to the wiki tab
Processing WikiController#index (for 216.9.187.117 at 2009-01-26 12:32:47) [GET]
Session ID: 49d5c4b1859173f00fd8f3d1cd5b106d
Parameters: {"action"=>"index", "id"=>"home", "controller"=>"wiki"}
NoMethodError (undefined method `protected?' for #<WikiPage:0x7f9a20b32b78>):
/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:251:in `method_missing'
/app/models/wiki_page.rb:112:in `editable_by?'
/app/controllers/wiki_controller.rb:209:in `editable?'
/app/controllers/wiki_controller.rb:63:in `edit'
/app/controllers/wiki_controller.rb:35:in `index'
/vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `perform_action_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:579:in `call_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:572:in `perform_action_without_benchmark'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
/vendor/rails/actionpack/lib/action_controller/base.rb:529:in `send'
/vendor/rails/actionpack/lib/action_controller/base.rb:529:in `process_without_filters'
/vendor/rails/actionpack/lib/action_controller/filters.rb:568:in `process_without_session_management_support'
/vendor/rails/actionpack/lib/action_controller/session_management.rb:130:in `process'
/vendor/rails/actionpack/lib/action_controller/base.rb:389:in `process'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in `handle_request'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
/vendor/rails/railties/lib/fcgi_handler.rb:103:in `process_request'
/vendor/rails/railties/lib/fcgi_handler.rb:153:in `with_signal_handler'
/vendor/rails/railties/lib/fcgi_handler.rb:101:in `process_request'
/vendor/rails/railties/lib/fcgi_handler.rb:78:in `process_each_request'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
/vendor/rails/railties/lib/fcgi_handler.rb:77:in `process_each_request'
/vendor/rails/railties/lib/fcgi_handler.rb:76:in `catch'
/vendor/rails/railties/lib/fcgi_handler.rb:76:in `process_each_request'
/vendor/rails/railties/lib/fcgi_handler.rb:50:in `process!'
/vendor/rails/railties/lib/fcgi_handler.rb:24:in `process!'
dispatch.fcgi:24
This is the error on the web
This is a pretty basic installation...
Updated by Randy Black almost 18 years ago
Updated by Randy Black almost 18 years ago
Updated by Jean-Philippe Lang almost 18 years ago
So, I ask the question again:
Is there (or have you ever put) an other file in db/migrate that starts with 093_ or 095_ ?
Updated by Yann Autissier about 17 years ago
Hello,
I had the same problem when upgrading from v0.7.3 version to 0.8.4.
After successfully running the database migration process with :
I got the following error in log/production.log when I tried to call the wiki :
The last migration script in v0.7.3 folder is :
Issuing the following mysql command, and restarting the app solved this issue :
Thank you for your support,
Yann
Updated by Jean-Philippe Lang almost 17 years ago
- Category set to Database
Updated by Daniel Felix almost 14 years ago
- Status changed from Reopened to Closed
I can't confirm this in the latest releases.
Regarding the old release, this seems to be closeable.
Please reopen if this issue still hits you.