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

System error when deleting inactive Crowd Internal Directory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 2.12.0
    • 2.8, 2.8.2
    • None

    Description

      Summary

      System error occurs when deleting Crowd Internal Directory that was set up during install when logged in as System Administrator defined in other directory.

      Environment

      • Crowd 2.8.0 connected to Apache Directory Server 1.5.X
      • java version "1.8.0_45"

      Steps to Reproduce

      1. Log in as a user with System Administrator permissions.
      2. Navigate to directories by clicking on Directories tab.
      3. View the directory that has type "Crowd Internal Directory" and remove checkmark from Active field
      4. Remove directory by clicking on Remove directory on the side bar.
      5. Press Continue to remove the directory.

      Expected Results

      Crowd Internal Directory would be deleted from the directories of Crowd.

      Actual Results

      System error is seen in the browser.

      The below exception is thrown in the atlassian-crowd.log file:

      2015-05-08 12:04:46,447 http-bio-8095-exec-17 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23503
      2015-05-08 12:04:46,447 http-bio-8095-exec-17 ERROR [engine.jdbc.spi.SqlExceptionHelper] Batch entry 0 delete from cwd_app_dir_group_mapping where id=262145 was aborted.  Call getNextException to see the cause.
      2015-05-08 12:04:46,447 http-bio-8095-exec-17 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 0, SQLState: 23503
      2015-05-08 12:04:46,447 http-bio-8095-exec-17 ERROR [engine.jdbc.spi.SqlExceptionHelper] ERROR: update or delete on table "cwd_app_dir_group_mapping" violates foreign key constraint "fk_permission_group" on table "cwd_granted_perm"
        Detail: Key (id)=(262145) is still referenced from table "cwd_granted_perm".
      2015-05-08 12:04:46,447 http-bio-8095-exec-17 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch]
      2015-05-08 12:04:46,447 http-bio-8095-exec-17 INFO [crowd.xwork.interceptors.TransactionalInvocation] Invoking rollback for transaction on action '/console/secure/directory/remove.action (RemoveDirectory.default())' due to throwable: org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [delete from cwd_app_dir_group_mapping where id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch
      org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [delete from cwd_app_dir_group_mapping where id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch
      	at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138)
      	at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:678)
      	at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:560)
      ...
      Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch
      	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
      Caused by: java.sql.BatchUpdateException: Batch entry 0 delete from cwd_app_dir_group_mapping where id=262145 was aborted.  Call getNextException to see the cause.
      	at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)
      ...
      2015-05-08 12:04:46,449 http-bio-8095-exec-17 ERROR [crowd.xwork.interceptors.TransactionalInvocation] Action /console/secure/directory/remove.action (RemoveDirectory.default()) is already completed and can not be committed again.
      2015-05-08 12:04:46,449 http-bio-8095-exec-17 ERROR [[Catalina].[localhost].[/crowd].[default]] Servlet.service() for servlet [default] in context with path [/crowd] threw exception [org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [delete from cwd_app_dir_group_mapping where id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch] with root cause
      java.sql.BatchUpdateException: Batch entry 0 delete from cwd_app_dir_group_mapping where id=262145 was aborted.  Call getNextException to see the cause.
      	at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1887)
      ...
      2015-05-08 12:04:46,450 http-bio-8095-exec-17 ERROR [500ErrorPage] Exception caught in 500 page could not perform addBatch; SQL [delete from cwd_app_dir_group_mapping where id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch
      org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [delete from cwd_app_dir_group_mapping where id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch
      	at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:138)
      	at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:678)
      ...
      Caused by: org.hibernate.exception.ConstraintViolationException: could not perform addBatch
      	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129)
      ...
      Caused by: java.sql.BatchUpdateException: Batch entry 0 delete from cwd_app_dir_group_mapping where id=262145 was aborted.  Call getNextException to see the cause.
      	at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)
      ...
      

      Notes

      Attached pdf of System error seen in the browser.
      Also tested in Crowd 2.8.2

      Attachments

        Issue Links

          Activity

            People

              mmakowski Mareusz (Inactive)
              mduong@atlassian.com MichaelD
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: