Double clicking "Import Repository" causes org.postgresql.util.PSQLException Duplicate key violates unique constraint

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 8.9.0, 8.14.0
    • Component/s: Repository - Import
    • Severity 3 - Minor

      Issue Summary

      When attempting to import a repository via Git, if you quickly click the "Import Repository" button twice, it will throw the following error:

      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "uk_slug_project_id"
        Detail: Key (slug, project_id)=(react, 26) already exists.
          at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
          at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
          ... 92 common frames omitted 

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Open the "Import repositories" page in any given project 
      2. Select "Import from" Git
      3. Paste in the given URL (and any credentials if required)
      4. Double click the "Import Repository" button 

      Expected Results

      The button should either disable after the first click or have no effect upon the second and the repository should be imported successfully with no errors.

      Actual Results

      The exception above is thrown and the UI shows an error (though, the repository is eventually imported).

      Workaround

      Ensure you only click the "Import Repository" button once.

            Assignee:
            Unassigned
            Reporter:
            Milly Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: