[Spacewalk-list] ISE on SW 1.5 on user management

Pierre Casenove pcasenove at gmail.com
Fri Dec 9 21:40:19 UTC 2011


Me again.
After reading the PostGreSQLPortingGuide (should have done this
before), I found this:
https://fedorahosted.org/spacewalk/wiki/PostgreSQLPortingGuide#Defaultcasttointeger
I don't have my set up box available, but class
com.redhat.rhn.frontend.dto.VisibleSystems has to be modified. And by
comparing VisibleSystems class to SystemOverview class, here is what
should be modified to correct the error:
At line 78 , add this function:

	    /**
	     * For compatibility reasons with PostgreSQL we accept also Integer.
	     *
	     * @param selectableIn Whether a server is selectable one if selectable,
	     * null if not selectable
	     */
	    public void setSelectable(Integer selectableIn) {
	        selectable = (selectableIn != null);
	    }


I'm really sorry but I can't format a patch or what so ever, I have no
way to access the spacewalk server for the week end. And with 1.6
branching arriving on monday... I would like to have this patch
included.

Pierre


> 2011/12/8 Pierre Casenove <pcasenove at gmail.com>:
>> Just a quick update:
>> running the query in psql shell works (I forgot the select * at the
>> beggining). So the query is correct.
>> From the error log, I guess that an Integer is returned in case the
>> user is ldap-enabled, and a Long for a regular user.
>> But I wasn't able to find the code behind this.
>>
>> Pierre
>>
>> 2011/12/8 Pierre Casenove <pcasenove at gmail.com>:
>>> Hello List,
>>> I've plugged my SW 1.5 installation with PGSQL on a LDAP.
>>> When I create a user with PAM authentication, and then going to Users
>>> --> <ldapUser> --> Systems, I get an ISE.
>>> If I navigate to this page on a non ldap user, I don't get an ISE.
>>> I've attached the catalina.out logs.
>>> Two errors appears:
>>> First:
>>> ERROR com.redhat.rhn.common.db.datasource.CachedStatement - Error
>>> while processing cached statement sql: select * from (
>>>  SELECT  DISTINCT S.id AS ID,
>>>          S.name AS SERVER_NAME,
>>>          (SELECT 1
>>>          FROM rhnServerFeaturesView SFV
>>>         WHERE SFV.server_id = S.id
>>>           AND SFV.label = 'ftr_system_grouping') AS selectable
>>>    FROM  rhnServer S, rhnUserServerPerms USP
>>>   WHERE  USP.user_id = ?
>>>     AND  S.id = USP.server_id
>>> ) X
>>> ORDER BY  UPPER(COALESCE(X.server_name, '(none)')), X.id
>>>
>>> --> When running it in psql, here is the output : ERROR:
>>> syntax error at or near ")"
>>> LINE 10: ) X
>>>
>>>
>>> Second error:
>>> Could not find method called: setSelectable in class:
>>> com.redhat.rhn.frontend.dto.VisibleSystems with params: [type:
>>> java.lang.Integer, value: 1]
>>> Indeed, looking at the source code, it is public void
>>> setSelectable(Long selectableIn)
>>>
>>>
>>> Could you please point me to some clue? I can't find in the source
>>> code where the query is built,  and I don't see what is erroneous in
>>> the query.
>>>
>>> Thanks,
>>>
>>> Pierre




More information about the Spacewalk-list mailing list