Bug 674510

Summary: SQLStatementPrepareError: ('syntax error at or near "call" at character 11', 0, 'call rhn_channel.unsubscribe_server... - when deleting channel
Product: [Community] Spacewalk Reporter: Jan Hutař <jhutar>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-1.4.3-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-26 09:10:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 674675    

Description Jan Hutař 2011-02-02 09:21:05 UTC
Description of problem:
When I try to delete channel, I got a traceback.


Version-Release number of selected component (if applicable):
spacewalk-backend-tools-1.3.52-1.el5
spacewalk-postgresql-1.3.3-1.el5


How reproducible:
1 of 1


Steps to Reproduce:
1. Have custom channel with system registered in it
2. Try to delete that channel
   # spacewalk-remove-channel -v -u -c psklenar_test_signed-channel


Actual results:
# spacewalk-remove-channel -v -c psklenar_test_signed-channel

Currently there are systems subscribed to one or more of the specified channels.
If you would like to automatically unsubscribe these systems, simply use the --unsubscribe flag.

The following systems were found to be subscribed:
org_id   id             name
--------------------------------
1        1000010011     automation-hp-nehalem-02.rhts.eng.bos.redhat.com
# spacewalk-remove-channel -v -u -c psklenar_test_signed-channel

The following channels will have their systems unsubscribed:
psklenar_test_signed-channel             1       
                  ________________________________________
Unsubscribing:    
ERROR: unhandled exception occurred: (('syntax error at or near "call" at character 11\n', 0, '\n         call rhn_channel.unsubscribe_server(%(server_id)s, %(channel_id)s)\n    ')).
Traceback (most recent call last):
  File "/usr/bin/spacewalk-remove-channel", line 553, in ?
    sys.exit(main() or 0)
  File "/usr/bin/spacewalk-remove-channel", line 131, in main
    if __serverCheck(channels.keys(), options.unsubscribe):
  File "/usr/bin/spacewalk-remove-channel", line 167, in __serverCheck
    return  __unsubscribeServers(labels)
  File "/usr/bin/spacewalk-remove-channel", line 216, in __unsubscribeServers
    __unbsubscribeServer(i['server_id'], i['channel_id'])
  File "/usr/bin/spacewalk-remove-channel", line 227, in __unbsubscribeServer
    h.execute(server_id=server_id, channel_id=channel_id)
  File "/usr/lib/python2.4/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.4/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 263, in _execute_wrapper
    raise rhnSQL.SQLStatementPrepareError(0, str(e), self.sql)
SQLStatementPrepareError: ('syntax error at or near "call" at character 11\n', 0, '\n         call rhn_channel.unsubscribe_server(%(server_id)s, %(channel_id)s)\n    ')


Expected results:
Should just work

Comment 2 Michael Mráka 2011-02-04 15:38:10 UTC
Fixed by
commit a941d18d25b8748a1f23c9016c5ab26307b10522
    674510 - fixed procedure call (PG)

Comment 3 Miroslav Suchý 2011-04-11 07:45:11 UTC
Mass moving to ON_QA before release of Spacewalk 1.4

Comment 4 Miroslav Suchý 2011-04-26 09:10:38 UTC
Spacewalk 1.4 has been released