Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1447698

Summary: channel-families with zero quantity are available to use, but causes traceback during registration
Product: Red Hat Satellite 5 Reporter: Pavel Studeník <pstudeni>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: agurenko, ggainey, pstudeni, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-15 12:25:11 UTC Type: Bug
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: 1450940    

Description Pavel Studeník 2017-05-03 14:09:24 UTC
Description of problem:
User used manifest that contains available channels (cdn repositories), but this channels are without subscriptions:

  <rhn-cert-field name="channel-families" quantity="0" flex="0" family="rhceph-mon"/>
  <rhn-cert-field name="channel-families" quantity="0" flex="0" family="rhceph-osd"/>
 
The channels are possible to synced. Admin can see the channels in profile, but it problem to use it.

On webui I receive following msg when I try to subscribe it

"Note: Some channel subscriptions could not be updated because there were no available subscriptions."

but when I add the channels to activation key and I try to use for registration I receive Internal Server Error:


Version-Release number of selected component (if applicable):
spacewalk-backend-xmlrpc-2.5.3-112.el6sat.noarch

How reproducible:
always

Steps to Reproduce:
1. sync channel for which doesn't exist subscriptions
2. create activation key with the channel
3. register satellite with the activation key

Actual results:
>> rhnreg_ks  --activationkey=1-test  --force
Error communicating with server. The message was:
Internal Server Error

>> tail /var/log/up2date 
up2date A protocol error occurred: Internal Server Error , attempt #1,

Expected results:
Channel is not available for using without subscription. Same behaviour as in created organization.

Additional info:

Traceback in httpd:
...
[Wed May 03 09:47:20 2017] [error] Exception Handler Information
[Wed May 03 09:47:20 2017] [error] Traceback (most recent call last):
[Wed May 03 09:47:20 2017] [error]   File "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", line 135, in call_function
[Wed May 03 09:47:20 2017] [error]     response = func(*params)
[Wed May 03 09:47:20 2017] [error]   File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 521, in new_system
[Wed May 03 09:47:20 2017] [error]     architecture, data)
[Wed May 03 09:47:20 2017] [error]   File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 428, in create_system
[Wed May 03 09:47:20 2017] [error]     newserv.use_token()
[Wed May 03 09:47:20 2017] [error]   File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py", line 351, in use_token
[Wed May 03 09:47:20 2017] [error]     tokens_obj, self.virt_type)
[Wed May 03 09:47:20 2017] [error]   File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_token.py", line 1039, in process_token
[Wed May 03 09:47:20 2017] [error]     history["channels"] = token_channels(server, server_arch, tokens_obj)
[Wed May 03 09:47:20 2017] [error]   File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_token.py", line 170, in token_channels
[Wed May 03 09:47:20 2017] [error]     update_family_counts(famid, server['org_id'])
[Wed May 03 09:47:20 2017] [error]   File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 116, in __call__
[Wed May 03 09:47:20 2017] [error]     result = Function.__call__(self, *args)
[Wed May 03 09:47:20 2017] [error]   File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 92, in __call__
[Wed May 03 09:47:20 2017] [error]     raise sql_base.SQLSchemaError(error_code, e.pgerror, e)
[Wed May 03 09:47:20 2017] [error] 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',))

Comment 1 Tomáš Kašpárek 2017-05-03 14:21:31 UTC
Pavel, by any chance do you know whether this happens on beta as well?

Comment 3 Grant Gainey 2017-05-03 15:53:17 UTC
The activation-key piece here is not a bug. Trying to activate against a channel you don't have available entitlements to, is refused.

The question is, why is this family in the manifest in the first place, if the quantity is zero? The implication is that either they were allowed to create a manifest with a SKU with quantity 'zero', *or* there is a SKU that 'knows about' ceph-monitoring, but doesn't actually let you use it. The first would be an error in the manifest-generation tooling, the second, a SKU error.