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

Adding a token to database causes transaction to lock indefinitely

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.7.2
    • 2.7.1
    • Database
    • None

      Steps to reproduce

      1. Bring up Crowd using HSQLDB 2.3.0 (this may be reproducible with Postgres 8.4, to be confirmed).
      2. Set up Crowd to use an Embedded database.
      3. Continue through the setup process.

      Expected result

      Crowd setup process completes and user is presented with a login screen.

      Observed result

      Crowd hangs after the last screen of the setup process, and never presents the login screen. Crowd becomes unresponsive.

      Workaround 1

      At this point the workaround is to switch the session storage to in-memory from database storage:
      Session Configuration

      The in-memory storage is explained in more detail on the page linked above.

      If you cannot keep crowd up long enough to access the Administration console, or crowd will simply not finish starting up, follow these steps to modify the value directly in the database:

      1. Shutdown crowd - ensure the pid is stopped
      2. Perform a database backup
      3. Connect to the database
      4. Execute this sql:
        update cwd_property 
        set property_value='false'
        where property_name='database.token.storage.enabled';
      5. Restart Crowd
      6. Validate the session storage is now in-memory by Navigating to Administration > Session Config

      Workaround 2

      If workaround 1 does not help, you may try this. However, please note that performing this workaround will force users to login again.

      1. Shutdown crowd - ensure the pid is stopped
      2. Perform a database backup
      3. Connect to the database
      4. Execute this sql:
        delete from cwd_token;
      5. Restart Crowd
      6. Validate the session storage is now in-memory by Navigating to Administration > Session Config

        1. td2.txt
          63 kB
          Diego Berrueta

          Form Name

            [CWD-3769] Adding a token to database causes transaction to lock indefinitely

            Conny Postma made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 75820 ]
            Monique Khairuliana (Inactive) made changes -
            Workflow Original: Simplified Crowd Development Workflow v2 - restricted [ 1510865 ] New: JAC Bug Workflow v3 [ 3365943 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: Simplified Crowd Development Workflow v2 [ 1391957 ] New: Simplified Crowd Development Workflow v2 - restricted [ 1510865 ]
            Owen made changes -
            Workflow Original: Crowd Development Workflow v2 [ 619703 ] New: Simplified Crowd Development Workflow v2 [ 1391957 ]
            Ferd made changes -
            Remote Link New: This issue links to "Page (Extranet)" [ 139228 ]
            Brian made changes -
            Remote Link Original: This issue links to "Page (Extranet)" [ 112785 ] New: This issue links to "Page (Extranet)" [ 112785 ]
            Brian made changes -
            Remote Link New: This issue links to "Page (Extranet)" [ 112785 ]

            rgundersen those logs should not be anything to worry about; the error should be from an inner transaction failing, and Crowd should recover and continue to use the outer transaction. Unfortunately, we don't have an easy way of silencing those scary messages without also silencing other, possibly meaningful, errors.

            If you have a problem with Crowd being unstable, please raise a ticket with support, as we still believe this issue is resolved.

            Caspar Krieger (Inactive) added a comment - rgundersen those logs should not be anything to worry about; the error should be from an inner transaction failing, and Crowd should recover and continue to use the outer transaction. Unfortunately, we don't have an easy way of silencing those scary messages without also silencing other, possibly meaningful, errors. If you have a problem with Crowd being unstable, please raise a ticket with support , as we still believe this issue is resolved.

            I think we are getting this same error, and we are using 2.7.2.

            I get this error in our logs:

            2015-03-09 13:55:21,050 http-bio-8445-exec-217 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 1062, SQLState: 23000
            2015-03-09 13:55:21,050 http-bio-8445-exec-217 ERROR [engine.jdbc.spi.SqlExceptionHelper] Duplicate entry 'lG70v4BxxOuh0EBuvwfhzA00' for key 'uk_token_id_hash'
            2015-03-09 13:55:21,050 http-bio-8445-exec-217 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch]
            

            We're using MySQL and we're storing the tokens in the database (not in-memory). Since it's working (intermittently) I have not tried any workarounds but it might be worth investigating a bit more.

            Zuber Khursiwala added a comment - I think we are getting this same error, and we are using 2.7.2. I get this error in our logs: 2015-03-09 13:55:21,050 http-bio-8445-exec-217 WARN [engine.jdbc.spi.SqlExceptionHelper] SQL Error: 1062, SQLState: 23000 2015-03-09 13:55:21,050 http-bio-8445-exec-217 ERROR [engine.jdbc.spi.SqlExceptionHelper] Duplicate entry 'lG70v4BxxOuh0EBuvwfhzA00' for key 'uk_token_id_hash' 2015-03-09 13:55:21,050 http-bio-8445-exec-217 ERROR [jdbc.batch.internal.BatchingBatch] HHH000315: Exception executing batch [could not perform addBatch] We're using MySQL and we're storing the tokens in the database (not in-memory). Since it's working (intermittently) I have not tried any workarounds but it might be worth investigating a bit more.
            Jonathan G made changes -
            Remote Link Original: This issue links to "Page (Extranet)" [ 63060 ] New: This issue links to "Page (Extranet)" [ 63060 ]

              Unassigned Unassigned
              dberrueta Diego Berrueta
              Affected customers:
              38 This affects my team
              Watchers:
              71 Start watching this issue

                Created:
                Updated:
                Resolved: