Bug 1570570 - Create Volume failed: undefined method `my_zone'
Summary: Create Volume failed: undefined method `my_zone'
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: x86_64
OS: Linux
Target Milestone: GA
: 5.10.0
Assignee: Scott Seago
QA Contact: Ido Ovadia
: 1572507 (view as bug list)
Depends On:
Blocks: 1552821 1578964
TreeView+ depends on / blocked
Reported: 2018-04-23 09:15 UTC by Ido Ovadia
Modified: 2019-02-11 14:07 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1578964 (view as bug list)
Last Closed: 2019-02-11 14:07:32 UTC
Category: ---
Cloudforms Team: Openstack
Target Upstream Version:

Attachments (Terms of Use)
Create volume error - production.log (18.02 KB, text/plain)
2018-04-23 09:15 UTC, Ido Ovadia
no flags Details
Volume Create screenshot (77.19 KB, image/png)
2018-04-23 09:20 UTC, Ido Ovadia
no flags Details

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:

How reproducible:

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


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)

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:

commit c552bb48f3950c34b03b01f347ef35d2b4c5b85b
Author:     Scott Seago <sseago@redhat.com>
AuthorDate: Mon Apr 30 08:54:40 2018 -0400
Commit:     Scott Seago <sseago@redhat.com>
CommitDate: Mon Apr 30 08:54:40 2018 -0400

    bug 1570570:  cloud volume create fixes


    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:

commit 900ccc4b2532b22cfddbecaeb7d639fb9bf10877
Author:     Scott Seago <sseago@redhat.com>
AuthorDate: Wed May 30 13:04:58 2018 -0400
Commit:     Scott Seago <sseago@redhat.com>
CommitDate: Wed May 30 13:04:58 2018 -0400

    bz 1570570: Fix typo in earlier commit


    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

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