XMLWordPrintable

Details

    • Bug
    • Resolution: Timed out
    • Low
    • None
    • 5.9.1-OD-2015.43.0-0328, 6.1.0
    • User - Follow

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Summary

      Clicking twice on Save on user creation creates two entries in the user table.

      Steps to Reproduce

      • Go to Configuration > User Management
      • Go to Add Users
      • Enter the details for a new user
      • Click save twice really quickly
      • Go to List Users
      • Search for the user

       

      2017-04-01 16:34:02,975 ERROR [http-nio-8090-exec-8] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
      -- referer: http://localhost:8090/admin/users/createuser.action | url: /admin/users/docreateuser.action | traceId: 4eaa8a47918f56e4 | userName: admin
      org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [cwd_user_name_dir_id]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
      at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:241)
      

      Workaround

      As always, please backup your database first before making these changes.

       There are 3 tables we need to remove the user from, in order

      • cwd_membership
      • cwd_user_attribute
      • cwd_user

      Confirm the user has not created any content yet. Run this SQL to confirm no data is in the content table.

      select c.user_name, u.user_key, co.contenttype, co.title from cwd_user c join user_mapping u
      on c.user_name = u.username join content co on u.user_key = co.creator or u.user_key = co.username where co.contenttype <> 'USERINFO' and c.user_name = '<USERNAME>';
      

      Then we can delete the user with these three commands

      delete from cwd_membership where child_user_id = (select id from cwd_user where lower_user_name = '<USERNAME>');
      delete from cwd_user_attribute where user_id = (select id from cwd_user where lower_user_name = '<USERNAME>');
      delete from cwd_user where lower_user_name = '<USERNAME>';
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              phnguyen Phong Hong Nguyen
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: