Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-3888

Updating a trusted application fails with unique constraint violation on uk_trusted_app_restrict

    XMLWordPrintable

Details

    Description

      When a trusted application link is updated, the original restrictions are replaced by the new ones. If one or more of the restrictions is unchanged, it causes the following error:

      Next Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "uk_trusted_app_restrict"
        Detail: Key (trusted_app_id, restriction_type, restriction_value)=(3, 0, 127.0.0.1) already exists.
              at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
              at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
              at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
              at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2737)
              at com.jolbox.bonecp.StatementHandle.executeBatch(StatementHandle.java:469)
              at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:110)
              at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101)
              at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:149)
              at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.executeBatch(JdbcCoordinatorImpl.java:198)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:372)
      

      Specifically, this error occurs when the IP or URL patterns for a trusted application link is updated (under Admin > Application Links > click a link > Incoming Authentication > Trusted Applications).

      A workaround is to:

      • clear both the IP patterns and URL patterns fields
      • click the 'Update' button.
      • click 'Incoming Authentication' again
      • enter the desired IP patterns and URL patterns settings
      • click the 'Update' button.

      Attachments

        Issue Links

          Activity

            People

              mheemskerk Michael Heemskerk (Inactive)
              mheemskerk Michael Heemskerk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: