Bug 1570570

Summary: Create Volume failed: undefined method `my_zone'
Product: Red Hat CloudForms Management Engine Reporter: Ido Ovadia <iovadia>
Component: ProvidersAssignee: Scott Seago <sseago>
Status: CLOSED CURRENTRELEASE QA Contact: Ido Ovadia <iovadia>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, gblomqui, hkataria, jfrey, jhardy, lavenel, maufart, mpovolny, ndhandre, obarenbo, pakotvan, sseago
Target Milestone: GAKeywords: Regression, TestOnly, ZStream
Target Release: 5.10.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1578964 (view as bug list) Environment:
Last Closed: 2019-02-11 14:07:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1552821, 1578964    
Attachments:
Description Flags
Create volume error - production.log
none
Volume Create screenshot none

Description Ido Ovadia 2018-04-23 09:15:13 UTC
Created attachment 1425597 [details]
Create volume error - production.log

Description of problem:
=======================
Add a new Cloud Volume failed,
Unexpected error encountered
undefined method `my_zone' for nil:NilClass [cloud_volume/create]

Version-Release number of selected component:
=============================================
5.9.2.3

How reproducible:
=================
100%

Steps to Reproduce:
===================
1. Browse: Storage --> Block Storage --> Volumes
2. Click Configuration --> Add a new Cloud Volume
3. Enter parameters and Click 'Add'

Actual results:
===============
Unexpected error encountered
undefined method `my_zone' for nil:NilClass [cloud_volume/create]

Expected results:
=================
Volume create successfully without any errors 

Additional info:
================
Screen shot and log are enclosed


/var/www/miq/vmdb/app/models/cloud_volume.rb

def self.create_volume_queue(userid, ext_management_system, options = {})
    task_opts = {
      :action => "creating Cloud Volume for user #{userid}",
      :userid => userid
    }
    queue_opts = {
      :class_name  => "CloudVolume",
      :method_name => 'create_volume',
      :role        => 'ems_operations',
      :zone        => ext_management_system.my_zone,
      :args        => [ext_management_system.id, options]
    }
    MiqTask.generic_action_with_callback(task_opts, queue_opts)
  end

Comment 1 Ido Ovadia 2018-04-23 09:20:08 UTC
Created attachment 1425598 [details]
Volume Create screenshot

Comment 3 Scott Seago 2018-04-27 15:05:29 UTC
It looks like there are two unrelated bugs showing up at once. The immedate cause of the "undefined method" error is that the code is trying to call my_zone on a nil ext_management_system reference. There's a bug in checking the validation code that I need to fix. However, there's another problem, since we only hit this bug when validate_create_volume fails -- in this case it's failing because ems is nil, and ems is nil because the form isn't passing a cloud_tenant_id. That's a required parameter, but for some reason on the test system that element isn't showing up. It should appear once the cinder manager is chosen. The next thing I'm doing is investigating why this isn't appearing in the form.

Comment 5 Scott Seago 2018-04-30 20:53:42 UTC
*** Bug 1572507 has been marked as a duplicate of this bug. ***

Comment 6 CFME Bot 2018-05-07 18:34:36 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/c552bb48f3950c34b03b01f347ef35d2b4c5b85b
commit c552bb48f3950c34b03b01f347ef35d2b4c5b85b
Author:     Scott Seago <sseago>
AuthorDate: Mon Apr 30 08:54:40 2018 -0400
Commit:     Scott Seago <sseago>
CommitDate: Mon Apr 30 08:54:40 2018 -0400

    bug 1570570:  cloud volume create fixes

    https://bugzilla.redhat.com/show_bug.cgi?id=1570570

    There are two fixes here:
    1) Error handling for cloud volume create/edit was broken. The controller
       was improperly handling the return value from the validate method calls.
    2) The UI for showing the cloud tenant selection input wasn't handling
       the recent classname change for CinderManager

 app/controllers/cloud_volume_controller.rb | 28 +-
 app/views/cloud_volume/_common_new_edit.html.haml | 2 +-
 2 files changed, 14 insertions(+), 16 deletions(-)

Comment 8 Scott Seago 2018-05-30 17:07:44 UTC
Moving back to ON_DEV since I just submitted a new PR to fix a typo in the first PR, as discovered in 5.9.x testing: https://github.com/ManageIQ/manageiq-ui-classic/pull/4006

Comment 9 CFME Bot 2018-05-31 14:08:17 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/900ccc4b2532b22cfddbecaeb7d639fb9bf10877
commit 900ccc4b2532b22cfddbecaeb7d639fb9bf10877
Author:     Scott Seago <sseago>
AuthorDate: Wed May 30 13:04:58 2018 -0400
Commit:     Scott Seago <sseago>
CommitDate: Wed May 30 13:04:58 2018 -0400

    bz 1570570: Fix typo in earlier commit

    https://bugzilla.redhat.com/show_bug.cgi?id=1570570

    Second PR for this bug, since the earlier fix had a typo
    that didn't show up in local testing.

 app/views/cloud_volume/_common_new_edit.html.haml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 10 Ido Ovadia 2018-06-17 21:14:37 UTC
Verified
========
5.10.0.0