Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-3948

duplicate key value violates unique constraint "cwd_group_pkey"

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Highest Highest
    • None
    • 2.7.2
    • Database
    • None
    • Red Hat Enterprise Linux Server release 5.5 (Tikanga)
      x86_64 GNU/Linux
      Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
      -XX:MaxPermSize=256m -Xmx2048m
      tomcat-7.0.52
      postgresql-8.4.17

      When trying to add a group via the Crowd web console, we get an error stating

      Exception caught in 500 page could not perform addBatch; SQL [insert into cwd_group (group_name, lower_group_nam
      e, active, is_local, created_date, updated_date, description, group_type, directory_id, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.excep
      tion.ConstraintViolationException: could not perform addBatch
      org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into cwd_group (group_name, lower_group_name, active, is_local, created_date, updated_date, d
      escription, group_type, directory_id, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perfo
      rm addBatch
      

      When trying to execute the SQL into DB, we got

      crowd=> insert into cwd_group (group_name, lower_group_name, active, is_local, created_date, updated_date, description, group_type, directory_id, id) values ('issatest', 'issatest', 'T', 'F', '2014-06-04 17:05:22.313000 +02:00:00', '2014-06-04 17:05:22.313000 +02:00:00', '', 'GROUP', 1441793, 7340326);
      ERROR:  duplicate key value violates unique constraint "cwd_group_pkey"
      

      Making a select in DB gives

      crowd=> select * from cwd_group where id = 7340326;
         id    |    group_name     | lower_group_name  | active | is_local |      created_date       |      updated_date       | description | group_type | directory_id 
      ---------+-------------------+-------------------+--------+----------+-------------------------+-------------------------+-------------+------------+--------------
       7340326 | p.stmarkt.testers | p.stmarkt.testers | T      | T        | 2014-01-18 07:03:07.746 | 2014-01-18 07:03:07.746 |             | GROUP      |      6684673
      (1 row)
      
      
      

              Unassigned Unassigned
              7f8d46fd5f17 Issa
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: