Bug 811646 - Cannot register KVM guest on host with rhn-virtualization-host installed with postgresql backend
Cannot register KVM guest on host with rhn-virtualization-host installed with...
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Server (Show other bugs)
1.7
x86_64 Linux
urgent Severity unspecified
: ---
: ---
Assigned To: Michael Mráka
Red Hat Satellite QA List
:
Depends On:
Blocks: 820854 space18
  Show dependency treegraph
 
Reported: 2012-04-11 11:34 EDT by James Hogarth
Modified: 2012-11-01 12:18 EDT (History)
8 users (show)

See Also:
Fixed In Version: spacewalk-backend-1.8.37-1 spacewalk-schema-1.8.19-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 820060 820854 (view as bug list)
Environment:
Last Closed: 2012-11-01 12:18:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Tomcat log (371.23 KB, text/plain)
2012-04-11 11:34 EDT, James Hogarth
no flags Details
Postgresql log (30.03 KB, text/plain)
2012-04-11 11:34 EDT, James Hogarth
no flags Details
Fix to 'unknown column free_slots' postgresql bug (885 bytes, patch)
2012-04-12 05:34 EDT, James Hogarth
no flags Details | Diff
Schema upgrade script .... I think this should work but needs to be verified. (10.60 KB, text/plain)
2012-04-12 05:41 EDT, James Hogarth
no flags Details
Traceback when registering KVM box (24.71 KB, text/plain)
2012-04-13 13:53 EDT, Marcelo Moreira de Mello
no flags Details
free_slots fix (1.86 KB, patch)
2012-04-19 09:53 EDT, Michael Mráka
no flags Details | Diff

  None (edit)
Description James Hogarth 2012-04-11 11:34:02 EDT
Created attachment 576812 [details]
Tomcat log

Description of problem:
When attempting to register a KVM guest on a KVM host that is registered with the spacewalk server and has the rhn-virtualization-host package installed (so the database would have virtualization details) with a postgresql 8.4 backend - fresh install of spacewalk not an upgrade - rhnreg_ks reports a server error. 

Upon investigating the 'invalid entitlements' error in the logs is a bit of a red herring... teh actual cause is this SQL exception:
ERROR:  column "free_slots" does not exist at character 295
QUERY:  UPDATE rhnServerChannel sc set is_fve = 'Y' where sc.server_id in ( select vi.virtual_system_id from rhnServerFveCapable sfc inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where vi.host_system_id =  $1  and sfc.channel_family_id =  $2  order by vi.modified desc limit free_slots )
CONTEXT:  PL/pgSQL function "repoll_virt_guest_entitlements" line 96 at SQL statement
STATEMENT:  SELECT rhn_entitlements.repoll_virt_guest_entitlements(1000010023)


Version-Release number of selected component (if applicable):
Spacewalk 1.7 with postgresql 8.4 backend on centos 6.2

How reproducible:
Every time

Steps to Reproduce:
1. Install a CentOS host with the rhn-virtualization-host package - the Virtualization Platform entitlement is optional.
2. Kickstart or otherwise create a KVM guest on this system so that a registration with spacewalk is attempted to be carried out.
3. Watch the registration failure, the exception in catalina.out and the error in the postgresql log.
4. Remove the rhn-virtualization-host package and rhn-profile-sync on the host to remove the relevant virtualization information in the database.
5. Reattempt the registration of the guest - this time it will work.
  
Actual results:
Guest registers against the spacewalk server and appears as a guest on the host on the virtualization tab.

Expected results:
Registration experiences an exception being raised and the guest cannot register against the spacewalk server.
Comment 1 James Hogarth 2012-04-11 11:34:33 EDT
Created attachment 576813 [details]
Postgresql log
Comment 2 James Hogarth 2012-04-11 12:21:00 EDT
Looks like the entitlements functionality was first added in 1.6 for postgresql - checking the schema updates....

It would appear that on oracle free_slots is calculated on the fly via:
select rownum, vi.virtual_system_id,  sfc.max_members - sfc.current_members as free_slots
And this doesn't happen on postgresql so it refers to an invalid column...

Oracle:
-- and set each of the flex eligible guests to Y
                UPDATE rhnServerChannel sc set sc.is_fve = 'Y'
                where sc.server_id in (
                       select virtual_system_id from (
                            select rownum, vi.virtual_system_id,  sfc.max_members - sfc.current_members as free_slots
                            from rhnServerFveCapable sfc
                                inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id
                            where vi.host_system_id = server_id_in
                                  and sfc.channel_family_id = family.channel_family_id
                              order by vi.modified desc
                          )
                        where rownum <=  free_slots
                );

Postgres:
-- and set each of the flex eligible guests to Y
                UPDATE rhnServerChannel sc set is_fve = 'Y'
                where sc.server_id in (
                            select vi.virtual_system_id
                            from rhnServerFveCapable sfc
                                inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id
                            where vi.host_system_id = server_id_in
                                  and sfc.channel_family_id = family.channel_family_id
                              order by vi.modified desc
                            limit free_slots
                );

max_members and current_members exist in the postgres table for rhnServerFveCapable ... is the alias just missing perhaps?

going to snapshot my spacewalk database and change the function to see the behaviour....
Comment 3 James Hogarth 2012-04-12 05:34:29 EDT
Created attachment 577018 [details]
Fix to 'unknown column free_slots' postgresql bug
Comment 4 James Hogarth 2012-04-12 05:34:54 EDT
Looks like this goes into deeper areas than I originally anticipated....

Attached is a fixed function for postgres so that the unknown free_slots column issue is cleared up - but it doesn't allow the guest to register still....

Unfortunately I don't have a RHEL system to verify this against - much less flex entitlements on top of that - but in principle I think the core issue should affect any rhel based system - including fedora.

What I think is happening is as follows....

During registration rhn_entitlements.entitle_server is called with the server_id as an argument.

