Created attachment 594748 [details] katello-debug-20120627075212.tar.gz Description of problem: After removing a repository from a custom provider, I then created a new repository with the same name. The following error resulted ... {"displayMessage":"Runtime Error Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,573"} Version-Release number of selected component (if applicable): * candlepin-0.6.5-1.el6_2.src.rpm * katello-0.1.318-1.el6cf.src.rpm * katello-candlepin-cert-key-pair-1.0-1.src.rpm * katello-certs-tools-1.0.7-1.el6_3.src.rpm * katello-cli-0.1.112-1.el6cf.src.rpm * katello-configure-0.1.110-1.el6_3.src.rpm * katello-qpid-broker-key-pair-1.0-1.src.rpm * katello-qpid-client-key-pair-1.0-1.src.rpm * katello-selinux-0.1.10-1.el6.src.rpm * pulp-1.0.4-1.el6.src.rpm How reproducible: Steps to Reproduce: 1. Create a custom provider, product and repository 2. Sync repository and attach to system templates ... promote (unsure if this step is required) 3. Delete the repository created in step#1 4. Create a new repository attached to the same product, using the same name used in step#1 Actual results: {"displayMessage":"Runtime Error Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,573"} Expected results: * It should succeed, or I should get a warning that I cannot use the same name? Additional info: * See katello-debug attached
REPRODUCED I can confirm that it's the promotion that triggers the bug. Synchronization, attaching to a template did not reproduce it. [root@aa ~]# kk provider create --name prov Successfully created provider [ prov ] [root@aa ~]# kk product create --name product --provider prov Created ... [root@aa ~]# kk repo create --name repo --product product --url http://lzap.fedorapeople.org/fakerepos/zoo5/ Successfully created repository [ repo ] [root@aa ~]# kk repo delete --name repo --product product Deleted repository '95' [root@aa ~]# kk repo create --name repo --product product --url http://lzap.fedorapeople.org/fakerepos/zoo5/ Successfully created repository [ repo ] [root@aa ~]# kk product synchronize --name product Product [ product ] synchronized [root@aa ~]# kk repo delete --name repo --product product Deleted repository '97' [root@aa ~]# kk repo create --name repo --product product --url http://lzap.fedorapeople.org/fakerepos/zoo5/ Successfully created repository [ repo ] [root@aa ~]# kk product synchronize --name product Product [ product ] synchronized [root@aa ~]# kk environment create --name env --prior Library Successfully created environment [ env ] [root@aa ~]# kk changeset create --name ch1 --environment env Successfully created changeset [ ch1 ] for environment [ env ] [root@aa ~]# kk changeset update --name ch1 --environment env --add_product product Successfully updated changeset [ ch1 ] [root@aa ~]# kk changeset promote --name ch1 --environment env Changeset [ ch1 ] applied [root@aa ~]# kk repo delete --name repo --product product Deleted repository '98' [root@aa ~]# kk repo create --name repo --product product --url http://lzap.fedorapeople.org/fakerepos/zoo5/ Runtime Error Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,598
https://github.com/Katello/katello/pull/550
Ignore the comment 2 ^^^ The exception is: Sep 03 11:59:35 [http-8443-1] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "cp_content_label_key" Sep 03 11:59:35 [http-8443-1] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cp_content (created, updated, contentUrl, gpgUrl, label, metadataExpire, name, releaseVer, requiredTags, type, vendor, id) values ('2012-09-03 11:59:34.624000 +02:00:00', '2012-09-03 11:59:34.624000 +02:00:00', '/custom/product/repo', '', 'ACME_Corporation_product_repo', NULL, 'repo', NULL, NULL, 'yum', 'Custom', '1346666374624') was aborted. Call getNextException to see the cause. Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cp_content (created, updated, contentUrl, gpgUrl, label, metadataExpire, name, releaseVer, requiredTags, type, vendor, id) values ('2012-09-03 11:59:34.624000 +02:00:00', '2012-09-03 11:59:34.624000 +02:00:00', '/custom/product/repo', '', 'ACME_Corporation_product_repo', NULL, 'repo', NULL, NULL, 'yum', 'Custom', '1346666374624') was aborted. Call getNextException to see the cause.
After discussion on the list (Re: [katello-devel] Demotions and deletions - solution) this solution is to be implemented: 1. If the user attempts to delete a repo (from providers screen) and the repo was not previously promoted, allow the deletion to occur. (This is also today's behavior.) 2. If the user attempts to delete a repo (from providers screen) and the repo was previously promoted: a. Do not allow the repo to be deleted. In order to support this, i. Disable the 'remove' link so the user doesn't have theoption. Add a tipsy next to the remove link that when hovered theuser can be given information on 'why' the remove link isdisabled. (e.g. "Before removing this repo from the product, itmust first be deleted from the following environments using a deletion changeset: A, B, C.") More info in the thread.
witlessb is taking over
fixed in a2fa896bb1078f792df3d329e684e6bb83ce5b16.
# REOPEN I have to reopen the bug: as UI allows removal of the provider which has the repo promoted. I think the whole sequence of: provider->product->repo needs to be locked if there is a single promotion (of product/repo) there. Same exception occur: --- Resources::Candlepin::Content: 500 Internal Server Error {"displayMessage":"Runtime Error Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,569"} (POST /candlepin/content/) (RestClient::InternalServerError) {"displayMessage":"Runtime Error Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,569"} Click here for more details. --- checked on CFSE version: --- python-qpid-0.7.946106-1.el6.noarch candlepin-cert-consumer-brno-cfse.usersys.redhat.com-1.0-1.noarch qpid-cpp-client-0.14-16.el6.x86_64 candlepin-0.7.8-1.el6cf.noarch katello-glue-pulp-1.1.12-7.el6cf.noarch qpid-cpp-server-ssl-0.14-16.el6.x86_64 katello-candlepin-cert-key-pair-1.0-1.noarch mod_wsgi-3.3-3.pulp.el6.x86_64 python-isodate-0.4.4-4.pulp.el6.noarch katello-cli-common-1.1.8-1.git.2.a0908e7.el6.noarch katello-cli-1.1.8-1.git.2.a0908e7.el6.noarch qpid-cpp-client-ssl-0.14-16.el6.x86_64 python-oauth2-1.5.170-2.pulp.el6.noarch pulp-common-1.1.12-1.el6cf.noarch pulp-selinux-server-1.1.12-1.el6cf.noarch m2crypto-0.21.1.pulp-7.el6.x86_64 candlepin-selinux-0.7.8-1.el6cf.noarch katello-common-1.1.12-7.el6cf.noarch katello-glue-candlepin-1.1.12-7.el6cf.noarch katello-1.1.12-7.el6cf.noarch katello-all-1.1.12-7.el6cf.noarch katello-qpid-broker-key-pair-1.0-1.noarch katello-certs-tools-1.1.8-1.el6cf.noarch katello-repos-1.1.2-1.el6.noarch katello-agent-1.1.2-1.el6.noarch katello-configure-1.1.9-3.el6cf.noarch qpid-cpp-server-0.14-16.el6.x86_64 pulp-1.1.12-1.el6cf.noarch katello-selinux-1.1.1-1.el6cf.noarch candlepin-tomcat6-0.7.8-1.el6cf.noarch katello-qpid-client-key-pair-1.0-1.noarch ---
scenario to reproduce: - create provider/product/repo - promote the product - remove the provider - recreate provider/product (same names) - try to create the repo with the same name. Exception!
# VERIFIED there is exception showing: --- Provider cannot be deleted since one of its products or repositories has already been promoted. Using a changeset, please delete the repository from existing environments before deleting it. --- doing the scenario on comment#9 checked on version: --- katello-1.1.12-12.el6cf.noarch katello-cli-1.1.8-6.el6cf.noarch
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. http://rhn.redhat.com/errata/RHSA-2012-1543.html
I'm seeing a very similar failure, while attempting to add a custom provider repository, whose name matches that of a custom provider repository that has since been deleted. > 2013-02-08 12:31:50,359 [ERROR][MainThread] error() @ base.py:222 - error: Runtime Error Could not execute JDBC batch update at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,569 This was reproduced with the following packages ... * candlepin-0.7.19-3.el6cf.src.rpm * katello-1.1.12.2-3.el6cf.src.rpm * katello-candlepin-cert-key-pair-1.0-1.src.rpm * katello-certs-tools-1.1.8-1.el6cf.src.rpm * katello-cli-1.1.8-14.el6cf.src.rpm * katello-configure-1.1.9-13.el6cf.src.rpm * katello-qpid-broker-key-pair-1.0-1.src.rpm * katello-qpid-client-key-pair-1.0-1.src.rpm * katello-selinux-1.1.1-3.el6cf.src.rpm * pulp-1.1.15-1.el6cf.src.rpm I don't recall observing the exception noted in comment#13 Can someone confirm that the patch has been applied to the above version of katello?
Created attachment 695202 [details] katello-debug-20130208130639.tar.gz
Reopening based on discussion w/ bkearney on #systemengine
getting rid of 6.0.0 version since that doesn't exist
This bug was closed because of a lack of activity. If you feel this bug should be reconsidered for attention please feel free to re-open the bug with a comment stating why it should be reconsidered.