Bug 1382939 - Can not generate txt/pdf drift report of SSA
Summary: Can not generate txt/pdf drift report of SSA
Keywords:
Status: CLOSED CURRENTRELEASE
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.8.0
Assignee: Zita Nemeckova
QA Contact: Niyaz Akhtar Ansari
URL:
Whiteboard: drift
: 1377691 (view as bug list)
Depends On:
Blocks: 1385159 1386797
TreeView+ depends on / blocked
 
Reported: 2016-10-08 15:40 UTC by Chen
Modified: 2019-12-16 07:02 UTC (History)
9 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1385159 1386797 (view as bug list)
Environment:
Last Closed: 2017-06-12 16:13:33 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch for 5.6.1. (80.00 KB, patch)
2016-10-12 14:30 UTC, Zita Nemeckova
no flags Details | Diff
Patch for 5.6.1. v2 (80.00 KB, patch)
2016-10-13 08:58 UTC, Zita Nemeckova
no flags Details | Diff

Description Chen 2016-10-08 15:40:10 UTC
Description of problem:

Can not generate txt/pdf drift report of SSA. There is no issue with CSV.

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

5.6.1.2-20160810181333_8ba817b

How reproducible:

100%

Steps to Reproduce:
1. Do SSA twice
2. Choose "Download as Text" when drift the history


Actual results:

The following call trace is in production.log

[----] I, [2016-10-08T11:37:39.466413 #3686:d70a00]  INFO -- : Started GET "/vm_infra/drift_to_txt/1000000000033" for 127.0.0.1 at 2016-10-08 11:37:39 -0400
[----] I, [2016-10-08T11:37:39.467884 #3686:d70a00]  INFO -- : Processing by VmInfraController#drift_to_txt as HTML
[----] I, [2016-10-08T11:37:39.467992 #3686:d70a00]  INFO -- :   Parameters: {"id"=>"1000000000033"}
[----] F, [2016-10-08T11:37:39.572658 #3686:d70a00] FATAL -- : Error caught: [NoMethodError] undefined method `[]' for nil:NilClass
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:394:in `block (2 levels) in prepare_data_for_compare_or_drift_report'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:389:in `each'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:389:in `block in prepare_data_for_compare_or_drift_report'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:297:in `each'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:297:in `each_slice'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:297:in `prepare_data_for_compare_or_drift_report'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:412:in `create_compare_or_drift_report'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:442:in `create_drift_report'
/var/www/miq/vmdb/app/controllers/application_controller/compare.rb:731:in `drift_to_txt'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/abstract_controller/base.rb:188:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:126:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:126:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:455:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:455:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:90:in `run_callbacks'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal/rescue.rb:20:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/notifications.rb:164:in `block in instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/notifications.rb:164:in `instrument'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/abstract_controller/base.rb:126:in `process'
/opt/rh/cfme-gemset/gems/actionview-5.0.0/lib/action_view/rendering.rb:30:in `process'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal.rb:190:in `dispatch'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_controller/metal.rb:262:in `dispatch'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/journey/router.rb:39:in `block in serve'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/journey/router.rb:26:in `each'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/journey/router.rb:26:in `serve'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/routing/route_set.rb:725: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.1/lib/rack/etag.rb:25:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/conditional_get.rb:25:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/head.rb:12:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:222:in `context'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:216:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:90:in `run_callbacks'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/callbacks.rb:36:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/opt/rh/cfme-gemset/gems/railties-5.0.0/lib/rails/rack/logger.rb:36:in `call_app'
/opt/rh/cfme-gemset/gems/railties-5.0.0/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/gems/actionpack-5.0.0/lib/action_dispatch/middleware/request_id.rb:24:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0/lib/action_dispatch/middleware/executor.rb:12:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
/opt/rh/cfme-gemset/gems/railties-5.0.0/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'
/opt/rh/cfme-gemset/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `call'
/opt/rh/cfme-gemset/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context'


Expected results:

The report should be able to be downloaded as Text or PDF

Additional info:

Comment 2 Harpreet Kataria 2016-10-10 19:33:02 UTC
Zita,

Can you look into this, looks like TXT/PDF download reports on Drift screen are throwing an error.
Let me know if you have questions.

Thanks,
~Harpreet

Comment 4 Zita Nemeckova 2016-10-12 13:00:27 UTC
https://github.com/ManageIQ/manageiq/pull/11870

Comment 5 Chen 2016-10-12 13:43:34 UTC
Hi Zita,

Noticed that we only got one line change in the patch. I think we can ask the customer to apply the changes by themselves before the formal fix releases as this is impacting their end customers. It would be appreciated if I could receive suggestions from you.

Best Regards,
Chen

Comment 6 Zita Nemeckova 2016-10-12 14:30:38 UTC
Created attachment 1209627 [details]
Patch for 5.6.1.

Comment 7 Zita Nemeckova 2016-10-12 14:32:32 UTC
Hi Chen,

I added a patch. Let me know if you need anything else.

Best regards,
Zita

Comment 10 Zita Nemeckova 2016-10-13 08:58:50 UTC
Created attachment 1209981 [details]
Patch for 5.6.1. v2

Comment 12 Chen 2016-10-13 11:05:00 UTC
Hi Zita,

Thank you for your help.

I've already provided the patch to the customer. I will update the bug if I got any feedback from the customer.

Thank you again !

Best Regards,
Chen

Comment 13 Zita Nemeckova 2016-10-13 11:36:23 UTC
*** Bug 1377691 has been marked as a duplicate of this bug. ***

Comment 16 Chen 2016-10-17 08:48:42 UTC
Hi Zita,

Will this fix be included in 5.6-z stream ?

Best Regards,
Chen

Comment 17 CFME Bot 2016-10-17 16:21:35 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/b7371543e766526b7ff2c832e76f74b40dd8d3d1

commit b7371543e766526b7ff2c832e76f74b40dd8d3d1
Author:     Martin Povolny <mpovolny>
AuthorDate: Thu Oct 13 11:57:44 2016 +0200
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Thu Oct 13 17:18:33 2016 -0400

    Merge pull request #11870 from ZitaNemeckova/pdf_bz
    
    Fix error in Drift pdf/txt report
    (cherry picked from commit 5a30cdecec594aee6a331737b62dd9142ee93229)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1382939

 app/controllers/application_controller/compare.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comment 18 Chen 2016-10-19 15:14:29 UTC
Hi Zita,

If it hasn't been cloned to 5.6.z stream can we do that ?

Best Regards,
Chen

Comment 19 Zita Nemeckova 2016-10-19 15:30:35 UTC
Hi Chen,

yes, please. The bug has been present since Darga.

Thanks,
Zita

Comment 20 Chen 2016-10-19 15:55:19 UTC
Hi Zita,

Thank you for your reply.

So this fix will be included in 5.6.3 am I right ? Do I need to "clone this bug" for the fix in 5.6.3 ?

Sorry for the noise if I am misunderstanding anything here...

Best Regards,
Chen

Comment 25 Chen 2016-10-21 07:09:08 UTC
Hi Zita,

I am sure that this issue doesn't appear in 5.6.0-13. So it is not PR 6576 who introduced the printing issue. Can we exactly know which PR caused the printing issue ?

My 5.6.0-13 environment:

10.72.32.118 default credentials

/var/www/miq/vmdb/app/controllers/application_controller/compare.rb

 394               if @compare.results[r][section[:name]][:_match_]  # Does it match?

Best Regards,
Chen

Comment 28 Niyaz Akhtar Ansari 2017-03-30 14:55:19 UTC
Able to generate txt/pdf drift report of SSA.
Verified in Version 5.8.0.8-alpha1


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