Bug 860564 - Upgrade- "undefined method `update_session_entities' for nil:NilClass " when clicked on administer tab
Upgrade- "undefined method `update_session_entities' for nil:NilClass " when ...
Status: CLOSED NOTABUG
Product: CloudForms Cloud Engine
Classification: Red Hat
Component: aeolus-conductor (Show other bugs)
1.1.0
Unspecified Unspecified
unspecified Severity medium
: beta4
: ---
Assigned To: Steve Linabery
Rehana
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-26 03:48 EDT by Rehana
Modified: 2012-10-08 12:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Release Note
Doc Text:
Prior to running the aeolus-upgrade script (/usr/share/aeolus-conductor/script/aeolus-upgrade), users should log out of any running CloudEngine browser sessions. Following the upgrade, any 'stale' browser sessions will exhibit unreliable/unpredictable behaviour.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-08 12:29:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
aeolus_upgrade.log following failed upgrade attempt (14.10 KB, text/plain)
2012-10-04 20:22 EDT, Steve Linabery
no flags Details

  None (edit)
Description Rehana 2012-09-26 03:48:01 EDT
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. installed aeolus 1.0.1
2. configured vsphere and mock providers
3. initiated image build process
4. yum update to aeolus 1.1
5. /usr/share/aeolus-conductor/script/aeolus-upgrade -a
6. aeolus-restart-services
7. login to conductor
8. click on Administer tab
  
