Bug 1132868 - spacewalk-export tracebacks with psycopg2.ProgrammingError when processing system-profiles
Summary: spacewalk-export tracebacks with psycopg2.ProgrammingError when processing sy...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 560
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks: stargate-GA-tracker 1133555
TreeView+ depends on / blocked
 
Reported: 2014-08-22 08:18 UTC by Lukas Pramuk
Modified: 2014-10-01 12:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1133555 (view as bug list)
Environment:
Last Closed: 2014-10-01 12:27:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lukas Pramuk 2014-08-22 08:18:14 UTC
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

Comment 1 RHEL Program Management 2014-08-22 08:33:15 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 3 Tomas Lestach 2014-08-22 09:53:07 UTC
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 ...

Comment 4 Grant Gainey 2014-08-25 11:48:46 UTC
Moving to correct component

Comment 5 Tomas Lestach 2014-08-25 12:52:11 UTC
Implementing a workaround for reporting/transitions to avoid failures ...

spacewalk.git: 14859c2162ac3c8dfd33ddc842d424162df87566

Comment 6 Lukas Pramuk 2014-08-25 13:32:09 UTC
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>
...

Comment 9 Grant Gainey 2014-10-01 12:27:17 UTC
Released as part of Sat 6.0 GA


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