Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1356916 - Creating repositories simultanously results in null pointer exception in org.candlepin.model.AbstractHibernateCurator.delete
Summary: Creating repositories simultanously results in null pointer exception in org....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Candlepin
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
medium
high vote
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On: 1357118
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-15 09:22 UTC by Roman Plevka
Modified: 2019-04-01 20:26 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1357118 (view as bug list)
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:


Attachments (Terms of Use)
candlepin.log (deleted)
2016-07-15 09:32 UTC, Roman Plevka
no flags Details
production.log (deleted)
2016-07-15 09:33 UTC, Roman Plevka
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 15482 None None None 2016-07-22 17:00:58 UTC

Description Roman Plevka 2016-07-15 09:22:41 UTC
Description of problem:
Triggering multiple `repository create` requests asynchronously leads to 

Katello::Errors::CandlepinError: Runtime Error null at org.candlepin.model.AbstractHibernateCurator.delete:326

Task stays in PAUSED:ERROR state and is able to be resumed (and eventually finishes successfully)

Version-Release number of selected component (if applicable):
6.2.0 snap20.1

How reproducible:
often even with 3 simultaneous requests

Steps to Reproduce:
1. create a product
2.
# note teh ampersand at the end of the command - this ensures asynchronous execution of the command throughout the loop
for i in {1..10}; do echo $i; bash -c "hammer --csv -u admin -p changeme repository create --organization-id 1 --product-id ${PROD_ID} --name foo-repo-${i} --content-type yum &"; done


Actual results:
# Message,Id,Name
Repository created,1,foo-repo-1
Could not create the repository:
  Task 54f2d332-889e-46de-bab5-9001b212eb99: Katello::Errors::CandlepinError: Runtime Error null at org.candlepin.model.AbstractHibernateCurator.delete:326
Message,Id,Name
Repository created,4,foo-repo-4
...



Expected results:
all repos create successfully, the tasks don't conflict

Additional info:

The null pointer exception in Candlepin has been already addressed in https://bugzilla.redhat.com/show_bug.cgi?id=1345765 (they won't backport the fix).
However the issue is in katello sending invalid requests to CP

Comment 1 Roman Plevka 2016-07-15 09:32:13 UTC
Created attachment 1180081 [details]
candlepin.log

candlepin.log during the asynchronous repo create requests

Comment 2 Roman Plevka 2016-07-15 09:33:08 UTC
Created attachment 1180082 [details]
production.log

foreman/production.log around the asynchronous repo create requests.

Comment 10 Bryan Kearney 2016-07-22 18:16:19 UTC
Upstream bug component is Candlepin

Comment 11 Bryan Kearney 2016-08-17 14:16:53 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15482 has been closed

Comment 12 David Šarman 2016-09-05 16:31:30 UTC
The fix in Candlepin will make sure no Nullpointer exceptions will be returned, instead Candlepin will return 400 http code, which is the proper behavior from Candlepins side.
Justin, do you think Kattello can be fixed to handle 400 in case of duplicitous demotions?

Comment 14 Roman Plevka 2016-10-14 11:36:50 UTC
VERIFIED
on sat6.3 snap3
candlepin-0.9.54.10-1.el7.noarch
katello-3.2.0-2.rc1.el7.noarch

no longer reproducible:

<pre>
# for i in {11..30}; do echo $i; bash -c "hammer --csv -u admin -p changeme repository create --organization-id 1 --product-id 1 --name foo-repo-${i} --content-type yum &"; done
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Message,Id,Name
Repository created,11,foo-repo-11
Message,Id,Name
Repository created,12,foo-repo-21
Message,Id,Name
Repository created,13,foo-repo-17
Message,Id,Name
Repository created,14,foo-repo-18
Message,Id,Name
Repository created,15,foo-repo-15
Message,Id,Name
Repository created,16,foo-repo-25
Message,Id,Name
Repository created,17,foo-repo-12
Message,Id,Name
Repository created,18,foo-repo-16
Message,Id,Name
Repository created,19,foo-repo-20
Message,Id,Name
Repository created,20,foo-repo-24
Message,Id,Name
Repository created,21,foo-repo-19
Message,Id,Name
Repository created,22,foo-repo-14
Message,Id,Name
Repository created,23,foo-repo-13
Message,Id,Name
Repository created,24,foo-repo-23
Message,Id,Name
Repository created,25,foo-repo-27
Message,Id,Name
Repository created,26,foo-repo-26
Message,Id,Name
Repository created,27,foo-repo-22
Message,Id,Name
Repository created,28,foo-repo-30
Message,Id,Name
Repository created,29,foo-repo-29
Message,Id,Name
Repository created,30,foo-repo-28
</pre>

Comment 15 pm-sat@redhat.com 2018-02-21 16:54:17 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.