We then get this block of code:
select 1 into is_virt
        from rhnServerEntitlementView
        where server_id = server_id_in
          and label in ('virtualization_host', 'virtualization_host_platform');

      if not found then
          is_virt := 0;
      end if;
      
      if is_virt = 0 and (type_label_in = 'virtualization_host' or
                          type_label_in = 'virtualization_host_platform') then

        is_virt := 1;
      end if;

      if rhn_entitlements.can_entitle_server(server_id_in, 
                                             type_label_in)

This appears to check if the registering server already has a virtualization entitlement (of either sort) - so this would only be in the case of re-registration - or if the registering system has a virtualization label it is attempting to register....

If this is false (in the case of a virtual guest) it then calls can_entitle_server to see if an entitlement should be permitted.

Eventually following through the various paths we appear to reach a call to 

base_channel_rel_archid

This looks at the table rhnDistChannelMap - which is empty for custom channels.....

Consequently this SQL returns null and the registering guest is declared not to have a valid entitlement so it cannot register:
 select ca.label arch,
	               c.id,
	               c.parent_channel,
	               c.org_id,
	               c.label,
	               c.name,
	               c.summary,
	               c.description,
	               to_char(c.last_modified, 'YYYYMMDDHH24MISS') last_modified,
	               rhn_channel.available_chan_subscriptions(c.id, E'1') available_subscriptions
	          from rhnChannel c,
	               rhnChannelArch ca
	        where c.channel_arch_id = ca.id
	          and c.id = rhn_channel.base_channel_for_release_arch(
	                E'6', E'x86_64', E'1', 1)

I'm not entirely sure at this point how this exactly ties into the rhn-virtualization-host package being present.... could do with some help there frankly....
Comment 5 James Hogarth 2012-04-12 05:41:11 EDT
Created attachment 577020 [details]
Schema upgrade script .... I think this should work but needs to be verified.
Comment 6 Jan Pazdziora 2012-04-12 07:48:34 EDT
Wouldn't just replacing

   limit free_slots

with

   limit sfc.max_members - sfc.current_members

work?
Comment 7 James Hogarth 2012-04-12 08:13:39 EDT
nope....


ERROR:  argument of LIMIT must not contain variables at character 295
QUERY:  UPDATE rhnServerChannel sc set is_fve = 'Y' where sc.server_id in (
select vi.virtual_system_id from rhnServerFveCapable sfc inner join
rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where
vi.host_system_id =  $1  and sfc.channel_family_id =  $2  order by vi.modified
desc limit sfc.max_members - sfc.current_members )
CONTEXT:  PL/pgSQL function "repoll_virt_guest_entitlements" line 96 at SQL
statement


looks like it has to be a single value by that point .... or at least another
subselect after the limit doesn't work either it would appear... get this if
you try that way:


ERROR:  more than one row returned by a subquery used as an expression
CONTEXT:  SQL statement "UPDATE rhnServerChannel sc set is_fve = 'Y' where
sc.server_id in ( select vi.virtual_system_id from rhnServerFveCapable sfc
inner join rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where
vi.host_system_id =  $1  and sfc.channel_family_id =  $2  order by vi.modified
desc limit (select sfc.max_members - sfc.current_members from
rhnServerFveCapable sfc) )"
 PL/pgSQL function "repoll_virt_guest_entitlements" line 96 at SQL statement
 SQL statement "SELECT  rhn_entitlements.repoll_virt_guest_entitlements( $1 )"
 PL/pgSQL function "remove_server_entitlement" line 60 at PERFORM
STATEMENT:  select * from rhn_entitlements.remove_server_entitlement($1, $2,
$3) as result
Comment 8 Marcelo Moreira de Mello 2012-04-13 13:53:51 EDT
Created attachment 577396 [details]
Traceback when registering KVM box


  Hello, 

    I'm trying to register a KVM box running CentOS6.2 + PostgreSQL 8.4, although I'm hitting a different error. 


==> /var/log/rhn/rhn_server_xmlrpc.log <==
2012/04/13 14:31:06 -02:00 29703 192.168.89.101: xmlrpc/registration.welcome_message('lang: None',)
2012/04/13 14:31:20 -02:00 29823 192.168.89.101: xmlrpc/registration.reserve_user('mmello',)
2012/04/13 14:31:35 -02:00 22073 192.168.89.101: xmlrpc/registration.create_system("username = 'mmello'", '6', 'x86_64')
2012/04/13 14:31:35 -02:00 22073 192.168.89.101: server/rhnVirtualization.guest_registered('ERROR', 'Error adding entitlement provisioning_entitled: (20287, \'ERROR:  -20287 : (invalid_entitlement) - The server can not be entitled to the specified level\\nCONTEXT:  SQL statement "SELECT  rhn_exception.raise_exception (\\\'invalid_entitlement\\\')"\\nPL/pgSQL function "entitle_server" line 49 at PERFORM\\n\', InternalError(\'-20287 : (invalid_entitlement) - The server can not be entitled to the specified level\\nCONTEXT:  SQL statement "SELECT  rhn_exception.raise_exception (\\\'invalid_entitlement\\\')"\\nPL/pgSQL function "entitle_server" line 49 at PERFORM\\n\',))')


Server Side:
spacewalk-backend-sql-postgresql-1.7.38-1.el6.noarch
spacewalk-java-postgresql-1.7.54-1.el6.noarch
spacewalk-postgresql-1.7.3-1.el6.noarch

Client Side have Spacewalk 1.7 packages
Comment 9 Marcelo Moreira de Mello 2012-04-13 13:55:46 EDT
 Just to complete, even deleting the rhn-host-virtualization the issue persist.
