+++ This bug was initially created as a clone of Bug #1210011 +++ Description of problem: Receiving traceback emails with the error below: +++++++ SQL Error generated: (99999, 'ERROR: current transaction is aborted, commands ignored until end of transaction block', '', InternalError('current transaction is aborted, commands ignored until end of transaction block\n',)) Exception Handler Information Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", line 122, in call_function response = func(*params) File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 913, in virt_notify rhnVirtualization._virt_notify(server_id, actions) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 806, in _virt_notify handler.handle(server_id, action) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 211, in handle handler(system_id, timestamp, properties) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 241, in _handle_domain_exists row = self.__db_get_domain(system_id, uuid) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnVirtualization.py", line 513, in __db_get_domain query.execute(host_id = host_id, uuid = uuid) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 147, in execute return self._execute_wrapper(self._execute, *p, **kw) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 292, in _execute_wrapper raise sql_base.SQLSchemaError(error_code, e.pgerror, e) SQLSchemaError: (99999, 'ERROR: current transaction is aborted, commands ignored until end of transaction block', '', InternalError('current transaction is aborted, commands ignored until end of transaction block\n',)) +++++++ Looking at the database logs, we can see the PL/SQL error: 2015-03-10 23:44:02.343 EDT ERROR: LIMIT must not be negative 2015-03-10 23:44:02.343 EDT CONTEXT: SQL statement "UPDATE rhnServerChannel sc set is_fve = 'Y' where sc.server_id in ( select vi.virtual_system_id from rhnServerFveCapable sfc inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where vi.host_system_id = server_id_in and sfc.channel_family_id = family.channel_family_id order by vi.modified desc limit free_slots )" PL/pgSQL function rhn_entitlements.repoll_virt_guest_entitlements(numeric) line 102 at SQL statement 2015-03-10 23:44:02.343 EDT STATEMENT: SELECT rhn_entitlements.repoll_virt_guest_entitlements(1000020471) 2015-03-10 23:44:02.345 EDT ERROR: current transaction is aborted, commands ignored until end of transaction block We know that the virt/virt-platform are deprecated, however after asking the customer database to do some investigation, we were able to address this problem after cutting a Satellite entitlement certificate with some virt and virt-platform entitlements. Looking on the top of this PL, the SQL test verifies if it system has a virtualization platform or not: ++++++ begin select 1 into is_virt from rhnServerEntitlementView where server_id = server_id_in and label in ('virtualization_host', 'virtualization_host_platform'); ++++++ However looking at the RHEV hosts registered, they don't have the virtualization_host_platform entitlement Before assigning to the virtualization platform to the RHEV host, this was the error: rhnschema=# select rhn_entitlements.repoll_virt_guest_entitlements(1000020471); ERROR: LIMIT must not be negative CONTEXT: SQL statement "UPDATE rhnServerChannel sc set is_fve = 'Y' where sc.server_id in ( select vi.virtual_system_id from rhnServerFveCapable sfc inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where vi.host_system_id = server_id_in and sfc.channel_family_id = family.channel_family_id order by vi.modified desc limit free_slots )" PL/pgSQL function rhn_entitlements.repoll_virt_guest_entitlements(numeric) line 102 at SQL statement After assign it: rhnschema=# select rhn_entitlements.repoll_virt_guest_entitlements(1000020471); ERROR: can't read "the_log_id": no such variable CONTEXT: can't read "the_log_id": no such variable while executing "return $the_log_id" (procedure "__PLTcl_proc_16459" line 4) invoked from within "__PLTcl_proc_16459" in PL/Tcl function "_get_log_id" PL/pgSQL function get_log_id() line 7 at assignment PL/pgSQL function rhnservergroup_log_trig_fun() line 5 at assignment SQL statement "update rhnServerGroup set current_members = current_members_calc where org_id = a_group_type.org_id and group_type = a_group_type.group_type" PL/pgSQL function rhn_entitlements.repoll_virt_guest_entitlements(numeric) line 218 at SQL statement ** Disabling audit rules rhnschema=# select * from logging.clear_log_id(); clear_log_id -------------- (1 row) rhnschema=# select rhn_entitlements.repoll_virt_guest_entitlements(1000020471); repoll_virt_guest_entitlements -------------------------------- (1 row) -- testing another servers rhnschema=# select * from logging.clear_log_id(); clear_log_id -------------- (1 row) rhnschema=# select rhn_entitlements.repoll_virt_guest_entitlements(1000020472); ERROR: LIMIT must not be negative CONTEXT: SQL statement "UPDATE rhnServerChannel sc set is_fve = 'Y' where sc.server_id in ( select vi.virtual_system_id from rhnServerFveCapable sfc inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where vi.host_system_id = server_id_in and sfc.channel_family_id = family.channel_family_id order by vi.modified desc limit free_slots )" PL/pgSQL function rhn_entitlements.repoll_virt_guest_entitlements(numeric) line 102 at SQL statement adding entitlement --- rhnschema=# select rhn_entitlements.repoll_virt_guest_entitlements(1000020472); repoll_virt_guest_entitlements -------------------------------- (1 row) Version-Release number of selected component (if applicable): spacewalk-java-2.3.8-100.el6sat.noarch Actual results: SQL throws the error and traceback error Expected results: It should work as expected or the SQL should not consider the virt/virt-platforom since its deprecated
spacewalk.github commit a98940c4bb9c2eea387b8c16371133eb7d7787a4
spacewalk.github commit a334c750612aa5c3cf0c16a21a9233f1a188cb85
Spacewalk 2.4 has been released.