Bug 1594843

Summary: Cannot edit credentials for Ansible Embedded
Product: Red Hat CloudForms Management Engine Reporter: Ruslana Babyuk <rbabyuk>
Component: UI - OPSAssignee: James Wong <jwong>
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: high    
Version: 5.10.0CC: cpelland, dmisharo, hkataria, lavenel, mpovolny, obarenbo, simaishi, yrudman, znemecko
Target Milestone: GA   
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ansible_embed
Fixed In Version: 5.10.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-11 14:03:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
creds_update none

Description Ruslana Babyuk 2018-06-25 14:20:38 UTC
Created attachment 1454374 [details]
creds_update

Description of problem:
Cannot edit credentials for Ansible Embedded

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

How reproducible:
100%

Steps to Reproduce:
1. Enable Embedded Ansible
2. Add credential
3. Try to edit it 

Actual results:
The error is shown in the notification, and also appears in the logs

Expected results:
credential should be edited

Additional info:

Comment 4 Zita Nemeckova 2018-06-28 10:24:19 UTC
Thanks, I was able to reproduce.

This seems to be an error on backend side. UI sends data correctly via API as shown below. 

https://10.8.198.62/api/authentications/7

become_method: ""
become_username:""
id:"7"
name:"Pepek is here"
type:"ManageIQ::Providers::EmbeddedAnsible::AutomationManager::MachineCredential"
userid:""

And returns 200.

So assigning to you James. Please let me know if you find that UI isn't sending something correctly via API. 

Thanks,
Zita

Comment 5 James Wong 2018-06-28 15:34:36 UTC
Zita,

The payload to Tower has a `miq_task_id` that is causing the failure.  Can you see why this is being sent to the backend? 

thanks,
james
===========
[----] E, [2018-06-25T09:56:14.380854 #12025:56af7c] ERROR -- : MIQ(MiqQueue#deliver) Message id: [511], Error: [{"detail":["'miq_task_id' is not a valid field for Machine"]}]
[----] E, [2018-06-25T09:56:14.381431 #12025:56af7c] ERROR -- : [AnsibleTowerClient::ClientError]: {"detail":["'miq_task_id' is not a valid field for Machine"]}  Method:[block in method_missing]
[

Comment 6 Zita Nemeckova 2018-06-29 09:48:56 UTC
James,

I cannot reproduce it on upstream master. Maybe it can be closed as WORKSFORME if you can't reproduce either.

Comment 7 James Wong 2018-07-05 15:23:21 UTC
https://github.com/ManageIQ/manageiq/issues/17015 brought in the 'miq_task_id' which is causing this failure.

Adding Yuri...

Comment 8 Yuri Rudman 2018-07-05 15:52:33 UTC
Ruslana, Dmitry,
There is new column miq_task_id added to miq_queue table.
Is appliance with error was fresh installation, is it possible that you get latest code but did not run db:migrate ?

Comment 10 Ruslana Babyuk 2018-07-10 07:48:25 UTC
In my case, it was a fresh appliance, with new configured db

Comment 11 CFME Bot 2018-07-11 17:43:40 UTC
New commit detected on ManageIQ/manageiq-providers-ansible_tower/master:

https://github.com/ManageIQ/manageiq-providers-ansible_tower/commit/9cc3598ee1affc402f4ded2dcc6e2988ecd00064
commit 9cc3598ee1affc402f4ded2dcc6e2988ecd00064
Author:     James Wong <webpotent>
AuthorDate: Mon Jul  9 15:42:51 2018 -0400
Commit:     James Wong <webpotent>
CommitDate: Mon Jul  9 15:42:51 2018 -0400

    tower_api.update_in_provider to remove miq_task_id from params beforehand

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

 app/models/manageiq/providers/ansible_tower/shared/automation_manager/tower_api.rb | 1 +
 spec/support/ansible_shared/automation_manager/configuration_script_source.rb | 3 +-
 spec/support/ansible_shared/automation_manager/credential.rb | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

Comment 12 Dmitry Misharov 2018-07-19 08:39:58 UTC
Fixed and verified in 5.10.0.4.20180712211305_e6e4542. Ansible credential can be edited.