Bug 1729441

Summary: Validation failed: MiqSchedule: Name has already been taken
Product: Red Hat CloudForms Management Engine Reporter: Niladri Roy <niroy>
Component: ApplianceAssignee: Yuri Rudman <yrudman>
Status: CLOSED CURRENTRELEASE QA Contact: Parthvi Vala <pvala>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.5CC: abellott, gekis, jocarter, ngupta, obarenbo, pvala, simaishi, yrudman
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1740229 (view as bug list) Environment:
Last Closed: 2019-12-13 14:54:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1740229    

Description Niladri Roy 2019-07-12 09:49:27 UTC
Description of problem:
Below error is observed when appliance is booting up
[----] E, [2019-07-09T09:27:03.343594 #7022:130ef48] ERROR -- : [ActiveRecord::RecordInvalid]: Validation failed: MiqSchedule: Name has already been taken  Method:[block (2 levels) in <class:LogProxy>]

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

How reproducible:
everytime at Cu environment

Steps to Reproduce:
1. restart one appliance
2. observe evm.log

Actual results:
appliance fails at seeding a widget
[----] I, [2019-07-09T09:27:03.326197 #7022:130ef48]  INFO -- : Widget: [Pods per Ready Status Chart] file has been updated on disk, synchronizing with model
[----] E, [2019-07-09T09:27:03.343594 #7022:130ef48] ERROR -- : [ActiveRecord::RecordInvalid]: Validation failed: MiqSchedule: Name has already been taken  Method:[block (2 levels) in <class:LogProxy>]

Expected results:
seeding should succeed and evmapplication should start running successfully

Additional info:

Comment 13 CFME Bot 2019-08-08 13:50:51 UTC
New commit detected on ManageIQ/manageiq/master:

commit 484c88134c1cf39edf8b18508a7b47e0a1b8d573
Author:     Yuri Rudman <yrudman@redhat.com>
AuthorDate: Tue Jul 23 12:56:40 2019 -0400
Commit:     Yuri Rudman <yrudman@redhat.com>
CommitDate: Tue Jul 23 12:56:40 2019 -0400

    fix: check if shedule for widget with the same name already exists and reuse it instead of raising error. It would resolve issue with failing seeding in case when chedule exists but not libked to corresponding widget.
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1729441

 app/models/miq_widget.rb | 26 +-
 spec/models/miq_widget_spec.rb | 27 +
 2 files changed, 51 insertions(+), 2 deletions(-)

Comment 14 CFME Bot 2019-08-08 22:01:00 UTC
New commit detected on ManageIQ/manageiq/ivanchuk:

commit 9a91d360a914c8c34baa321406691b3929a986b7
Author:     Brandon Dunne <bdunne@redhat.com>
AuthorDate: Thu Aug  8 09:43:12 2019 -0400
Commit:     Brandon Dunne <bdunne@redhat.com>
CommitDate: Thu Aug  8 09:43:12 2019 -0400

    Merge pull request #19037 from yrudman/che-for-existted-sheduler-when-seeding

    Fix: do not raise error if schedule for widget exists but not linked
    (cherry picked from commit a248ba302ef069a25d4967eee97f363d41d35745)


 app/models/miq_widget.rb | 22 +-
 spec/models/miq_widget_spec.rb | 34 +
 2 files changed, 54 insertions(+), 2 deletions(-)

Comment 16 Parthvi Vala 2019-08-21 11:42:28 UTC
FIXED. Verified on

The server did not start successfully after dumping the database, but that was probably because the database dump was from a 5.10 appliance and I was dumping it on a 5.11 appliance. But the seeding completed successfully, hence marking the BZ as VERIFIED.