Comment 10 Marcelo Moreira de Mello 2012-04-13 14:04:09 EDT
(In reply to comment #9)
>  Just to complete, even deleting the rhn-host-virtualization the issue persist.

After removing the rhn-host-virtualzation and registering again the hypervisor, I was able to register the box.
Comment 11 Michael Mráka 2012-04-19 09:53:52 EDT
Created attachment 578655 [details]
free_slots fix

(In reply to comment #3)
> Created attachment 577018 [details]
> Fix to 'unknown column free_slots' postgresql bug

The patch above is not correct, free_slots assignment have to be done inside family loop.

Could you test this patch?
Comment 12 Marcelo Moreira de Mello 2012-04-19 13:56:42 EDT
  Applying the patch....

# psql -U spacedbuser spaceschema_DB < rhn_entitlements.pkb
Password for user spacedbuser: 
           set_config            
---------------------------------
 rhn_entitlements,"$user",public
(1 row)

UPDATE 0
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
   set_config   
----------------
 "$user",public
(1 row)

UPDATE 0

   Afterwards, installing rhn-virtualization-host on the hypervisor and then kickstart the box. 

   Unfortunetally, still hitting an issue: 
   
2012/04/19 14:20:47 -02:00 9951 192.168.89.126: server/rhnVirtualization.guest_registered('ERROR', 'Error adding entitlement monitoring_entitled: (20287, \'ERROR:  -20287 : (invalid_entitlement) - The server can not be entitled to the specified level\\nCONTEXT:  SQL statement "SELECT  rhn_exception.raise_exception (\\\'invalid_entitlement\\\')"\\nPL/pgSQL function "entitle_server" line 49 at PERFORM\\n\', InternalError(\'-20287 : (invalid_entitlement) - The server can not be entitled to the specified level\\nCONTEXT:  SQL statement "SELECT  rhn_exception.raise_exception (\\\'invalid_entitlement\\\')"\\nPL/pgSQL function "entitle_server" line 49 at PERFORM\\n\',))')

   
   
  Traceback:

Exception reported from spacewalk.example.com.br
Time: Thu Apr 19 14:20:47 2012
Exception type <class 'psycopg2.InternalError'>
Exception while handling function registration.new_system
Request object information:
URI: /XMLRPC
Remote Host: 192.168.89.126
Server Name: spacewalk.example.com.br:443
Headers passed in:
	Accept-Encoding: identity
	CONTENT_LENGTH: 1553
	CONTENT_TYPE: text/xml
	DOCUMENT_ROOT: /var/www/html
	GATEWAY_INTERFACE: CGI/1.1
	HTTPS: 1
	HTTP_ACCEPT_ENCODING: identity
	HTTP_HOST: spacewalk.example.com.br
	HTTP_USER_AGENT: rhn.rpclib.py/$Revision$
	HTTP_X_CLIENT_VERSION: 1
	HTTP_X_INFO: RPC Processor (C) Red Hat, Inc (version $Revision$)
	HTTP_X_RHN_CLIENT_CAPABILITY: osad.ping(1)=1,caneatCheese(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1
	HTTP_X_RHN_TRANSPORT_CAPABILITY: follow-redirects=3
	HTTP_X_TRANSPORT_INFO: Extended Capabilities Transport (C) Red Hat, Inc (version $Revision$)
	HTTP_X_UP2DATE_VERSION: 1.7.14-1.el6
	Host: spacewalk.example.com.br
	PATH_INFO: 
	QUERY_STRING: 
	REMOTE_ADDR: 192.168.89.126
	REMOTE_PORT: 45387
	REQUEST_METHOD: POST
	REQUEST_URI: /XMLRPC
	SCRIPT_FILENAME: /usr/share/rhn/wsgi/xmlrpc.py
	SCRIPT_NAME: /XMLRPC
	SCRIPT_URI: https://spacewalk.example.com.br/XMLRPC
	SCRIPT_URL: /XMLRPC
	SERVER_ADDR: 192.168.89.1
	SERVER_ADMIN: root@localhost
	SERVER_NAME: spacewalk.example.com.br
	SERVER_PORT: 443
	SERVER_PROTOCOL: HTTP/1.1
	SERVER_SIGNATURE: <address>Apache Server at spacewalk.example.com.br Port 443</address>

	SERVER_SOFTWARE: Apache
	User-Agent: rhn.rpclib.py/$Revision$
	X-Client-Version: 1
	X-Info: RPC Processor (C) Red Hat, Inc (version $Revision$)
	X-RHN-Client-Capability: osad.ping(1)=1,caneatCheese(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1
	X-RHN-Transport-Capability: follow-redirects=3
	X-Transport-Info: Extended Capabilities Transport (C) Red Hat, Inc (version $Revision$)
	X-Up2Date-Version: 1.7.14-1.el6
	mod_wsgi.application_group: spacewalk.example.com.br|/xmlrpc
	mod_wsgi.callable_object: application
	mod_wsgi.handler_script: 
	mod_wsgi.input_chunked: 0
	mod_wsgi.listener_host: 
	mod_wsgi.listener_port: 443
	mod_wsgi.process_group: 
	mod_wsgi.request_handler: wsgi-script
	mod_wsgi.script_reloading: 1
	mod_wsgi.version: (3, 2)
	wsgi.errors: <mod_wsgi.Log object at 0x7f9042287cf0>
	wsgi.file_wrapper: <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f90415e5738>
	wsgi.input: <mod_wsgi.Input object at 0x7f9042287b70>
	wsgi.multiprocess: True
	wsgi.multithread: False
	wsgi.run_once: False
	wsgi.url_scheme: https
	wsgi.version: (1, 1)

Exception Handler Information
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", line 122, in call_function
    response = apply(func, params)
  File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 502, in new_system
    architecture, data)
  File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 390, in create_system
    newserv.save(0, channel)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py", line 570, in save
    self.__save(channel)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py", line 538, in __save
    user_id=user_id)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 1741, in subscribe_server_channels
    raise_exceptions=1)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 1700, in guess_channels_for_server
    server.org_id, user_id=user_id)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 900, in channels_for_release_arch
    org_id=org_id, user_id=user_id)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 723, in base_channel_for_rel_arch
    org_id=org_id, user_id=user_id)
  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 282, 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 295, in _execute_
    self._real_cursor.execute(self.sql, params)
InternalError: current transaction is aborted, commands ignored until end of transaction block


