Bug 1653018

Summary: Resource has no errors on organization create
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: CandlepinAssignee: Barnaby Court <bcourt>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: csnyder, jhutar, khowell, mhulan, rplevka
Target Milestone: ReleasedKeywords: PrioBumpQA, Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-07 19:14:55 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
bug.log
none
foreman-debug none

Description Roman Plevka 2018-11-24 14:50:07 UTC
Description of problem:
ran some test involving creating an org + uploading a subscription manifest in a loop and on of the iterations failed at create organization step:

received ISE:
2018-11-24T14:00:55 [W|app|7b49f] Action failed
RuntimeError: resource have no errors
/usr/share/foreman/app/controllers/api/base_controller.rb:139:in `process_resource_error'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0/app/controllers/katello/api/v2/organizations_controller.rb:83:in `rescue in create'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0/app/controllers/katello/api/v2/organizations_controller.rb:77:in `create'
...
[the rest of the traceback is attached as bug.log]

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

How reproducible:
sometimes

Steps to Reproduce:
i just ran the org create + manifest upload in a loop
it was a clean satellite (upgraded from snap4)

Comment 1 Roman Plevka 2018-11-24 14:50:53 UTC
Created attachment 1508372 [details]
bug.log

Comment 2 Roman Plevka 2018-11-24 14:51:21 UTC
Created attachment 1508373 [details]
foreman-debug

Comment 3 Roman Plevka 2018-11-24 14:56:26 UTC
the whole task got stuck in running state, waiting on candlepin:

```
9: Actions::Candlepin::Environment::Create (running) [ 0.00s / 0.00s ]
 Input:

---
organization_label: Fbtyra
cp_id: 340ced4020b420d26fe6464cae8453ee
name: Library
description: 
session_id: 7b49f1cc-f920-41ee-99cb-7d83f0b4c354
remote_user: admin
remote_cp_user: admin
current_user_id: 4
current_organization_id: 
current_location_id: 
```

however i doubt this actually got dispatched to candlepin.
the candlepin.log only shows the Owner create request (wit response status=200)

and then 2
Request: verb=GET, uri=/candlepin/owners/Fbtyra
requests (with response status=200)

Comment 5 Marek Hulan 2018-12-03 12:51:37 UTC
Based on logs this happens in Katello - Candlepin communication. Looking at the trace, most likely Candlepin didn't respond with 200. The error message in production.log seems to be masking the real error message. Roman if you have the reproducer, I could help adjust the code so that we'd see the  real error message. Sadly I don't see anything in candlepin logs. Perhaps someone bit deeper knowledge of candlepin would find out more.

Comment 6 Barnaby Court 2018-12-03 19:26:06 UTC
There were no errors in candlepin logs at that timestamp. If katello/foreman was specifying the correlation ID or logging the request id that comes back from Candlepin we could match the direct request. 

Without a reproducer I have no way to investigate further.

Comment 7 Chris Snyder 2019-01-10 15:10:25 UTC
Roman,

Without additional information we cannot make progress on this issue.

Comment 10 Barnaby Court 2019-03-07 19:14:55 UTC
Closing as insufficient information as it has been waiting on needinfo for 2 months.