Bug 1572265 - Diagnostics -> Region -> Database view is broken on appliance in podified environment
Summary: Diagnostics -> Region -> Database view is broken on appliance in podified env...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: cfme-future
Assignee: Harpreet Kataria
QA Contact: Matouš Mojžíš
URL:
Whiteboard: ui:diagnostics
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-26 14:48 UTC by Matouš Mojžíš
Modified: 2019-05-28 12:27 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-22 14:55:28 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)
production.log stacktrace (6.47 KB, text/plain)
2018-04-26 14:48 UTC, Matouš Mojžíš
no flags Details

Description Matouš Mojžíš 2018-04-26 14:48:26 UTC
Created attachment 1427268 [details]
production.log stacktrace

Description of problem:


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

How reproducible:
Always

Steps to Reproduce:
1. Have an appliance in podified environment
2. Go to Configuration -> Diagnostics -> Region -> Database
3.

Actual results:
Tab is empty and error in production.log

Expected results:


Additional info:

Comment 3 Joe Rafaniello 2018-04-30 19:31:31 UTC
It's blowing up in:

[----] F, [2018-04-26T13:54:51.933068 #277:82c7b0] FATAL -- : Error caught: [NoMethodError] undefined method `[]' for nil:NilClass
/opt/rh/cfme-gemset/bundler/gems/cfme-ui-classic-ac8767091e55/app/controllers/ops_controller/diagnostics.rb:836:in `database_details'

    @database_details = Rails.configuration.database_configuration[Rails.env]
    @database_display_name =
      if @database_details["host"].in?([nil, "", "localhost", "127.0.0.1"])


It's blowing up in database_details because Rails.configuration.database_configuration[Rails.env] is nil. 

database_details is called from build_backup_schedule_options_for_select.  I guess we're using environment variables in pods to find the database.  Does it even make sense to have the scheduled database backup screen for podified?

Comment 4 Nick Carboni 2018-04-30 20:07:09 UTC
>  Does it even make sense to have the scheduled database backup screen for podified?

Nope, database backup through the application won't work in podified so we shouldn't be showing any of that.

We have a convenience method to check this kind of thing. In this case we should only show the screen `unless MiqEnvironment.is_container?` [1]

Also, as a side note, we also have a method for checking if the database is running locally which would be better than redoing that logic in the controller (and would also fix this particular issue) [2]

[1] https://github.com/ManageIQ/manageiq/blob/dcd53e62d50f91c60e9814a8e1d0a483cfe57b0d/lib/miq_environment.rb#L22

[2] https://github.com/ManageIQ/manageiq/blob/dcd53e62d50f91c60e9814a8e1d0a483cfe57b0d/lib/evm_database.rb#L101


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