Local variables by frame
Frame _execute_ in /usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py at line 295
	                self = <type 'instance'> <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042289710>
	                args = <type 'tuple'> ()
	              params = <type 'instance'> {'release': '6', 'org_id': '1', 'user_id': 1, 'server_arch': 'x86_64'}
	              kwargs = <type 'dict'> {'release': '6', 'user_id': 1, 'org_id': '1', 'server_arch': 'x86_64'}

Frame _execute in /usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py at line 217
	                self = <type 'instance'> <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042289710>
	                args = <type 'tuple'> ()
	                 val = <type 'str'> 6
	              kwargs = <type 'dict'> {'release': '6', 'user_id': 1, 'org_id': '1', 'server_arch': 'x86_64'}

Frame _execute_wrapper in /usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py at line 287
	            function = <type 'instancemethod'> <bound method Cursor._execute of <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042289710>>
	                self = <type 'instance'> <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042289710>
	               value = <type 'str'> x86_64
	                   p = <type 'tuple'> ()
	                  kw = <type 'dict'> {'release': '6', 'org_id': '1', 'user_id': 1, 'server_arch': 'x86_64'}
	                 key = <type 'str'> server_arch
	              params = <type 'str'> release: 6,org_id: 1,user_id: 1,server_arch: x86_64

Frame execute in /usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/sql_base.py at line 163
	                   p = <type 'tuple'> ()
	                self = <type 'instance'> <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042289710>
	                  kw = <type 'dict'> {'release': '6', 'user_id': 1, 'org_id': '1', 'server_arch': 'x86_64'}

Frame base_channel_for_rel_arch in /usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py at line 735
	             user_id = <type 'int'> 1
	                   h = <type 'instance'> <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042289710>
	              org_id = <type 'str'> 1
	         server_arch = <type 'str'> x86_64
	             release = <type 'str'> 6
	               query = <type 'str'> 
        select ca.label arch,
               c.id,
               c.parent_channel,
               c.org_id,
               c.label,
               c.name,
               c.summary,
               c.description,
               to_char(c.last_modified, 'YYYYMMDDHH24MISS') last_modified,
               rhn_channel.available_chan_subscriptions(c.id, :org_id) available_subscriptions
          from rhnChannel c,
               rhnChannelArch ca
        where c.channel_arch_id = ca.id
          and c.id = rhn_channel.base_channel_for_release_arch(
                :release, :server_arch, :org_id, :user_id)
    

Frame channels_for_release_arch in /usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py at line 900
	             release = <type 'str'> 6
	              org_id = <type 'str'> 1
	             user_id = <type 'int'> 1
	         server_arch = <type 'str'> x86_64

Frame guess_channels_for_server in /usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py at line 1728
	             user_id = <type 'int'> 1
	             none_ok = <type 'instance'> <spacewalk.server.rhnServer.server_token.ActivationTokens instance at 0x7f9042289170>
	    raise_exceptions = <type 'int'> 1
	              server = <type 'instance'> <LiteServer instance at 140257562061856: attributes={'release': '6', 'arch': 'x86_64', 'org_id': 1, 'id': 1000010031}>

Frame subscribe_server_channels in /usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py at line 1741
	             user_id = <type 'int'> 1
	                   s = <type 'instance'> <LiteServer instance at 140257562061856: attributes={'release': '6', 'arch': 'x86_64', 'org_id': 1, 'id': 1000010031}>
	             none_ok = <type 'instance'> <spacewalk.server.rhnServer.server_token.ActivationTokens instance at 0x7f9042289170>
	              server = <class 'spacewalk.server.rhnServer.server_class.Server'> <Server Class at 140257561966928: {'self.cert': None, 'self.server': {'description': ('Initial Registration Parameters:\nOS: centos-release\nRelease: 6\nCPU Arch: x86_64', 1), 'auto_update': ('N', 1), 'secret': ('7c717b68e22d28933860c875ff998f6f', 1), 'org_id': (1, 1), 'creator_id': (1, 1), 'server_arch_id': (1023, 1), 'digital_server_id': ('ID-1000010031', 1), 'release': ('6', 1), 'auto_deliver': ('N', 1), 'os': ('centos-release', 1), 'id': (1000010031, 0), 'name': ('localhost.localdomain', 1)}}>


Frame __save in /usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py at line 538
	           server_id = <type 'int'> 1000010031
	             user_id = <type 'int'> 1
	                self = <class 'spacewalk.server.rhnServer.server_class.Server'> <Server Class at 140257561966928: {'self.cert': None, 'self.server': {'description': ('Initial Registration Parameters:\nOS: centos-release\nRelease: 6\nCPU Arch: x86_64', 1), 'auto_update': ('N', 1), 'secret': ('7c717b68e22d28933860c875ff998f6f', 1), 'org_id': (1, 1), 'creator_id': (1, 1), 'server_arch_id': (1023, 1), 'digital_server_id': ('ID-1000010031', 1), 'release': ('6', 1), 'auto_deliver': ('N', 1), 'os': ('centos-release', 1), 'id': (1000010031, 0), 'name': ('localhost.localdomain', 1)}}>

	              org_id = <type 'int'> 1
	      have_reg_token = <type 'instance'> <spacewalk.server.rhnServer.server_token.ActivationTokens instance at 0x7f9042289170>
	             channel = <type 'NoneType'> None

Frame save in /usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py at line 574
	              commit = <type 'int'> 0
	                self = <class 'spacewalk.server.rhnServer.server_class.Server'> <Server Class at 140257561966928: {'self.cert': None, 'self.server': {'description': ('Initial Registration Parameters:\nOS: centos-release\nRelease: 6\nCPU Arch: x86_64', 1), 'auto_update': ('N', 1), 'secret': ('7c717b68e22d28933860c875ff998f6f', 1), 'org_id': (1, 1), 'creator_id': (1, 1), 'server_arch_id': (1023, 1), 'digital_server_id': ('ID-1000010031', 1), 'release': ('6', 1), 'auto_deliver': ('N', 1), 'os': ('centos-release', 1), 'id': (1000010031, 0), 'name': ('localhost.localdomain', 1)}}>

	             channel = <type 'NoneType'> None

