Whoops, sorry Lionel, it seems I've overlooked your original message.

I confirm that the action you took was the right one - possibly followed by a 
restart to clear out any JPA cache.

I also have no clue about how it could happen: should you be able to replicate, 
please do not hesitate to report, thanks.

Regards.

On 24/03/25 09:23, Lionel SCHWARZ wrote:
Dear all,
In case this would be of any interest for someone, I could unlock the situation by 
deleting the problematic entry in the table "uplainattruniquevalues".
Unfortunately, I still have no idea what could lead to such a situation.
Best regards
Lionel

----- Le 18 Mar 25, à 18:12, Lionel SCHWARZ lionel.schw...@in2p3.fr a écrit :

Dear all,

I have defined a plain attribute "u_email" for USER with "uniqueConstraint":
true.

For some obscure reasons (several successive modifications of this attribute), I
am stuck with this situation:

1. The user "foo" has this email:

GET /syncope/rest/users/foo
{
  "key": "018e75cc-1d7b-7aef-94ef-ec26528c775e",
  "username": "foo",
  "plainAttrs": [
    {
      "schema": "u_email",
      "values": [
        "foo_...@gmail.com"
      ]
    }
  ]
}

2. Trying to change email to "foo_...@gmail.com" gives an error: "A violation of
the constraint imposed by a unique index or a unique constraint occurred"

3. Looking for "foo_...@gmail.com", I get the user "foo":
GET /syncope/rest/users?fiql=u_email%3D%3Dfoo_two%40gmail.com

{
  "result": [
    {
      "key": "018e75cc-1d7b-7aef-94ef-ec26528c775e",
      "username": "foo",
      "plainAttrs": [
        {
          "schema": "u_email",
          "values": [
            "foo_...@gmail.com"
          ]
        }
      ]
    }
  ],
  "page": 1,
  "size": 1,
  "totalCount": 1
}


Looking into the database, I found that there are 2 entries for the attribute
"u_email" in the table "uplainattruniquevalue". I guess it's not the normal
case, so I wonder if I can safely remove the entry which causes the violation?
I'm also interested in discovering the cause of this situation if someone has an
idea

Best regards,
Lionel

--
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/

Reply via email to