Bug 1329422 - cloud Provider :Stack : Broken "Security link " In Stack
Summary: cloud Provider :Stack : Broken "Security link " In Stack
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.6.0
Assignee: Keenan Brock
QA Contact: Shveta
URL:
Whiteboard: stack
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-21 22:15 UTC by Shveta
Modified: 2016-07-27 06:14 UTC (History)
7 users (show)

Fixed In Version: 5.6.0.5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-29 15:52:16 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
err (63.45 KB, image/png)
2016-04-21 22:15 UTC, Shveta
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 0 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 18:50:04 UTC

Description Shveta 2016-04-21 22:15:55 UTC
Created attachment 1149592 [details]
err

Description of problem:


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


How reproducible:

Steps to Reproduce:
1. Add Ec2 provider . 
2. Click on provider , click on orchestration stack under Relationships
3. Click on Security column

Actual results: Error



Expected results:


Additional info:
Logs
===================
[----] I, [2016-04-21T17:35:31.110639 #3166:1323a9c]  INFO -- :   Parameters: {"display"=>"orchestration_stacks", "id"=>"1"}
[----] F, [2016-04-21T17:35:31.419070 #3166:1323a9c] FATAL -- : Error caught: [PG::UndefinedColumn] ERROR:  column orchestration_stacks.total_security_groups does not exist
LINE 1: ...WHERE (orchestration_stacks.id IN (1,2)) ORDER BY "orchestra...
                                                             ^

/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:590:in `async_exec'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:590:in `block in exec_no_cache'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:527:in `block in log'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:521:in `log'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:590:in `exec_no_cache'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:579:in `execute_and_clear'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:103:in `exec_query'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:377:in `select'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:41:in `select_all'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:68:in `block in select_all'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:83:in `cache_sql'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:68:in `select_all'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/relation/finder_methods.rb:389:in `find_with_associations'
/var/www/miq/vmdb/lib/extensions/ar_virtual.rb:323:in `find_with_associations'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/relation.rb:699:in `exec_queries'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/relation.rb:580:in `load'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/relation.rb:260:in `records'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/relation.rb:256:in `to_a'
/var/www/miq/vmdb/app/models/miq_report/generator.rb:353:in `build_table'
/var/www/miq/vmdb/app/models/miq_report/search.rb:118:in `paged_view_search'
/var/www/miq/vmdb/app/controllers/application_controller.rb:1592:in `get_view'
/var/www/miq/vmdb/app/controllers/ems_common.rb:114:in `view_setup_helper'
/var/www/miq/vmdb/app/controllers/ems_common.rb:77:in `show'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/abstract_controller/base.rb:181:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:126:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:126:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:455:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:455:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:90:in `run_callbacks'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal/rescue.rb:31:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/notifications.rb:164:in `block in instrument'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/notifications.rb:164:in `instrument'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activerecord/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/abstract_controller/base.rb:126:in `process'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionview/lib/action_view/rendering.rb:30:in `process'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal.rb:190:in `dispatch'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_controller/metal.rb:262:in `dispatch'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/journey/router.rb:39:in `block in serve'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/journey/router.rb:26:in `each'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/journey/router.rb:26:in `serve'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/routing/route_set.rb:739:in `call'
/opt/rh/cfme-gemset/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/opt/rh/cfme-gemset/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/opt/rh/cfme-gemset/gems/omniauth-1.3.1/lib/omniauth/builder.rb:63:in `call'
/opt/rh/cfme-gemset/gems/secure_headers-3.0.3/lib/secure_headers/middleware.rb:10:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/etag.rb:25:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/conditional_get.rb:25:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/head.rb:12:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/session/abstract/id.rb:220:in `context'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/session/abstract/id.rb:214:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/callbacks.rb:90:in `run_callbacks'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/callbacks.rb:36:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/railties/lib/rails/rack/logger.rb:36:in `call_app'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/railties/lib/rails/rack/logger.rb:26:in `call'
/opt/rh/cfme-gemset/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/request_id.rb:24:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/method_override.rb:22:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/runtime.rb:22:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/activesupport/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/actionpack/lib/action_dispatch/middleware/executor.rb:12:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.0.alpha/lib/rack/sendfile.rb:111:in `call'
/opt/rh/cfme-gemset/bundler/gems/rails-efaa6e4f79d4/railties/lib/rails/engine.rb:522:in `call'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/configuration.rb:224:in `call'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:561:in `handle_request'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:406:in `process_client'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:271:in `block in run'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/thread_pool.rb:111:in `call'
/opt/rh/rh-ruby22/root/usr/share/gems/gems/puma-3.3.0/lib/puma/thread_pool.rb:111:in `block in spawn_thread'

Comment 3 Milan Zázrivec 2016-04-26 09:11:12 UTC
Sorting a report by regular DB table columns work as expected, though
sorting a report by virtual column (such as instances, security groups
in this case) will throw the following error:

Error caught: [PG::UndefinedColumn] ERROR:  column orchestration_stacks.total_security_groups does not exist
LINE 1: ...0000000009,1000000000010,1000000000011)) ORDER BY "orchestra...
...
lib/extensions/ar_virtual.rb:408:in `find_with_associations'
...
app/models/miq_report/generator.rb:350:in `build_table'
app/models/miq_report/search.rb:112:in `paged_view_search'
app/controllers/application_controller.rb:1592:in `get_view'
app/controllers/ems_common.rb:118:in `view_setup_helper'
app/controllers/ems_common.rb:81:in `show'

Keenan, I saw you were making some changes to miq_report/search
and get_order_info(), do you have any take on this? (I don't quite
understand the changes that were made).

Thanks.

Comment 4 Milan Zázrivec 2016-05-02 14:07:50 UTC
@kbrock ping?

Comment 5 Keenan Brock 2016-05-02 17:14:26 UTC
In reports, we are returning the parent OrchestrationStack and not the child
one.

The child one has declared this attribute to be virtual.
So when we are looking it up, we don't detect it is virtual.
So we try and sort in the database.
... and that doesn't work so well.

Taking this.
Thank you Milan

Comment 7 CFME Bot 2016-05-03 10:45:40 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/224c11c72a947ff12eaf22b369001b9d0dbf6f7c

commit 224c11c72a947ff12eaf22b369001b9d0dbf6f7c
Author:     Keenan Brock <kbrock>
AuthorDate: Mon May 2 15:52:37 2016 -0400
Commit:     Keenan Brock <kbrock>
CommitDate: Mon May 2 22:43:39 2016 -0400

    move virtual attributes out of child STI classes
    
    Reporting has trouble accessing virtual attributes defined
    in child classes.
    
    As a bonus, these can now be sorted in the database
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1329422

 app/models/ext_management_system.rb                |  3 ++
 .../manageiq/providers/ansible_tower/provider.rb   |  4 ---
 .../providers/cloud_manager/orchestration_stack.rb | 40 ----------------------
 app/models/manageiq/providers/network_manager.rb   |  6 ----
 app/models/orchestration_stack.rb                  | 29 ++++++++++++++++
 app/models/provider.rb                             |  1 +
 6 files changed, 33 insertions(+), 50 deletions(-)

Comment 8 Shveta 2016-05-12 23:46:30 UTC
Fixed.
verified in 5.6.0.6-beta2.5.20160511140943_ff75fb2

Comment 11 errata-xmlrpc 2016-06-29 15:52:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348


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