Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1367653

Summary: Candlepin ConstraintViolationException when creating repositories concurrent
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Chris Roberts <chrobert>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bcourt, bkearney, brubisch, chrobert, jcallaha, vrjain
Target Milestone: UnspecifiedKeywords: 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:
: 1378593 1378595 (view as bug list) Environment:
Last Closed: 2018-02-21 16:51:07 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:
Bug Depends On: 1378593    
Bug Blocks: 1122832    
Attachments:
Description Flags
foreman-debug of candlepin ConstraintViolationException none

Description Peter Vreman 2016-08-17 06:35:23 UTC
Created attachment 1191472 [details]
foreman-debug of candlepin ConstraintViolationException

Description of problem:
When i created 2 repositories concurrent a candlepin exception is thrown.
One of the tasks is getting paused. After resuming it works.

2016-08-14 14:00:11 [app] [I] Started GET "/katello/api/v2/products" for 127.0.0.1 at 2016-08-14 14:00:11 +0000
2016-08-14 14:00:11 [app] [I] Processing by Katello::Api::V2::RepositoriesController#index as */*
2016-08-14 14:00:11 [app] [I]   Parameters: {"per_page"=>9999, "organization_id"=>3, "name"=>"HOIRHEL-6.8-d20160814", "product_id"=>"36", "api_version"=>"v2", "repository"=>{"name"=>"HOIRHEL-6.8-d20160814", "product_id"=>"36"}
}
2016-08-14 14:00:12 [app] [I] Authorized user hoici(hoici )
2016-08-14 14:00:12 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/app/views/katello/api/v2/repositories/index.json.rabl within katello/api/v2/layouts/collection (1.4ms)
2016-08-14 14:00:12 [app] [I] Completed 200 OK in 45ms (Views: 2.4ms | ActiveRecord: 8.0ms)
2016-08-14 14:00:12 [app] [I] Started POST "/katello/api/v2/repositories" for 127.0.0.1 at 2016-08-14 14:00:12 +0000
2016-08-14 14:00:12 [app] [I] Processing by Katello::Api::V2::RepositoriesController#create as */*
2016-08-14 14:00:12 [app] [I]   Parameters: {"per_page"=>9999, "organization_id"=>3, "name"=>"HOIRHEL-6Server-d20160814", "product_id"=>"36", "content_type"=>"yum", "url"=>"http://fibsbamboodev.hag.hilti.com/hoici/release/HOIR
HEL-6Server-d20160814/rpm", "api_version"=>"v2", "repository"=>{"name"=>"HOIRHEL-6Server-d20160814", "url"=>"http://fibsbamboodev.hag.hilti.com/hoici/release/HOIRHEL-6Server-d20160814/rpm", "content_type"=>"yum", "product_id"=
>"36"}}
2016-08-14 14:00:12 [app] [I] Authorized user hoici(hoici )
2016-08-14 14:00:12 [app] [I] Started POST "/katello/api/v2/repositories" for 127.0.0.1 at 2016-08-14 14:00:12 +0000
2016-08-14 14:00:12 [app] [I] Processing by Katello::Api::V2::RepositoriesController#create as */*
2016-08-14 14:00:12 [app] [I]   Parameters: {"per_page"=>9999, "organization_id"=>3, "name"=>"HOIRHEL-6.8-d20160814", "product_id"=>"36", "content_type"=>"yum", "url"=>"http://fibsbamboodev.hag.hilti.com/hoici/release/HOIRHEL-
6.8-d20160814/rpm", "api_version"=>"v2", "repository"=>{"name"=>"HOIRHEL-6.8-d20160814", "url"=>"http://fibsbamboodev.hag.hilti.com/hoici/release/HOIRHEL-6.8-d20160814/rpm", "content_type"=>"yum", "product_id"=>"36"}}
2016-08-14 14:00:12 [app] [I] Authorized user hoici(hoici )
2016-08-14 14:00:12 [app] [I] Processing by Katello::Api::V2::ProductsController#index as */*
2016-08-14 14:00:12 [app] [I]   Parameters: {"per_page"=>9999, "organization_id"=>3, "name"=>"HOIRHEL", "api_version"=>"v2", "product"=>{"name"=>"HOIRHEL", "organization_id"=>3}}
2016-08-14 14:00:12 [app] [I] Authorized user hoici(hoici )
2016-08-14 14:00:13 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/app/views/katello/api/v2/products/index.json.rabl within katello/api/v2/layouts/collection (596.3ms)
2016-08-14 14:00:13 [app] [I] Completed 200 OK in 712ms (Views: 586.4ms | ActiveRecord: 30.0ms)
2016-08-14 14:00:13 [foreman-tasks/action] [E] Runtime Error could not execute statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102 (Katello::Errors::CandlepinError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/app/lib/actions/middleware/propagate_candlepin_errors.rb:21:in `rescue in propagate_candlepin_errors'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/app/lib/actions/middleware/propagate_candlepin_errors.rb:19:in `propagate_candlepin_errors'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/app/lib/actions/middleware/propagate_candlepin_errors.rb:9:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:22:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/middleware.rb:17:in `pass'

See attached foreman-debug for more info, the time was 2016-08-14 at 14:00:12


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


How reproducible:


Steps to Reproduce:
1. Create 2 repositories at the same time


2.
3.

Actual results:


Expected results:


Additional info:

Creating multiple repositories at the same time with a script triggers a Nullpointer exception,i will file another BZ for this

hammer -c/opt/hoici/etc/sat6/hammer-hoici.yaml product create --organization-id=3 --name=TestProdA
for i in `seq 1 30`; do hammer -c/opt/hoici/etc/sat6/hammer-hoici.yaml repository create --organization-id=3 --product=TestProdA --content-type=yum --name=TestRepoA$i & done

Comment 1 Peter Vreman 2016-08-17 06:37:56 UTC
The script to simulate and the NullPointerException is already discussed in BZ1356916

Comment 6 Chris Roberts 2017-09-06 17:00:40 UTC
Enabled 4 repos at once and all enabled fine without any errors or paused tasks, marking as verified.

Comment 7 Satellite Program 2018-02-21 16:51:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336

Comment 8 Red Hat Bugzilla 2023-09-14 23:59:56 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days