Bug 1367653 - Candlepin ConstraintViolationException when creating repositories concurrent [NEEDINFO]
Summary: Candlepin ConstraintViolationException when creating repositories concurrent
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Chris Roberts
URL:
Whiteboard:
Depends On: 1378593
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2016-08-17 06:35 UTC by Peter Vreman
Modified: 2021-03-11 14:39 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1378593 1378595 (view as bug list)
Environment:
Last Closed: 2018-02-21 16:51:07 UTC
Target Upstream Version:
bkearney: needinfo? (vrjain)


Attachments (Terms of Use)
foreman-debug of candlepin ConstraintViolationException (1.11 MB, application/x-xz)
2016-08-17 06:35 UTC, Peter Vreman
no flags Details

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


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