Frame create_system in /usr/share/rhn/server/handlers/xmlrpc/registration.py at line 397
	     release_version = <type 'str'> 6
	                user = <type 'NoneType'> None
	            log_item = <type 'str'> token = '1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key'
	                self = <type 'instance'> <server.handlers.xmlrpc.registration.Registration instance at 0x7f9042284098>
	         applet_uuid = <type 'NoneType'> None
	        profile_name = <type 'str'> localhost.localdomain
	             channel = <type 'NoneType'> None
	             release = <type 'str'> 6
	        token_string = <type 'str'> 1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key
	        up2date_uuid = <type 'NoneType'> None
	                data = <type 'dict'> {'token': '1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key', 'profile_name': 'localhost.localdomain', 'architecture': 'x86_64', 'os_release': '6', 'smbios': {'smbios.system.serial': 'Not Specified', 'smbios.system.product': 'KVM', 'smbios.system.family': 'Red Hat Enterprise Linux', 'smbios.bios.vendor': 'Seabios', 'smbios.system.manufacturer': 'Red Hat', 'smbios.system.skunumber': 'Not Specified', 'smbios.system.version': 'RHEL 6.2.0 PC', 'smbios.system.uuid': '64b92fb1-c2d5-cdf0-5a82-ea74537611a0'}, 'release_name': 'centos-release'}
	             newserv = <class 'spacewalk.server.rhnServer.server_class.Server'> <Server Class at 140257561966928: {'self.cert': None, 'self.server': {'description': ('Initial Registration Parameters:\nOS: centos-release\nRelease: 6\nCPU Arch: x86_64', 1), 'auto_update': ('N', 1), 'secret': ('7c717b68e22d28933860c875ff998f6f', 1), 'org_id': (1, 1), 'creator_id': (1, 1), 'server_arch_id': (1023, 1), 'digital_server_id': ('ID-1000010031', 1), 'release': ('6', 1), 'auto_deliver': ('N', 1), 'os': ('centos-release', 1), 'id': (1000010031, 0), 'name': ('localhost.localdomain', 1)}}>

	          tokens_obj = <type 'instance'> <spacewalk.server.rhnServer.server_token.ActivationTokens instance at 0x7f9042289170>
	        architecture = <type 'str'> x86_64

Frame new_system in /usr/share/rhn/server/handlers/xmlrpc/registration.py at line 502
	                self = <type 'instance'> <server.handlers.xmlrpc.registration.Registration instance at 0x7f9042284098>
	     release_version = <type 'str'> 6
	        profile_name = <type 'str'> localhost.localdomain
	        architecture = <type 'str'> x86_64
	                data = <type 'dict'> {'token': '1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key', 'profile_name': 'localhost.localdomain', 'architecture': 'x86_64', 'os_release': '6', 'smbios': {'smbios.system.serial': 'Not Specified', 'smbios.system.product': 'KVM', 'smbios.system.family': 'Red Hat Enterprise Linux', 'smbios.bios.vendor': 'Seabios', 'smbios.system.manufacturer': 'Red Hat', 'smbios.system.skunumber': 'Not Specified', 'smbios.system.version': 'RHEL 6.2.0 PC', 'smbios.system.uuid': '64b92fb1-c2d5-cdf0-5a82-ea74537611a0'}, 'release_name': 'centos-release'}
	                user = <type 'NoneType'> None

Frame call_function in /usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py at line 174
	                self = <type 'instance'> <spacewalk.server.apacheRequest.apachePOST instance at 0x7f9042284dd0>
	              params = <type 'tuple'> ({'token': '1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key', 'profile_name': 'localhost.localdomain', 'architecture': 'x86_64', 'os_release': '6', 'smbios': {'smbios.system.serial': 'Not Specified', 'smbios.system.product': 'KVM', 'smbios.system.family': 'Red Hat Enterprise Linux', 'smbios.bios.vendor': 'Seabios', 'smbios.system.manufacturer': 'Red Hat', 'smbios.system.skunumber': 'Not Specified', 'smbios.system.version': 'RHEL 6.2.0 PC', 'smbios.system.uuid': '64b92fb1-c2d5-cdf0-5a82-ea74537611a0'}, 'release_name': 'centos-release'},)
	      force_rollback = <type 'int'> 1
	                func = <type 'instancemethod'> <bound method Registration.new_system of <server.handlers.xmlrpc.registration.Registration instance at 0x7f9042284098>>
	              method = <type 'unicode'> registration.new_system

Frame process in /usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py at line 476
	                  fd = <type 'instance'> <cStringIO.StringO object at 0x7f904224fd18>
	               _body = <type 'str'> <?xml version='1.0'?>
<methodCall>
<methodName>registration.new_system</methodName>
<params>
<param>
<value><struct>
<member>
<name>token</name>
<value><string>1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key</string></value>
</member>
<member>
<name>profile_name</name>
<value><string>localhost.localdomain</string></value>
</member>
<member>
<name>architecture</name>
<value><string>x86_64</string></value>
</member>
<member>
<name>os_release</name>
<value><string>6</string></value>
</member>
<member>
<name>smbios</name>
<value><struct>
<member>
<name>smbios.system.serial</name>
<value><string>Not Specified</string></value>
</member>
<member>
<name>smbios.system.product</name>
<value><string>KVM</string></value>
</member>
<member>
<name>smbios.system.family</name>
<value><string>Red Hat Enterprise Linux</string></value>
</member>
<member>
<name>smbios.bios.vendor</name>
<value><string>Seabios</string></value>
</member>
<member>
<name>smbios.system.manufacturer</name>
<value><string>Red Hat</string></value>
</member>
<member>
<name>smbios.system.skunumber</name>
<value><string>Not Specified</string></value>
</member>
<member>
<name>smbios.system.version</name>
<value><string>RHEL 6.2.0 PC</string></value>
</member>
<member>
<name>smbios.system.uuid</name>
<value><string>64b92fb1-c2d5-cdf0-5a82-ea74537611a0</string></value>
</member>
</struct></value>
</member>
<member>
<name>release_name</name>
<value><string>centos-release</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>

	              params = <type 'tuple'> ({'token': '1-b7a7be4191c555ac1ad91d05d41ed055,1-activation-key', 'profile_name': 'localhost.localdomain', 'architecture': 'x86_64', 'os_release': '6', 'smbios': {'smbios.system.serial': 'Not Specified', 'smbios.system.product': 'KVM', 'smbios.system.family': 'Red Hat Enterprise Linux', 'smbios.bios.vendor': 'Seabios', 'smbios.system.manufacturer': 'Red Hat', 'smbios.system.skunumber': 'Not Specified', 'smbios.system.version': 'RHEL 6.2.0 PC', 'smbios.system.uuid': '64b92fb1-c2d5-cdf0-5a82-ea74537611a0'}, 'release_name': 'centos-release'},)
	              method = <type 'unicode'> registration.new_system
	                self = <type 'instance'> <spacewalk.server.apacheRequest.apachePOST instance at 0x7f9042284dd0>