Actual results:
Observed that error " Errors
undefined method `update_session_entities' for nil:NilClass " displayed on conductor

see the Rails log below

Expected results:
should display all the tabs and contents

Additional info:
host :dell-pe1950-01.rhts.englab.brq.redhat.com

Rails log 
---------------------------
Started GET "/conductor/account" for 10.11.9.59 at Wed Sep 26 03:34:47 -0400 2012
  Processing by UsersController#show as HTML
  User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
  Quota Load (0.4ms)  SELECT "quotas".* FROM "quotas" WHERE "quotas"."id" = 4 LIMIT 1
  PermissionSession Load (0.3ms)  SELECT "permission_sessions".* FROM "permission_sessions" WHERE "permission_sessions"."id" IS NULL LIMIT 1
undefined method `update_session_entities' for nil:NilClass
/usr/share/aeolus-conductor/app/controllers/users_controller.rb:74:in `show'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/base.rb:150:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/rendering.rb:11:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb:18:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:456:in `_run__434435962__process_action__453433196__callbacks'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `send'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:94:in `send'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:94:in `run_callbacks'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb:17:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/rescue.rb:17:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/notifications.rb:52:in `instrument'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/notifications.rb:52:in `instrument'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/base.rb:119:in `process'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/rendering.rb:41:in `process'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal.rb:138:in `dispatch'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal.rb:178:in `action'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:62:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:27:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/route_set.rb:150:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:93:in `recognize'
 /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:68:in `optimized_each'
 /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:92:in `recognize'
 /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/route_set.rb:141:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:493:in `call'
 /usr/lib/ruby/gems/1.8/gems/warden-1.0.5/lib/warden/manager.rb:35:in `call'
 /usr/lib/ruby/gems/1.8/gems/warden-1.0.5/lib/warden/manager.rb:34:in `catch'
 /usr/lib/ruby/gems/1.8/gems/warden-1.0.5/lib/warden/manager.rb:34:in `call'
 /usr/lib/ruby/gems/1.8/gems/sass-3.1.4/lib/sass/../sass/plugin/rack.rb:54:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/head.rb:14:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/methodoverride.rb:24:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-restful_submit-1.2.1/lib/rack/rack-restful_submit.rb:29:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/flash.rb:182:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/cookies.rb:302:in `call'
 /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/query_cache.rb:32:in `call'
 /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
 /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/query_cache.rb:12:in `cache'
 /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/query_cache.rb:31:in `call'
 /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
 /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/sendfile.rb:102:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
 /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
 /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/rack/logger.rb:13:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/runtime.rb:17:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/lock.rb:34:in `call'
 /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:168:in `call'
 /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `send'
 /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:52:in `call'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:46:in `each'
 /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:46:in `call'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:84:in `pre_process'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:57:in `process'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
 /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
 /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/controllers/controller.rb:86:in `start'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `send'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `run_command'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
 /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/bin/thin:6
 /usr/bin/thin:19:in `load'
 /usr/bin/thin:19
Rendered layouts/_new_notification.html.haml (1.1ms)
Rendered layouts/_footer.html.haml (0.4ms)
Rendered layouts/converge-ui/_header_layout.haml (0.4ms)
Rendered layouts/converge-ui/_base.haml (1.2ms)
Rendered layouts/converge-ui/shell_layout.haml (3.1ms)
Rendered layouts/error.html.haml within layouts/application (29.0ms)
Completed 500 Internal Server Error in 41ms (Views: 30.2ms | ActiveRecord: 17.3ms)
-------------------------------
Comment 3 Dave Johnson 2012-09-28 11:16:17 EDT
I am thinking this occurs when pre-upgrade, you are in the ui, you then upgrade, and once finished, you start clicking in that original browser session.  It doesn;t force you to log out and exception occur.  Log out, login, and it all works.
Comment 4 Mike Orazi 2012-09-28 11:35:55 EDT
Let's confirm and see if we need release notes re: upgrade path.
Comment 5 Steve Linabery 2012-10-04 20:10:07 EDT
I started an image build for vsphere. While it was running, I did 'yum update'.

While the update was in progress, I got:
[root@virtlab31 ~]# aeolus image status --targetimage=22eb1c24-2fa3-4aa3-b487-0a5bb6d6f22e

ERROR:  Service Temporarily Unavailable => Please check that Conductor is running.


When the yum update was completed, I got:
[root@virtlab31 ~]# aeolus image status --targetimage=22eb1c24-2fa3-4aa3-b487-0a5bb6d6f22e
Build Status: FAILED
Comment 6 Steve Linabery 2012-10-04 20:20:35 EDT
I hit a different error. I was unable to upgrade successfully (your '5. /usr/share/aeolus-conductor/script/aeolus-upgrade -a')

Attaching /var/log/aeolus-conductor/aeolus_upgrade.log
Comment 7 Steve Linabery 2012-10-04 20:22:27 EDT
Created attachment 621867 [details]
aeolus_upgrade.log following failed upgrade attempt
Comment 8 Steve Linabery 2012-10-04 21:54:11 EDT
[root@virtlab31 ~]# /usr/share/aeolus-conductor/script/aeolus-upgrade 
================================================================================
 Aeolus-conductor upgrade
================================================================================

1/3: Migrate aeolus-conductor rails database (0001_migrate_conductor_db.sh)
 Executes rake db:migrate for the aeolus-conductor database

Do you want to proceed? (y/n): y

Migrate aeolus-conductor rails database FAILED.

================================================================================
Finished 0 of 3 upgrade steps
[root@virtlab31 ~]# rpm -qa |grep aeolus
aeolus-conductor-0.13.8-1.el6cf.noarch
rubygem-aeolus-cli-0.7.1-1.el6cf.noarch
aeolus-configure-2.8.6-1.el6cf.noarch
aeolus-conductor-doc-0.13.8-1.el6cf.noarch
aeolus-all-0.13.8-1.el6cf.noarch
rubygem-aeolus-image-0.3.0-12.el6.noarch
aeolus-conductor-daemons-0.13.8-1.el6cf.noarch

Same error as in attached upgrade log.
Comment 9 Steve Linabery 2012-10-04 21:59:43 EDT
Sorry, disregard previous comments. I had a bad baseurl for the 1.1 latest puddle, as evidenced by the NVRs in the previous comment.
Comment 10 Steve Linabery 2012-10-05 11:31:23 EDT
(In reply to comment #3)
> I am thinking this occurs when pre-upgrade, you are in the ui, you then
> upgrade, and once finished, you start clicking in that original browser
> session.  It doesn;t force you to log out and exception occur.  Log out,
> login, and it all works.

This is correct in my experience.

I was finally able to reproduce the bug, and yes, it is a result of having a stale session open in the browser. Quit browser, open browser, logout, login, click 'Administer', no error.

Also, with regard to the build in progress, following the upgrade and restart, I get this:

[root@virtlab31 ~]# aeolus image status --targetimage eaef7f94-60fc-4cda-a785-3ab855307719

ERROR:  TargetImageStatusNotFound => Could not find status for TargetImage eaef7f94-60fc-4cda-a785-3ab855307719

I propose we add something to the release notes saying something like "log out of any active CloudForms browser sessions prior to running aeolus-upgrade"

Note You need to log in before you can comment on or make changes to this bug.