[Spacewalk-list] upgrade to 1.5 and migrated to postgres... issues

Jan Pazdziora jpazdziora at redhat.com
Tue Sep 13 07:50:49 UTC 2011


On Thu, Aug 18, 2011 at 04:53:36PM +1000, Jason Ball wrote:
> Two issues which are apparently related.
> 
> 1. can't delete systems.
> 
> 2. Can't register new systems.
> 
> In both cases the error is a call to the non existent routine:
> 
> HINT:  No function matches the given name and argument types. You might need
> > to add explicit type casts.
> > *QUERY:  SELECT  update_perms_for_user( $1 )*
> > CONTEXT:  PL/pgSQL function "update_perms_for_server_group" line 22 at
> > PERFORM
> >
> 
> and
> 
> The following exception occurred while executing this request:
> >
> > POST /rhn/systems/details/DeleteConfirm.do
> >
> 
> 
> Exception:
> 
> javax.servlet.ServletException: ERROR: function
> update_perms_for_user(numeric) does not exist
> 
>       at
> org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)

When you log in with psql, what does

	\df rhn_cache.update_perms_for_user

return on your schema?

> This procedure does not exist in the DB and the definition in main.sql would
> throw an exception anyway:
> 
> create or replace function update_perms_for_server_group
> > (
> >   server_group_id_in in numeric
> > )
> > returns void
> > as $$
> > begin
> >   raise exception 'Stub called, must be replace by .pkb';
> > end;
> > $$ language plpgsql;

This is not exactly correct. If you look into the
/etc/sysconfig/rhn/postgres/main.sql, you will find the
update_perms_for_user stub which came from the packages/rhn_cache.pks
source, but just below that is source of packages/rhn_cache.pkb and
that redefines the update_perms_for_user, now with actual content.
So in correctly populated schema, the function gets defined twice, and
the stub is replaced.

However, on your schema, you don't seem to have it defined even once,
which is strange. Any error in the database population logs?

> Adding the stored procedure as defined in
> /etc/sysconfig/rhn/postgres/main.sql doesn't solve the problem, it simply
> prints the error "Stub called..." and errors out.

You need to use the second definition.

> The second issue of not being able to register new systems using an
> activation key occurs when there are 'group' listed in the activation key
> and results in the 'rhn_reg' returning the error 'Internal Server Error'.
> Removing the groups from the activation key allows the systems to be
> registered, and you can manually assign the groups after registration.
> 
> Any suggestions or is this simply 'not supported' in postgres yet ?

Please check the logs -- we need to find the reason for the ISE.

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat




More information about the Spacewalk-list mailing list