Bug 1797706 - nil dereference error when clicking on customize in RHV provisioning request
Summary: nil dereference error when clicking on customize in RHV provisioning request
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.10.6
Hardware: x86_64
OS: Linux
high
high
Target Milestone: GA
: 5.11.6
Assignee: Martin Hradil
QA Contact: Jaroslav Henner
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-03 17:13 UTC by Jaroslav Henner
Modified: 2022-11-14 05:03 UTC (History)
7 users (show)

Fixed In Version: 5.11.6.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-10 13:39:10 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
pm-rhel: cfme-5.11.z+


Attachments (Terms of Use)
production.log (10.84 KB, text/plain)
2020-02-03 17:13 UTC, Jaroslav Henner
no flags Details
automation.log.xz (44.95 KB, application/x-xz)
2020-02-05 21:09 UTC, Jaroslav Henner
no flags Details
evm.log.xz (382.55 KB, application/x-xz)
2020-02-05 21:09 UTC, Jaroslav Henner
no flags Details
production.log.xz (16.11 KB, application/x-xz)
2020-02-05 21:10 UTC, Jaroslav Henner
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1720640 0 high CLOSED Clicking on Customize in Requests leadst to: undefined method `[]' for nil:NilClass [miq_request/prov_field_changed] 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2020:2480 0 None None None 2020-06-10 13:39:20 UTC

Description Jaroslav Henner 2020-02-03 17:13:50 UTC
Created attachment 1657392 [details]
production.log

Description of problem:
On provisioning requiest created using cloning the template (The request appears though as it is  clonning a VM), when clicked on Customize tab, the Nil dereference error appears

 undefined method `[]' for nil:NilClass [miq_request/prov_field_changed] 


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

How reproducible:
2/2

Steps to Reproduce:
1. Clone the Template in rhv-4.3 provider ( Native Clone )
2. On the request, click on Customize
3.

Actual results:
Error in production log and on the screen

Expected results:
Cutomize tab displayed

Additional info:

Comment 2 Jaroslav Henner 2020-02-03 18:22:19 UTC
5.11.0.28.20191105164247_d9cf38b is affected as well

Comment 3 Jaroslav Henner 2020-02-03 18:25:44 UTC
5.10.14.0.20200107223945_aa73a61  not affected (it works fine here)

Comment 5 Jaroslav Henner 2020-02-04 18:16:48 UTC
I wrote the reproducing steps in the bug description. So I think what you really want is an environment that you can check this for yourself. Yes I can provide you with that.

Comment 8 Jaroslav Henner 2020-02-05 21:09:12 UTC
Created attachment 1658005 [details]
automation.log.xz

Comment 9 Jaroslav Henner 2020-02-05 21:09:42 UTC
Created attachment 1658006 [details]
evm.log.xz

Comment 10 Jaroslav Henner 2020-02-05 21:10:17 UTC
Created attachment 1658007 [details]
production.log.xz

Comment 11 Jaroslav Henner 2020-02-05 21:29:39 UTC
Perhaps the BZ 1797733 is related as it is about the Request is probably not the correct one.

Comment 15 Jaroslav Henner 2020-03-23 12:15:01 UTC
This seem to be happening when creating an VM provisioning request on rhev with customisation template.

Comment 18 CFME Bot 2020-04-29 15:45:08 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/89152bd27dc232b72160ba35e5d0873b91192d9e
commit 89152bd27dc232b72160ba35e5d0873b91192d9e
Author:     Martin Hradil <mhradil>
AuthorDate: Mon Apr  6 20:46:32 2020 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Mon Apr  6 20:46:32 2020 +0000

    prov_dialog customize - don't fail when no :sysprep_enabled

    This code changed from conditions like...

        - if (@edit && @edit[:new] && @edit[:new][:sysprep_enabled] && @edit[:new][:sysprep_enabled][0] == "fields") || (@options && @options[:sysprep_enabled] && @options[:sysprep_enabled][0] == "fields")

    to one assignment...

        - edit_or_options = (@edit && @edit[:new] && @edit[:new][:sysprep_enabled]) || (@options && @options[:sysprep_enabled])

    ...and conditions like...

        - if edit_or_options[0] == "fields"

    Which then crashes when trying to clone a RHV template, because `edit_or_options` is nil...

        Error caught: [ActionView::Template::Error] undefined method `[]' for nil:NilClass
        /opt/rh/cfme-gemset/bundler/gems/cfme-ui-classic-d44320707dfe/app/views/shared/views/_prov_dialog.html.haml:195:in `__opt_rh_cfme_gemset_bundler_gems_cfme_ui_classic_d________dfe_app_views_shared_views__prov_dialog_html_haml___2839729305696764418_47250275323280'

    The else branch doesn't look inside edit_or_options, so initializing to an empty array works as before.

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

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

Comment 19 CFME Bot 2020-05-07 18:05:46 UTC
New commit detected on ManageIQ/manageiq-ui-classic/jansa:

https://github.com/ManageIQ/manageiq-ui-classic/commit/0badcf639213f2488eff3dac55bcdf1f8d13be38
commit 0badcf639213f2488eff3dac55bcdf1f8d13be38
Author:     Milan Zázrivec <mzazrivec>
AuthorDate: Tue Apr 28 06:21:47 2020 +0000
Commit:     Milan Zázrivec <mzazrivec>
CommitDate: Tue Apr 28 06:21:47 2020 +0000

    Merge pull request #6953 from himdel/prov-dialog-fix

    prov_dialog customize - don't fail when no :sysprep_enabled

    (cherry picked from commit 158ca6fcdfdeaa34464d5c14275264d51c304bd6)

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

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

Comment 21 Jaroslav Henner 2020-06-01 14:15:14 UTC
The Cutomize tab now contains nothing. I believe this is intended

Comment 23 errata-xmlrpc 2020-06-10 13:39:10 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/RHSA-2020:2480


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