Bug 1730750 - Internal server error while editing Schedule with EVM Group or Tenant
Summary: Internal server error while editing Schedule with EVM Group or Tenant
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: 5.11.0
Assignee: Hilda Stastna
QA Contact: Jaroslav Henner
Red Hat CloudForms Documentation
Depends On: 1686762
TreeView+ depends on / blocked
Reported: 2019-07-17 14:18 UTC by Hilda Stastna
Modified: 2019-12-13 15:01 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-12-13 15:01:45 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:

Attachments (Terms of Use)
Server error when trying to edit the Schedule (361.74 KB, image/png)
2019-07-17 14:18 UTC, Hilda Stastna
no flags Details

Description Hilda Stastna 2019-07-17 14:18:04 UTC
Created attachment 1591432 [details]
Server error when trying to edit the Schedule

Description of problem:
Internal server error occurs while editing Schedule with EVM Group or Tenant as Object Attribute Type. For other types, everything works well.

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

How reproducible:

Steps to Reproduce:
1. Go to Configuration > Settings accordion > Schedules
2. Choose Configuration > Add a new Schedule
3. For Action, choose Automation Tasks
4. For Object Attribute Type, choose EVM Group or Tenant
5. Save the schedule
6. Configuration > Edit this Schedule

Actual results:
=> [----] I, [2019-07-17T15:56:35.346480 #19795:2ad8f888c54c]  INFO -- : Started GET "/ops/schedule_form_fields/121" for ::1 at 2019-07-17 15:56:35 +0200
[----] I, [2019-07-17T15:56:35.402769 #19795:2ad8f888c54c]  INFO -- : Processing by OpsController#schedule_form_fields as HTML
[----] I, [2019-07-17T15:56:35.402952 #19795:2ad8f888c54c]  INFO -- :   Parameters: {"id"=>"121"}
[----] F, [2019-07-17T15:56:35.841908 #19795:2ad8f888c54c] FATAL -- : Error caught: [ActiveRecord::StatementInvalid] PG::UndefinedColumn: ERROR:  column "name" does not exist
LINE 1: SELECT "miq_groups"."id", "name" FROM "miq_groups"
: SELECT "miq_groups"."id", "name" FROM "miq_groups"

Expected results:
No error and being able to edit and save the changes for the schedule without
any problems.

Additional info:
This bug is reproducible only in 5.11, but the fix is missing also in 5.10
for sure. It is not reproducible in 5.10 because even creating such a schedule
is not working there (but this is already fixed for 5.11:
https://bugzilla.redhat.com/show_bug.cgi?id=1686762 and unfortunately, it was
not fixed also for editing such schedules with that BZ).
I think that this is not a regression, this must have never worked before.
This is the issue regarding choosing Group or Tenant from the drop down, not
regarding editing some item so I think there are more drop downs in different
places which might be affected by the same issue.

Comment 3 Hilda Stastna 2019-07-18 10:19:01 UTC
Just a note that For Tenant type (step 4 from steps to reproduce), there is a different error:

[----] I, [2019-07-17T18:10:07.284516 #25163:2ad562fb009c]  INFO -- : Started GET "/ops/schedule_form_fields/119" for ::1 at 2019-07-17 18:10:07 +0200
[----] I, [2019-07-17T18:10:07.325345 #25163:2ad562fb009c]  INFO -- : Processing by OpsController#schedule_form_fields as HTML
[----] I, [2019-07-17T18:10:07.325499 #25163:2ad562fb009c]  INFO -- :   Parameters: {"id"=>"119"}
[----] F, [2019-07-17T18:10:07.876950 #25163:2ad562fb009c] FATAL -- : Error caught: [ActiveModel::MissingAttributeError] missing attribute: use_config_for_attributes

Comment 4 Hilda Stastna 2019-07-18 14:15:43 UTC
The same root cause exists for both errors, and that both will be resolved via this ticket.

Comment 5 CFME Bot 2019-07-30 20:31:42 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

commit f64ebdbd4acc187a9a587fc436d6a3963019e346
Author:     Hilda Stastna <hstastna@redhat.com>
AuthorDate: Wed Jul 17 11:56:11 2019 -0400
Commit:     Hilda Stastna <hstastna@redhat.com>
CommitDate: Wed Jul 17 11:56:11 2019 -0400

    Make editing existing schedule with EVM Group/Tenant option work

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

    Fix the error by using columns_for_klass method for proper choosing
    columns for setting appropriate targets.
    Small refactoring for setting targets.

 app/controllers/ops_controller/settings/automate_schedules.rb | 15 +-
 1 file changed, 7 insertions(+), 8 deletions(-)

Comment 6 CFME Bot 2019-07-30 22:32:33 UTC
New commit detected on ManageIQ/manageiq-ui-classic/ivanchuk:

commit 3c3129b408b334a9fadca666877b645b39890e9e
Author:     Harpreet Kataria <hkataria@redhat.com>
AuthorDate: Tue Jul 30 16:29:30 2019 -0400
Commit:     Harpreet Kataria <hkataria@redhat.com>
CommitDate: Tue Jul 30 16:29:30 2019 -0400

    Merge pull request #5826 from hstastna/Internal_server_error_schedule_edit

    Make editing schedule with EVM Group/Tenant type work

    (cherry picked from commit ecd4374ce69f9a171150b90a9b763f7934e7b4d2)


 app/controllers/ops_controller/settings/automate_schedules.rb | 15 +-
 spec/controllers/ops_controller/settings/automate_schedules_spec.rb | 40 +-
 2 files changed, 39 insertions(+), 16 deletions(-)

Comment 7 Jaroslav Henner 2019-08-09 11:38:49 UTC
This ended in error in and is fixed

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