Bug 1441135

Summary: client registration Internal Server Error
Product: Red Hat Satellite 5 Reporter: Ales Dujicek <adujicek>
Component: RegistrationAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Radovan Drazny <rdrazny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: dyordano, jhutar, pstudeni, rdrazny, tlestach
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-111-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:18:00 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: 1340444    
Attachments:
Description Flags
httpd error log none

Description Ales Dujicek 2017-04-11 09:50:07 UTC
Created attachment 1270716 [details]
httpd error log

Description of problem:

In a quite specific situation registration of client could fail

# rhnreg_ks --force --serverUrl=https://satellite-fqdn/XMLRPC --sslCACert=/usr/share/rhn/CERT-satellite --activationkey  9-0df21a937eca8263d6434b86a1e2fd6e
rhn-plugin: Error communicating with server. The message was:
Internal Server Error

Server side traceback attached

The conditions are:
 * registration to non-default organization using activation-key
 * client's RHEL version and ARCH are the same as Sat server's
 * client's default RHEL channel is synced no Sat server (--no-everything is good enough)
 * non-default organization has no software entitlements for client's default RHEL channel


If you add software entitlements to organization, then the registration succeeds and client's system event history contains:
Type	Status	Summary	Time
	(n/a) 	Subscription via Token 	Tue Apr 11 05:08:33 EDT 2017
	(n/a) 	added system entitlement 	Tue Apr 11 05:08:33 EDT 2017
	(n/a) 	subscribed to channel channel-reg-test-channel-x86_64-label 	Tue Apr 11 05:08:33 EDT 2017
	(n/a) 	unsubscribed from channel rhel-x86_64-server-6 	Tue Apr 11 05:08:33 EDT 2017
	(n/a) 	subscribed to channel rhel-x86_64-server-6 	Tue Apr 11 05:08:33 EDT 2017 

So it is registered to RHEL channel first and then switched to custom channel.



Version-Release number of selected component (if applicable):
spacewalk-java-2.5.14-70.el6sat.noarch
spacewalk-backend-2.5.3-105.el6sat.noarch
satellite-schema-5.8.0.25-1.el6sat.noarch

How reproducible:
always

Steps to Reproduce:
1. register client to custom organization using activation key - see above

Actual results:
Internal Server Error

Expected results:
registration succeeds

Additional info:
could not reproduce on 5.7

Comment 1 Tomáš Kašpárek 2017-04-20 10:00:49 UTC
spacewalk.git(master): b2e475fa333c309ef2f476fb38992ab897567668

caused by fix in BZ#1434471
in spacewalk.git(master): a3fab8dc969acea2a3c077b2e2e9a83d0bce8907

Comment 4 Radovan Drazny 2017-05-17 10:02:41 UTC
Verified on
spacewalk-backend-2.5.3-131.el6sat.noarch
satellite-schema-5.8.0.31-1.el6sat.noarch
spacewalk-java-2.5.14-84.el6sat.noarch

on both PG and Oracle backends using the reproducer from the initial report. Sample output from system's history:

 	(n/a) 	Subscription via Token 	Wed May 17 05:07:34 EDT 2017
	(n/a) 	added system entitlement 	Wed May 17 05:07:34 EDT 2017
	(n/a) 	subscribed to channel channel-reg-test-channel-x86_64 	Wed May 17 05:07:34 EDT 2017 

Registration to a custom channel was successful, even with no sw entitlements assigned to the non-default org.

VERIFIED