You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Francesco Chicchiriccò <il...@apache.org> on 2018/05/10 06:29:08 UTC

Re: Getting IllegalStateException when running task

On 09/05/2018 22:49, Arnold Miller wrote:
> Hi,
> I'm getting this
> "java.lang.IllegalStateException: Object {Uid=Attribute: 
> {Name=__UID__,  .....
> was returned by the connector but failed to pass the framework filter. 
> This seems like wrong implementation of the filter in the connector."
> when the Search script is executed after running a Push task.
> From a previous message I found that the search script must return all 
> the attributes it is asked for:
> https://www.mail-archive.com/user@syncope.apache.org/msg02339.html
> Which basically means that you fill in all the values in ATTRS_TO_GET 
> [.....]
> I am doing that and also I am returning the result as suggested in
> https://github.com/apache/syncope/blob/2_0_X/fit/core-reference/src/test/resources/rest/SearchScript.groovy#L76-L93
> like this:
> result.add(buildConnectorObject(node));
> My questions:
> 1. Why am I getting that "IllegalStateException" described above?

The error above means that your search script is returning something 
that does not match with the original request: suppose that Syncope asks 
for a filter like as "name == 'Francesco'" and the result returned from 
the search script does not have the "name" attribute, or value is "Arnold".

> 2. If the script is finding the item it is requested to, why does it 
> trigger the creation script instead of the update script?

The point is exactly this: because of the exception above, Syncope does 
not find any item, hence create is invoked.

HTH
Regards.

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Re: Getting IllegalStateException when running task

Posted by alireza ranjbaran <ra...@gmail.com>.
Hi Arnold,
Interesting issue!
Identity management systems basically consider one unique master key for
users. I assume that you can map one of them to another, so I suggest you
to make two function or API (IdnumberToUsername and UsernameToIdnumber) to
resolve the problem.

On Wed, May 16, 2018 at 12:27 AM, Arnold Miller <ar...@gmx.com>
wrote:

> Dear Alireza,
> What I mean is that I'm not returning all the fields and that's why it
> fails.
> To make it clearer I give you an example:
> Let's say that in my source (or master) identity store I have both
> "idnumber" and "username", and both are unique. The problem is that when I
> select both of them to be the remote key Syncope says "there must be
> exactly one remote key". This is a problem because some of the destination
> identity stores work with the "idnumber" only whereas others work with the
> "username" only; so if I mark "idnumber" to be the remote key then the
> systems that work only with "username" will not be able to return it
> because they just don't have it; in spite they have the rest of the
> mandatory fields.
>
>
> Best Regards,
>
> Arnold Miller
>
>
> *Sent:* Tuesday, May 15, 2018 at 12:08 AM
> *From:* "alireza ranjbaran" <ra...@gmail.com>
>
> *To:* user@syncope.apache.org
> *Subject:* Re: Getting IllegalStateException when running task
> Dear Arnold,
>
> Would you please explain more details?
> For the error you posted at first, you should be sure that you return all
> "mandatory" fields include __UID__, __NAME__, the key you have defined in
> your mapping, ect. for example if you mapped the Syncope 'username' to DB
> 'uname', you can fill the result as below (here email, organization and
> department are optional):
>
> sql.eachRow("SELECT * FROM Users" + where, {result.add([__UID__:it.uname,
> __NAME__:it.uname, email:it.email, uname:it.uname,
> organization:it.organization, department:it.department])} )
>
> You are not forced to use primary key. Alternate key or even fixed values
> can be pass as result.
>
> On Mon, May 14, 2018 at 9:06 PM, Arnold Miller <ar...@gmx.com>
> wrote:
>>
>> Looks like I will need to create another resource and duplicate
>> information (except the previously used remote key).
>> Will be glad to hear if anyone has another solution.
>>
>>
>> Best Regards,
>>
>> Arnold Miller
>>
>>
>> *Sent:* Thursday, May 10, 2018 at 3:04 PM
>> *From:* "Arnold Miller" <ar...@gmx.com>
>>
>> *To:* user@syncope.apache.org
>> *Subject:* Re: Getting IllegalStateException when running task
>> I certainly have an identity store which uses an alternate key instead of
>> the one I marked as a remote key.
>> Specifically, the master identity store has both the remote and the
>> alternate keys, but the identity store where I am trying to push the
>> updates has only the alternate key.
>>
>> If in Syncope "there must be exactly one remote key" how else can I
>> handle this problem?
>>
>>
>> Best Regards,
>>
>> Arnold Miller
>>
>> *Sent:* Thursday, May 10, 2018 at 1:29 AM
>> *From:* "Francesco Chicchiriccò" <il...@apache.org>
>> *To:* user@syncope.apache.org
>> *Subject:* Re: Getting IllegalStateException when running task
>> On 09/05/2018 22:49, Arnold Miller wrote:
>>
>> Hi,
>> I'm getting this
>> "java.lang.IllegalStateException: Object {Uid=Attribute: {Name=__UID__,
>> .....
>> was returned by the connector but failed to pass the framework filter.
>> This seems like wrong implementation of the filter in the connector."
>> when the Search script is executed after running a Push task.
>>
>> From a previous message I found that the search script must return all
>> the attributes it is asked for:
>> https://www.mail-archive.com/user@syncope.apache.org/msg02339.html
>> Which basically means that you fill in all the values in ATTRS_TO_GET
>> [.....]
>> I am doing that and also I am returning the result as suggested in
>> https://github.com/apache/syncope/blob/2_0_X/fit/core-
>> reference/src/test/resources/rest/SearchScript.groovy#L76-L93
>> like this:
>> result.add(buildConnectorObject(node));
>>
>> My questions:
>> 1. Why am I getting that "IllegalStateException" described above?
>>
>>
>> The error above means that your search script is returning something that
>> does not match with the original request: suppose that Syncope asks for a
>> filter like as "name == 'Francesco'" and the result returned from the
>> search script does not have the "name" attribute, or value is "Arnold".
>>
>>
>> 2. If the script is finding the item it is requested to, why does it
>> trigger the creation script instead of the update script?
>>
>>
>> The point is exactly this: because of the exception above, Syncope does
>> not find any item, hence create is invoked.
>>
>> HTH
>> Regards.
>>
>> --
>> Francesco Chicchiriccò
>>
>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>
>> Member at The Apache Software Foundation
>> Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMailhttp://home.apache.org/~ilgrosso/
>>
>>
>
> --
> *Best Regards,*
> *Alireza Ranjbaran*
> *ITS Security Operations Engineer at **MTN Irancell*
>
>
>
>
>



-- 
*Best Regards,*

*Alireza Ranjbaran*
*ITS Security Operations Engineer at **MTN Irancell*

Re: Getting IllegalStateException when running task

Posted by alireza ranjbaran <ra...@gmail.com>.
Dear Arnold,

Would you please explain more details?
For the error you posted at first, you should be sure that you return all
"mandatory" fields include __UID__, __NAME__, the key you have defined in
your mapping, ect. for example if you mapped the Syncope 'username' to DB
'uname', you can fill the result as below (here email, organization and
department are optional):

sql.eachRow("SELECT * FROM Users" + where, {result.add([__UID__:it.uname,
__NAME__:it.uname, email:it.email, uname:it.uname,
organization:it.organization, department:it.department])} )

You are not forced to use primary key. Alternate key or even fixed values
can be pass as result.

On Mon, May 14, 2018 at 9:06 PM, Arnold Miller <ar...@gmx.com>
wrote:

> Looks like I will need to create another resource and duplicate
> information (except the previously used remote key).
> Will be glad to hear if anyone has another solution.
>
>
> Best Regards,
>
> Arnold Miller
>
>
> *Sent:* Thursday, May 10, 2018 at 3:04 PM
> *From:* "Arnold Miller" <ar...@gmx.com>
>
> *To:* user@syncope.apache.org
> *Subject:* Re: Getting IllegalStateException when running task
> I certainly have an identity store which uses an alternate key instead of
> the one I marked as a remote key.
> Specifically, the master identity store has both the remote and the
> alternate keys, but the identity store where I am trying to push the
> updates has only the alternate key.
>
> If in Syncope "there must be exactly one remote key" how else can I handle
> this problem?
>
>
> Best Regards,
>
> Arnold Miller
>
> *Sent:* Thursday, May 10, 2018 at 1:29 AM
> *From:* "Francesco Chicchiriccò" <il...@apache.org>
> *To:* user@syncope.apache.org
> *Subject:* Re: Getting IllegalStateException when running task
> On 09/05/2018 22:49, Arnold Miller wrote:
>
> Hi,
> I'm getting this
> "java.lang.IllegalStateException: Object {Uid=Attribute: {Name=__UID__,
> .....
> was returned by the connector but failed to pass the framework filter.
> This seems like wrong implementation of the filter in the connector."
> when the Search script is executed after running a Push task.
>
> From a previous message I found that the search script must return all the
> attributes it is asked for:
> https://www.mail-archive.com/user@syncope.apache.org/msg02339.html
> Which basically means that you fill in all the values in ATTRS_TO_GET
> [.....]
> I am doing that and also I am returning the result as suggested in
> https://github.com/apache/syncope/blob/2_0_X/fit/core-
> reference/src/test/resources/rest/SearchScript.groovy#L76-L93
> like this:
> result.add(buildConnectorObject(node));
>
> My questions:
> 1. Why am I getting that "IllegalStateException" described above?
>
>
> The error above means that your search script is returning something that
> does not match with the original request: suppose that Syncope asks for a
> filter like as "name == 'Francesco'" and the result returned from the
> search script does not have the "name" attribute, or value is "Arnold".
>
>
> 2. If the script is finding the item it is requested to, why does it
> trigger the creation script instead of the update script?
>
>
> The point is exactly this: because of the exception above, Syncope does
> not find any item, hence create is invoked.
>
> HTH
> Regards.
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Member at The Apache Software Foundation
> Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMailhttp://home.apache.org/~ilgrosso/
>
>


-- 
*Best Regards,*

*Alireza Ranjbaran*
*ITS Security Operations Engineer at **MTN Irancell*