Frame handler in /usr/lib/python2.6/site-packages/spacewalk/server/apacheHandler.py at line 196
	                   h = <type 'instance'> <spacewalk.server.rhnSQL.driver_postgresql.Cursor instance at 0x7f9042284b90>
	                self = <type 'instance'> <spacewalk.server.apacheHandler.apacheHandler instance at 0x7f9040fceb00>
	                 req = <type 'instance'> <wsgi.wsgiRequest.WsgiRequest instance at 0x7f904227fb00>
	                 ret = <type 'int'> 0
	     templateStrings = <type 'dict'> {'email_account_info': '\nAccount Information:\n  Your Spacewalk login:         <login />\n  Your Spacewalk email address: <email-address />', 'email_footer': '--the Spacewalk Team', 'hostname': 'spacewalk.example.com.br'}
	                 row = <type 'NoneType'> None

Frame handle in /usr/share/rhn/wsgi/wsgiHandler.py at line 45
	        replacements = <type 'dict'> {'Xml': 'XML', 'Actualuri': 'ActualURI', 'Md5Sum': 'MD5sum', '_': '-', 'Rhn': 'RHN'}
	      component_type = <type 'str'> server.xmlrpc
	      start_response = <type 'builtin_function_or_method'> <built-in method start_response of mod_wsgi.Adapter object at 0x7f90415e5738>
	                   k = <type 'str'> Rhn
	                 req = <type 'instance'> <wsgi.wsgiRequest.WsgiRequest instance at 0x7f904227fb00>
	           parseServ = <type 'instancemethod'> <bound method apacheHandler.headerParserHandler of <spacewalk.server.apacheHandler.apacheHandler instance at 0x7f9040fceb00>>
	                 ret = <type 'int'> 0
	              server = <type 'str'> xmlrpc
	             environ = <type 'dict'> {'mod_wsgi.listener_port': '443', 'X-RHN-Client-Capability': 'osad.ping(1)=1,caneatCheese(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1', 'SERVER_SOFTWARE': 'Apache', 'SCRIPT_NAME': '/XMLRPC', 'HTTP_X_TRANSPORT_INFO': 'Extended Capabilities Transport (C) Red Hat, Inc (version $Revision$)', 'mod_wsgi.handler_script': '', 'SERVER_SIGNATURE': '<address>Apache Server at spacewalk.example.com.br Port 443</address>\n', 'REQUEST_METHOD': 'POST', 'PATH_INFO': '', 'SERVER_PROTOCOL': 'HTTP/1.1', 'QUERY_STRING': '', 'X-Info': 'RPC Processor (C) Red Hat, Inc (version $Revision$)', 'CONTENT_LENGTH': '1553', 'HTTP_USER_AGENT': 'rhn.rpclib.py/$Revision$', 'HTTP_X_UP2DATE_VERSION': '1.7.14-1.el6', 'SERVER_NAME': 'spacewalk.example.com.br', 'REMOTE_ADDR': '192.168.89.126', 'mod_wsgi.request_handler': 'wsgi-script', 'User-Agent': 'rhn.
 rpclib.py/$Revision$', 'wsgi.url_scheme': 'https', 'Host': 'spacewalk.example.com.br', 'X-RHN-Transport-Capability': 'follow-redirects=3', 'mod_wsgi.callable_object': 'application', 'SERVER_PORT': '443', 'wsgi.multiprocess': True, 'mod_wsgi.input_chunked': '0', 'SERVER_ADDR': '192.168.89.1', 'DOCUMENT_ROOT': '/var/www/html', 'mod_wsgi.process_group': '', 'Accept-Encoding': 'identity', 'HTTP_X_RHN_CLIENT_CAPABILITY': 'osad.ping(1)=1,caneatCheese(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1', 'SCRIPT_FILENAME': '/usr/share/rhn/wsgi/xmlrpc.py', 'SERVER_ADMIN': 'root@localhost', 'X-Up2Date-Version': '1.7.14-1.el6', 'X-Transport-Info': 'Extended Capabilities Transport (C) Red Hat, Inc (version $Revision$)', 'SCRIPT_URI': 'https://spacewalk.example.com.br/XMLRPC', 'HTTP_X_CLIENT_VERSION': '1', 'wsgi.input': <mod_wsgi.Input object at 0x7f9042287b70>, 'HTTP_HOS
 T': 'spacewalk.example.com.br', 'SCRIPT_URL': '/XMLRPC', 'HTTPS': '1', 'wsgi.multithread': False, 'REQUEST_URI': '/XMLRPC', 'X-Client-Version': '1', 'wsgi.version': (1, 1), 'GATEWAY_INTERFACE': 'CGI/1.1', 'wsgi.run_once': False, 'wsgi.errors': <mod_wsgi.Log object at 0x7f9042287cf0>, 'REMOTE_PORT': '45387', 'mod_wsgi.listener_host': '', 'mod_wsgi.version': (3, 2), 'HTTP_X_RHN_TRANSPORT_CAPABILITY': 'follow-redirects=3', 'CONTENT_TYPE': 'text/xml', 'mod_wsgi.application_group': 'spacewalk.example.com.br|/xmlrpc', 'mod_wsgi.script_reloading': '1', 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f90415e5738>, 'HTTP_ACCEPT_ENCODING': 'identity', 'HTTP_X_INFO': 'RPC Processor (C) Red Hat, Inc (version $Revision$)'}
	                 key = <type 'str'> HTTP_X_INFO
	                   v = <type 'str'> RHN
	          servertype = <type 'str'> spacewalk.server.apacheServer
	             new_key = <type 'str'> X-Info
	             appServ = <type 'instancemethod'> <bound method apacheHandler.handler of <spacewalk.server.apacheHandler.apacheHandler instance at 0x7f9040fceb00>>

Frame application in /usr/share/rhn/wsgi/xmlrpc.py at line 22
	      start_response = <type 'builtin_function_or_method'> <built-in method start_response of mod_wsgi.Adapter object at 0x7f90415e5738>
	             environ = <type 'dict'> {'mod_wsgi.listener_port': '443', 'X-RHN-Client-Capability': 'osad.ping(1)=1,caneatCheese(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1', 'SERVER_SOFTWARE': 'Apache', 'SCRIPT_NAME': '/XMLRPC', 'HTTP_X_TRANSPORT_INFO': 'Extended Capabilities Transport (C) Red Hat, Inc (version $Revision$)', 'mod_wsgi.handler_script': '', 'SERVER_SIGNATURE': '<address>Apache Server at spacewalk.example.com.br Port 443</address>\n', 'REQUEST_METHOD': 'POST', 'PATH_INFO': '', 'SERVER_PROTOCOL': 'HTTP/1.1', 'QUERY_STRING': '', 'X-Info': 'RPC Processor (C) Red Hat, Inc (version $Revision$)', 'CONTENT_LENGTH': '1553', 'HTTP_USER_AGENT': 'rhn.rpclib.py/$Revision$', 'HTTP_X_UP2DATE_VERSION': '1.7.14-1.el6', 'SERVER_NAME': 'spacewalk.example.com.br', 'REMOTE_ADDR': '192.168.89.126', 'mod_wsgi.request_handler': 'wsgi-script', 'User-Agent': 'rhn.
 rpclib.py/$Revision$', 'wsgi.url_scheme': 'https', 'Host': 'spacewalk.example.com.br', 'X-RHN-Transport-Capability': 'follow-redirects=3', 'mod_wsgi.callable_object': 'application', 'SERVER_PORT': '443', 'wsgi.multiprocess': True, 'mod_wsgi.input_chunked': '0', 'SERVER_ADDR': '192.168.89.1', 'DOCUMENT_ROOT': '/var/www/html', 'mod_wsgi.process_group': '', 'Accept-Encoding': 'identity', 'HTTP_X_RHN_CLIENT_CAPABILITY': 'osad.ping(1)=1,caneatCheese(1)=1,packages.extended_profile(2)=1,osad.rhn_check(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1', 'SCRIPT_FILENAME': '/usr/share/rhn/wsgi/xmlrpc.py', 'SERVER_ADMIN': 'root@localhost', 'X-Up2Date-Version': '1.7.14-1.el6', 'X-Transport-Info': 'Extended Capabilities Transport (C) Red Hat, Inc (version $Revision$)', 'SCRIPT_URI': 'https://spacewalk.example.com.br/XMLRPC', 'HTTP_X_CLIENT_VERSION': '1', 'wsgi.input': <mod_wsgi.Input object at 0x7f9042287b70>, 'HTTP_HOS
 T': 'spacewalk.example.com.br', 'SCRIPT_URL': '/XMLRPC', 'HTTPS': '1', 'wsgi.multithread': False, 'REQUEST_URI': '/XMLRPC', 'X-Client-Version': '1', 'wsgi.version': (1, 1), 'GATEWAY_INTERFACE': 'CGI/1.1', 'wsgi.run_once': False, 'wsgi.errors': <mod_wsgi.Log object at 0x7f9042287cf0>, 'REMOTE_PORT': '45387', 'mod_wsgi.listener_host': '', 'mod_wsgi.version': (3, 2), 'HTTP_X_RHN_TRANSPORT_CAPABILITY': 'follow-redirects=3', 'CONTENT_TYPE': 'text/xml', 'mod_wsgi.application_group': 'spacewalk.example.com.br|/xmlrpc', 'mod_wsgi.script_reloading': '1', 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f90415e5738>, 'HTTP_ACCEPT_ENCODING': 'identity', 'HTTP_X_INFO': 'RPC Processor (C) Red Hat, Inc (version $Revision$)'}


Environment for PID=9951 on exception:
LANG = C
PATH = /sbin:/usr/sbin:/bin:/usr/bin
PWD = /
SHLVL = 2
TERM = xterm
_ = /usr/sbin/httpd
Comment 13 Michael Mráka 2012-04-23 11:24:20 EDT
First part of this bug (column "free_slots" does not exist) has been addressed in spacewalk master by

commit 340aae7119793ddfe37691640b73eae2c0ea4dc3
    upgrade script for free_slots
commit 391a70b6caf3325e9f9e0c3d9cf9ff705bf4319a
    811646 - assign number of free slots
    fixing
    ERROR:  column "free_slots" does not exist at character 295
    QUERY:  UPDATE rhnServerChannel sc set is_fve = 'Y' where sc.server_id in (
    select vi.virtual_system_id from rhnServerFveCapable sfc inner join
    rhnVirtualInstance vi on vi.virtual_system_id = sfc.server_id where
    vi.host_system_id =  $1  and sfc.channel_family_id =  $2  order by vi.modified
    desc limit free_slots )
    CONTEXT:  PL/pgSQL function "repoll_virt_guest_entitlements" line 96 at SQL
    statement
Comment 14 Michael Mráka 2012-04-24 07:51:37 EDT
(In reply to comment #12)
>   Applying the patch....
...
>    Afterwards, installing rhn-virtualization-host on the hypervisor and then
> kickstart the box. 
> 
>    Unfortunetally, still hitting an issue: 
> 
> 2012/04/19 14:20:47 -02:00 9951 192.168.89.126:
> server/rhnVirtualization.guest_registered('ERROR', 'Error adding entitlement
> monitoring_entitled: (20287, \'ERROR:  -20287 : (invalid_entitlement) - The
> server can not be entitled to the specified level\\nCONTEXT:  SQL statement
> "SELECT  rhn_exception.raise_exception
> (\\\'invalid_entitlement\\\')"\\nPL/pgSQL function "entitle_server" line 49 at
> PERFORM\\n\', InternalError(\'-20287 : (invalid_entitlement) - The server can
> not be entitled to the specified level\\nCONTEXT:  SQL statement "SELECT 
> rhn_exception.raise_exception (\\\'invalid_entitlement\\\')"\\nPL/pgSQL
> function "entitle_server" line 49 at PERFORM\\n\',))')

The error says 'Error adding entitlement monitoring_entitled' so you probably trying to add monitoring entitlement during registration (maybe via activation key). While I agree this shouldn't end with ISE/traceback it's a different error. Please reproduce it on a fresh system and file new bugzilla for it.

Thanks.
Comment 15 Michael Mráka 2012-04-24 08:38:55 EDT
The issue from comment #1 has been fixed in upstream spacewalk-schema-1.8.19-1 (see commits in comment #13).

Issues from comment #8 and comment #12 - I cant reproduce:

- have Centos 6 host with rhn-virtualization-host package installed
- register host to spacewalk
- host does *NOT* even have virtualization entitlement

- create guest and register it to the same spacewalk (under same login)
  WORKS
- register the same guest using activation key with monitoring and provisioning entitlements set 
  WORKS
- guests are visible under <host> > Virtualization tab
Comment 16 Michael Mráka 2012-04-24 08:40:37 EDT
According to previous comment the bus is fixed, if you disagree please reopen with better reproducer.
Comment 19 Alexey Kurnosov 2012-05-31 11:59:32 EDT
Have you fixed 1.8 only?
Should we expect the fix in 1.7?
Comment 20 Jan Pazdziora 2012-05-31 13:48:47 EDT
(In reply to comment #19)
> Have you fixed 1.8 only?

Yes.

> Should we expect the fix in 1.7?

No. You can always just replay schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/033-rhn_entitlements.pkb.sql.postgresql in your psql.
Comment 21 haddel 2012-06-12 15:01:46 EDT
Hi all,

I want to use SW 1.7 now with new KVM guests which have to be registered to sw.
If I understood right, I have to change the schema to a buggy knightly build version?
If yes, how? 
# yum update spacewalk-schema-1.8* ?

Many thanks

haddel
Comment 22 Jan Pazdziora 2012-06-13 02:55:24 EDT
(In reply to comment #21)
> Hi all,
> 
> I want to use SW 1.7 now with new KVM guests which have to be registered to
> sw.
> If I understood right, I have to change the schema to a buggy knightly build
> version?
> If yes, how? 
> # yum update spacewalk-schema-1.8* ?

No, that would likely render your 1.7 Spacewalk unusable. See comment 20.
Comment 23 haddel 2012-06-13 09:37:53 EDT
(In reply to comment #22)
> (In reply to comment #21)
> > Hi all,
> > 
> > I want to use SW 1.7 now with new KVM guests which have to be registered to
> > sw.
> > If I understood right, I have to change the schema to a buggy knightly build
> > version?
> > If yes, how? 
> > # yum update spacewalk-schema-1.8* ?
> 
> No, that would likely render your 1.7 Spacewalk unusable. See comment 20.

Ok let me ask this much more closer:

1.) I have to create 
/etc/sysconfig/rhn/schema-upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8 ??

2.)
I have to extract 033-rhn_entitlements.pkb.sql.postgresql from the newest spacewalk-schema-rpm (looks like spacewalk-schema-1.8.19-1 is no longer available) ??
Comment 24 Stepan 2012-06-13 10:41:15 EDT
Hi there.
I update my SW 1.7 pgsql database.
psql spacewalk_db < /tmp/033-rhn_entitlements.pkb.sql.postgresql

But bug is not fixed.
When i register clients, postgresql ERROR "-20287 : (invalid_entitlement)" is appear.
Comment 25 Michael Mráka 2012-06-22 03:34:49 EDT
Two more fixes in spacewalk master

commit 51b390eb435f11f6d9d84c7f1f0ba719eeff1aed
    811646 - handle locally exception in entitle_server()
    raise exception in postgresql also aborts current transaction
    fixing
    Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py", line 122, in call_function
        response = apply(func, params)
      File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 502, in new_system
        architecture, data)
      File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 429, in create_system
        newserv.save(1, channel)
      File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py", line 574, in save
        self.__save(channel)
      File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnServer/server_class.py", line 542, in __save
        user_id=user_id)
      File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 1754, in subscribe_server_channels
        raise_exceptions=1)
      File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 1709, in guess_channels_for_server
        server.org_id, user_id=user_id)
      File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 913, in channels_for_release_arch
        org_id=org_id, user_id=user_id)
      File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnChannel.py", line 732, in base_channel_for_rel_arch
        org_id=org_id, user_id=user_id)
      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 282, 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 301, in _execute_
        self._real_cursor.execute(self.sql, params)
    InternalError: current transaction is aborted, commands ignored until end of transaction block
commit 7788bfdf59264e6f4aaf5490a42c80be7de690d6
    811646 - made error message more detailed
Comment 26 haddel 2012-06-24 15:26:26 EDT
OK, noone is able to explain the dedicated steps to fix that bug.
Let us wait for 1.8.....
Comment 27 Jan Pazdziora 2012-10-30 15:23:12 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 28 Jan Pazdziora 2012-11-01 12:18:21 EDT
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

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