Ruby Forum Radiant CMS > v0.6.9 NoMethodError in Admin/welcomeController#logout

Posted by Kresimir Saric (ksaric)
on 03.08.2008 15:20
Hi,

after upgrading to v.0.6.9, I am no longer able to logout from admin
pages.

The following error occurs:


------------------------------------------------------

NoMethodError in Admin/welcomeController#logout

undefined method `session_token=' for #<User:0x47f07ac>

RAILS_ROOT: c:/Projects 2/RadiantCMS_v069

 Application Trace | Framework Trace | Full Trace

vendor/radiant/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:200:in
`method_missing'
vendor/radiant/vendor/rails/activerecord/lib/active_record/validations.rb:954:in
`send'
vendor/radiant/vendor/rails/activerecord/lib/active_record/validations.rb:954:in
`update_attribute'
vendor/radiant/app/models/user.rb:53:in `forget_me'
vendor/radiant/app/controllers/admin/welcome_controller.rb:27:in
`logout'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`send'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:697:in
`call_filters'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
C:/CGRubyInstall/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/caching.rb:678:in
`perform_action'
vendor/radiant/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
vendor/radiant/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in
`cache'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/caching.rb:677:in
`perform_action'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`send'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in
`sass_old_process'
vendor/radiant/vendor/plugins/haml/lib/sass/plugin/rails.rb:19:in
`process'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:388:in
`process'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in
`handle_request'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in
`dispatch'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in
`dispatch'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/rails.rb:76:in
`process'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/rails.rb:74:in
`synchronize'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/rails.rb:74:in
`process'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:159:in
`process_client'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:158:in
`each'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:158:in
`process_client'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`initialize'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`new'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in
`initialize'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in
`new'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:282:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:281:in
`each'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:281:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/bin/mongrel_rails:128:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/command.rb:212:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/bin/mongrel_rails:281
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
vendor/radiant/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
C:/CGRubyInstall/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
C:/CGRubyInstall/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in
`require'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in
`require'
vendor/radiant/vendor/rails/railties/lib/commands/server.rb:39
script/server:3:in `require'
script/server:3

vendor/radiant/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:200:in
`method_missing'
vendor/radiant/vendor/rails/activerecord/lib/active_record/validations.rb:954:in
`send'
vendor/radiant/vendor/rails/activerecord/lib/active_record/validations.rb:954:in
`update_attribute'
vendor/radiant/app/models/user.rb:53:in `forget_me'
vendor/radiant/app/controllers/admin/welcome_controller.rb:27:in
`logout'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`send'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:697:in
`call_filters'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
C:/CGRubyInstall/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/caching.rb:678:in
`perform_action'
vendor/radiant/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
vendor/radiant/vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in
`cache'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/caching.rb:677:in
`perform_action'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`send'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in
`sass_old_process'
vendor/radiant/vendor/plugins/haml/lib/sass/plugin/rails.rb:19:in
`process'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:388:in
`process'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in
`handle_request'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in
`dispatch'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'
vendor/radiant/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in
`dispatch'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/rails.rb:76:in
`process'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/rails.rb:74:in
`synchronize'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/rails.rb:74:in
`process'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:159:in
`process_client'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:158:in
`each'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:158:in
`process_client'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`initialize'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`new'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in
`initialize'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in
`new'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:282:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:281:in
`each'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:281:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/bin/mongrel_rails:128:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/command.rb:212:in
`run'
C:/CGRubyInstall/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/bin/mongrel_rails:281
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:489:in
`load'
vendor/radiant/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
C:/CGRubyInstall/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
C:/CGRubyInstall/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in
`require'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in
`new_constants_in'
vendor/radiant/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in
`require'
vendor/radiant/vendor/rails/railties/lib/commands/server.rb:39
script/server:3:in `require'
script/server:3

Request

Parameters:

None

Show session dump

---
:csrf_id: 51d3b194379b441fe312b4f80852b9ea
:return_to:
user_id: 1
flash: !map:ActionController::Flash::FlashHash {}


Response

Headers:

{"cookie"=>[[]],
 "Cache-Control"=>"no-cache"}

------------------------------------------------------

Does anyone know what is going on?

Thanks in advance,
K.
Posted by Keith Bingman (kbingman)
on 03.08.2008 16:09
(Received via mailing list)
I think you need to run rake db:migrate. The "remember me" function
makes some changes in the database.

Keith
Posted by Kresimir Saric (ksaric)
on 03.08.2008 17:10
Keith Bingman wrote:
> I think you need to run rake db:migrate. The "remember me" function
> makes some changes in the database.
> 

Thanks. It solved my problem.

Now I am blushing because I didn't run db:migrate task. Somehow it 
slipped my mind.

Best regards,
K.
Posted by John Allen (Guest)
on 03.08.2008 17:16
(Received via mailing list)
I'm not sure if this is a related issue, but after upgrading from 0.6.7
to 0.6.9, I'm seeing this error page:

Application error (Apache)
Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html

a) when logging in (sometimes)
b) when trying to logout (always)

I've done all the recommended steps for the upgrade including "rake
db:migrate".

Everything else seems to work OK.

John
Posted by Sean Cribbs (seancribbs)
on 03.08.2008 18:42
(Received via mailing list)
John,

Can you copy the error from the log into a paste bin
(http://pastie.caboo.se)?  It should look like a stack trace.

Sean
Posted by John and Catherine Allen (Guest)
on 03.08.2008 18:55
(Received via mailing list)
I think this is it:
http://pastie.org/pastes/246590

John
Posted by Sean Cribbs (seancribbs)
on 03.08.2008 19:07
(Received via mailing list)
John,

That again looks like a migration bug.  Did you migrate in the correct
environment (i.e. the same as your server is running in)?

Sean
Posted by John and Catherine Allen (Guest)
on 04.08.2008 13:58
(Received via mailing list)
Sean,

Thanks a lot. I did "rake production db:migrate" and that seems to have
fixed it.

Just for the record, these were the changes made to the db during the
migration:

kirtley:/home/usr/HomePage/Current/site3/config# rake production 
db:migrate
(in /home/usr/HomePage/Current/site3)
== 20 AddSessionInfoToUsers: migrating
========================================
-- add_column(:users, :session_token, :string)
   -> 0.0814s
-- add_column(:users, :session_expire, :datetime)
   -> 0.0411s
== 20 AddSessionInfoToUsers: migrated (0.1253s)
===============================

== 21 RemoveSessionExpireFromUsers: migrating
=================================
-- remove_column(:users, :session_expire)
   -> 0.1476s
== 21 RemoveSessionExpireFromUsers: migrated (0.1486s)
========================

John
Posted by Mohit Sindhwani (Guest)
on 04.08.2008 19:45
(Received via mailing list)
John and Catherine Allen wrote:
> Sean,
>
> Thanks a lot. I did "rake production db:migrate" and that seems to 
> have fixed it.
>

I think we need to highlight somewhere that by default the changes are
made to the database in 'development' rather than production - the
production environment should be put down specifically.  Other than
extension developers, I guess Radiant is used mostly in 'production' - a
common enough thing to overlook since while developing the site, one's
mind often thinks that we're working in development mode.

Cheers,
Mohit.
8/4/2008 | 8:41 AM.