Description of problem: spacewalk-export tracebacks with psycopg2.ProgrammingError when processing system-profiles Version-Release number of selected component (if applicable): spacewalk-reports-2.3.3-1 How reproducible: 100% with my data (sputnik dump) Steps to Reproduce: 1a. # spacewalk-export ... INFO: Processing system-profiles... Traceback (most recent call last): File "/usr/bin/spacewalk-report", line 215, in <module> h.execute(**dict(report.params.items() + the_dict_where.items())) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 163, in execute return apply(self._execute_wrapper, (self._execute, ) + p, kw) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 273, in _execute_wrapper retval = apply(function, p, kw) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 217, in _execute return self._execute_(args, kwargs) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 287, in _execute_ self._real_cursor.execute(self.sql, params) psycopg2.ProgrammingError: more than one row returned by a subquery used as an expression - OR - 1b. # spacewalk-report system-profiles Traceback (most recent call last): File "/usr/bin/spacewalk-report", line 215, in <module> h.execute(**dict(report.params.items() + the_dict_where.items())) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 163, in execute return apply(self._execute_wrapper, (self._execute, ) + p, kw) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 273, in _execute_wrapper retval = apply(function, p, kw) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py", line 217, in _execute return self._execute_(args, kwargs) File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 287, in _execute_ self._real_cursor.execute(self.sql, params) psycopg2.ProgrammingError: more than one row returned by a subquery used as an expression Actual results: traceback, system-profiles.csv has zero filesize Expected results: no traceback, system-profiles.csv has sane content
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.
What I see on the provided reproducer machine is strange: rhnschema=# select id,host_system_id,virtual_system_id,uuid from rhnVirtualInstance where host_system_id = 1000166496 or virtual_system_id = 1000166496; id | host_system_id | virtual_system_id | uuid --------+----------------+-------------------+---------------------------------- 102072 | | 1000166496 | e863b67692b9404688e5f615773097ed 102075 | 1000166496 | | 102076 | 1000166496 | | 3c858911c0697ea694a03cfee6c814c2 102077 | 1000166496 | | ab5cd1f44a2b6632e6ea863b946df90a (4 rows) 2 uuids for a one host_system_id ...
Moving to correct component
Implementing a workaround for reporting/transitions to avoid failures ... spacewalk.git: 14859c2162ac3c8dfd33ddc842d424162df87566
VERIFIED. spacewalk-reports-2.3.4-1.el6.noarch.rpm # spacewalk-report system-profiles ... <sane-data> ... # spacewalk-export --entities=system-profiles INFO: Processing system-profiles... INFO: Export-file created at /root/spacewalk-export-dir/spacewalk_export.tar.gz # cat /root/spacewalk-export-dir/exports/system-profiles.csv ... <sane-data> ...
Released as part of Sat 6.0 GA