Bug 1770300 - When trying to delete Service Dialogs, we get an error that custom button is not found
Summary: When trying to delete Service Dialogs, we get an error that custom button is ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.10.11
Hardware: x86_64
OS: Other
high
high
Target Milestone: GA
: 5.12.0
Assignee: Martin Hradil
QA Contact: Nikhil Dhandre
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1783382 1783383
TreeView+ depends on / blocked
 
Reported: 2019-11-08 16:43 UTC by mabah
Modified: 2024-01-06 04:27 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1783382 1783383 (view as bug list)
Environment:
Last Closed: 2020-06-10 13:00:07 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:
lpichler: needinfo-


Attachments (Terms of Use)

Comment 7 Tina Fitzgerald 2019-11-14 19:14:50 UTC
Hi Mabah,

We're not able to reproduce the primary issue.

Can you ask the customer to provide more detail as to how to recreate the issue.

1. What type of service does the service dialog belong to? 
2. What type of custom button was added/deleted.
3. How did they add it to the service?

A video showing the reproducer would be very helpful.

Thanks,
Tina

Comment 8 Tina Fitzgerald 2019-11-14 20:29:38 UTC
Hi Mabah,

The customer states that "We have several old Dialogs."
Can you ask the customer to recreate the issue with a new service dialog?

Thanks,
Tina

Comment 9 mabah 2019-11-18 14:40:46 UTC
(In reply to Tina Fitzgerald from comment #8)
> Hi Mabah,
> 
> The customer states that "We have several old Dialogs."
> Can you ask the customer to recreate the issue with a new service dialog?
> 
> Thanks,
> Tina

Hi Tina,

Sorry for the delayed response on this. I am OoO on PTO and just got back this morning. I will be working with the customer today and update the case.

Thanks,

Mamadou

Comment 12 drew uhlmann 2019-11-19 19:47:17 UTC
Thanks for the info! I managed to reproduce the issue in question. Unfortunately the only way I could reproduce was by manually deleting the custom button using a delete in rails console -- an action that doesn't run callbacks and will not correctly remove the relationships necessary to be able to delete this. 

I don't think this is a valid issue for that reason. 

Precisely as you said in the description, destroy runs any callbacks on the model while delete doesn't. So anyone who runs a delete is going to end up with issues where the associations are still present and won't have been correctly removed.

Comment 13 drew uhlmann 2019-11-20 13:18:08 UTC
Based on the fact that there is no way that I'm aware of for this issue to arise without manual deletion of the custom buttons outside the application, Dennis informs me I can close this ticket as not a bug.

Comment 17 mabah 2019-11-20 14:50:50 UTC
(In reply to drew uhlmann from comment #13)
> Based on the fact that there is no way that I'm aware of for this issue to
> arise without manual deletion of the custom buttons outside the application,
> Dennis informs me I can close this ticket as not a bug.

Drew, let's not close it yet, until at least I get the video reproducer from the customer.  I understand that you are only able to reproduce via the rails c, however the issue with the customer is that they cannot delete the buttons from UI.

Thanks,

Mamadou

Comment 35 drew uhlmann 2019-12-03 21:07:32 UTC
>> or could the API be doing delete instead of destroy?

Nope, I verified that on 5.10.11 an API custom button removal runs the callback.

Comment 38 Harpreet Kataria 2019-12-09 15:21:03 UTC
https://github.com/ManageIQ/manageiq/pull/19574

Comment 39 CFME Bot 2019-12-09 16:05:38 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/773a1547fb99d0fb1b91d28ce1f6ce5f53f44490
commit 773a1547fb99d0fb1b91d28ce1f6ce5f53f44490
Author:     Martin Hradil <mhradil>
AuthorDate: Tue Dec  3 16:43:01 2019 -0500
Commit:     Martin Hradil <mhradil>
CommitDate: Tue Dec  3 16:43:01 2019 -0500

    Dialog#destroy should ignore resource actions linking nonexisting entities

    Currently, if you have a Dialog associated with a Custom Button,
    and `delete` the custom button (as opposed to `destroy`; that should not happen, but apparently does),

    deleting the dialog will fail, because `ra.resource_type.constantize.find(ra.resource_id)` throws an exception as the resource no longer exists. (The resource being a removed custom button.)

    So, updating `reject_if_has_resource_action` to ignore resource actions pointing to nonexistent resources.

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

 app/models/dialog.rb | 8 +-
 spec/models/dialog_spec.rb | 10 +
 2 files changed, 16 insertions(+), 2 deletions(-)

Comment 43 Red Hat Bugzilla 2024-01-06 04:27:09 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


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