Bug 1205921 - Runtime Error could not execute statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,094 (Katello::Errors::CandlepinError)
Summary: Runtime Error could not execute statement at org.postgresql.core.v3.QueryExec...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Candlepin
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Ivan Necas
QA Contact: sthirugn@redhat.com
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-25 23:00 UTC by Og Maciel
Modified: 2017-02-23 20:14 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:30:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screenshot (101.18 KB, image/png)
2015-03-25 23:00 UTC, Og Maciel
no flags Details
foreman-debug (259.01 KB, application/octet-stream)
2015-03-25 23:00 UTC, Og Maciel
no flags Details
selected ks repos (56.91 KB, image/png)
2015-03-26 16:26 UTC, Sachin Ghai
no flags Details
candlepin error.log (11.01 KB, text/plain)
2015-04-02 05:22 UTC, sthirugn@redhat.com
no flags Details
foreman debug (452.90 KB, application/x-xz)
2015-04-02 05:24 UTC, sthirugn@redhat.com
no flags Details
candlepin error log latest (22.30 KB, text/plain)
2015-04-02 06:11 UTC, sthirugn@redhat.com
no flags Details
candlepin logs (49.43 KB, application/octet-stream)
2015-04-02 12:56 UTC, Og Maciel
no flags Details
Tomcat logs (5.09 KB, application/octet-stream)
2015-04-02 12:57 UTC, Og Maciel
no flags Details
verification screenshot (125.03 KB, image/png)
2015-06-02 15:42 UTC, sthirugn@redhat.com
no flags Details
verification logs (98.91 KB, text/plain)
2015-06-02 15:43 UTC, sthirugn@redhat.com
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 9978 0 Normal Closed Runtime Error could not execute statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,094 (Katell... 2020-09-17 20:37:39 UTC
Red Hat Bugzilla 1207642 0 unspecified CLOSED Race-condition on enabling repositories or promoting to the same environment. 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2015:1592 0 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC

Internal Links: 1207642

Description Og Maciel 2015-03-25 23:00:16 UTC
Created attachment 1006529 [details]
screenshot

Description of problem:

This is a RHEL 6.6 x86_64 system with the Satellite-6.1.0-RHEL-6-20150324.0 build.

After importing a valid manifest, I started enabling the kickstart repos for the following products in this order (via the web ui, see the attached screenshot):

* Red Hat Enterprise Linux 5 Server Kickstart i386 5.9
* Red Hat Enterprise Linux 5 Server Kickstart x86_64 5.9
* Red Hat Enterprise Linux 6 Server Kickstart i386 6.6
* Red Hat Enterprise Linux 6 Server Kickstart x86_64 6.6

These were enabled really quickly clicking on each checkbox and that's when I saw the error.

It is interesting that I did the same exact setup on a RHEL 7.1 system and I did not see this.

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

* Satellite-6.1.0-RHEL-6-20150324.0


How reproducible:


Steps to Reproduce:
1. Install build Satellite-6.1.0-RHEL-6-20150324.0 on RHEL 6.6 system
2. Import valid manifest
3. Enable all repos listed above in a quick sequence using the web ui

Actual results:


Expected results:


Additional info:

Task 4340a6ba-a47d-4fea-81f9-60bac9103123: Katello::Errors::CandlepinError: Runtime Error could not execute statement at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,094

Comment 1 Og Maciel 2015-03-25 23:00:56 UTC
Created attachment 1006533 [details]
foreman-debug

Comment 2 RHEL Program Management 2015-03-25 23:13:08 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Sachin Ghai 2015-03-26 16:24:30 UTC
I tried same scenario on my setup which is on rhel66 and without squid proxy. I quickly enabled couple of ks repos and all enabled successfully.
Not sure if proxy is causing this.

Comment 5 Sachin Ghai 2015-03-26 16:26:46 UTC
Created attachment 1006878 [details]
selected ks repos

Comment 6 Mike McCune 2015-03-31 03:51:39 UTC
I got a slightly different error:

"Exception:

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

I'd argue we can push this to GA as the resolution is to just resume the task and it doesn't happen that often unless you click really fast.

ugly, but not fatal

Comment 7 Ivan Necas 2015-03-31 11:43:40 UTC
The problem here is that both actions try to enable the same repository concurrently. The solution would be to catch the error coming from candlepin and handle the case, that some other action already added the id (by simple making sure the id is already in the cp environment).

While looking at this issue, I've found another race-condition case that can cause issues. I will file another bugzilla for that one.

Comment 8 Ivan Necas 2015-03-31 11:58:34 UTC
I've filed another BZ with another race-condition, related to this https://bugzilla.redhat.com/show_bug.cgi?id=1207642

Comment 9 Partha Aji 2015-03-31 18:22:36 UTC
Created redmine issue http://projects.theforeman.org/issues/9978 from this bug

Comment 10 Partha Aji 2015-03-31 20:35:00 UTC
should be resolved when ->  https://github.com/Katello/katello/pull/5155 gets merged

Comment 13 sthirugn@redhat.com 2015-04-02 05:22:02 UTC
I still see error when enabling and disabling.  See candlepin error log and foreman debug.

Comment 14 sthirugn@redhat.com 2015-04-02 05:22:32 UTC
Created attachment 1009959 [details]
candlepin error.log

Comment 15 sthirugn@redhat.com 2015-04-02 05:24:07 UTC
Created attachment 1009961 [details]
foreman debug

Comment 16 Mike McCune 2015-04-02 05:55:02 UTC
Talked with Suresh on IRC about this. He got initial Permission Denied errors from the CDN which I think put his set of tasks in a bad state. 

This may be a different situation than this bug as I was able to import a fresh manifest into an org on his sat and enable 20+ repos without error.

Will investigate a bit more tomorrow with a dead manifest to see if we can reproduce his specific error condition and if so, file a new bug.

Comment 17 sthirugn@redhat.com 2015-04-02 06:11:01 UTC
I tried with a new manifest in a new Org as Mike suggested.  But got the error in candlepin logs. I will attach the specific logs here.

Comment 18 sthirugn@redhat.com 2015-04-02 06:11:46 UTC
Created attachment 1009969 [details]
candlepin error log latest

Comment 19 Og Maciel 2015-04-02 12:51:19 UTC
I was able to reproduce it today but the steps to do it are not really clear. I expanded different channels and then as one of the channels was still loading to expose its products, I enabled a product from the first channel I clicked. I see errors in both candlepin.log and catalina.out.

Comment 20 Og Maciel 2015-04-02 12:56:21 UTC
Created attachment 1010152 [details]
candlepin logs

Candlepin logs using Satellite-6.1.0-RHEL-6-20150331.1 build.

Comment 21 Og Maciel 2015-04-02 12:57:06 UTC
Created attachment 1010154 [details]
Tomcat logs

Tomcat logs using Satellite-6.1.0-RHEL-6-20150331.1 build.

Comment 24 Ivan Necas 2015-06-02 11:01:53 UTC
The fix for this error can still produce some errors in the catalina.out: the fix is to handle the error state properly: the errors in catalina.out are just saying, that the repository was already enabled, but should have now influence on the behaviour of the satellite itself. Putting back on QE to verify, that the satellite works after enabling the repositories: not paused tasks with error result.

Comment 25 sthirugn@redhat.com 2015-06-02 15:42:34 UTC
Verified as per the steps mentioned in Comment 19.  I dont see candlepin errors or task failures when I retested in Snap6.  Please note that there is a know race condition as mentioned in Comment 8 - https://bugzilla.redhat.com/show_bug.cgi?id=1207642.

Version Tested:
Sate 6.1 GA Snap 6

Verification screenshot and verification logs attached for reference.

Comment 26 sthirugn@redhat.com 2015-06-02 15:42:53 UTC
Created attachment 1033853 [details]
verification screenshot

Comment 27 sthirugn@redhat.com 2015-06-02 15:43:16 UTC
Created attachment 1033854 [details]
verification logs

Comment 28 Bryan Kearney 2015-08-11 13:33:55 UTC
This bug is slated to be released with Satellite 6.1.

Comment 29 errata-xmlrpc 2015-08-12 05:30:40 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-2015:1592


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