Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1122438 - Syntax Error in SQL-Statement "subscribe_sql" in "rhnChannel.py"
Summary: Syntax Error in SQL-Statement "subscribe_sql" in "rhnChannel.py"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 1126877 (view as bug list)
Depends On:
Blocks: space23
TreeView+ depends on / blocked
 
Reported: 2014-07-23 09:13 UTC by DaniloE
Modified: 2015-04-14 19:04 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-14 19:04:00 UTC
Embargoed:


Attachments (Terms of Use)
syntax error in sql request (473 bytes, patch)
2014-11-18 11:19 UTC, reseau.locreal
no flags Details | Diff

Description DaniloE 2014-07-23 09:13:12 UTC
Description of problem:

There is a Syntax-failure in the SQL-statement _query_parent_channel_subscribed in rhnChannel.py:

select 1
  from rhnChannel c,
       join rhnServerChannel sc on c.parent_channel = sc.channel_id
  where sc.server_id = :sid
    and c.label = :channel

it should be 

select 1
  from rhnChannel c
       join rhnServerChannel sc on c.parent_channel = sc.channel_id
  where sc.server_id = :sid
    and c.label = :channel

The comma is too much. This rises an SQL-Exception.

Version-Release number of selected component (if applicable):

min. 2.2 

How reproducible:

Just one example, how we found the problem, i think, there are more ways to do it.

Steps to Reproduce:
1. try to add a channel via spacewalk-channel -a -c $NAME in a client
2. look in the rhn_server_xmlrpc.log on the server
3. you will see a message like 
"server/apacheRequest.call_function('ERROR', 'rhnSQL.SQLError caught', SQLStatementPrepareError('FEHLER: ... ... "

Actual results:

The client recieves an internal error from the server and nothing happens.

Expected results:

The channel should be added.

Additional info:

nope

Comment 1 Milan Zázrivec 2014-08-05 08:44:51 UTC
spacewalk.git master: 4bf063f97ae66d889236e11ea237dfd785dbce29

Comment 2 Dimitar Yordanov 2014-08-26 12:26:58 UTC
*** Bug 1126877 has been marked as a duplicate of this bug. ***

Comment 3 Johan Tornroos 2014-09-17 11:51:04 UTC
Any progress on this, we also encountered this after upgrade to 2.2.

Comment 4 Dan Creed 2014-11-10 14:38:47 UTC
Come on RedHat.. this bug has been around for almost 4 months... and still no movement... This bug is a major show stopper for the project I am working on.. please give us a workaround or bug fix.

Comment 5 reseau.locreal 2014-11-18 11:19:32 UTC
Created attachment 958521 [details]
syntax error in sql request

Comment 6 reseau.locreal 2014-11-18 11:22:50 UTC
The attachment proposed in comment #5 looks to fix the issue.

Comment 7 Marcin 2015-02-24 16:56:41 UTC
(In reply to Dan Creed from comment #4)
> Come on RedHat.. this bug has been around for almost 4 months... and still
> no movement... This bug is a major show stopper for the project I am working
> on.. please give us a workaround or bug fix.

Dan, I am using workaround with 'spacecmd'

spacecmd {SSM:0}> system_addchildchannels
system_addchildchannels: Add child channels to a system
usage: system_addchildchannels <SYSTEMS> <CHANNEL ...>

Comment 8 Grant Gainey 2015-03-23 16:59:31 UTC
Moving bugs to ON_QA as we move to release Spacewalk 2.3

Comment 9 Grant Gainey 2015-04-14 19:04:00 UTC
Spacewalk 2.3 has been released. See

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes23


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