# Bug JIM-237 - Race condition when creating statuses

Project: Stream Jira to OpenProject data Migrator
Status: closed
URL: https://community.openproject.org/work_packages/JIM-237

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Integrations / Jira |
| Target versions | 18.0.0 |
| Observed in versions | 17.9.0 |
| Sprint | Sprint 18.11.-24.11.2026 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

Make sure that status creation is synchronized between threads.  
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint &quot;indexstatusesonLOWERname&quot; DETAIL: Key (lower(name::text))=(done) already exists. &nbsp;app/workers/import/jiracreateprojectworkpackagesjob.rb:194:in &#x27;Import::JiraCreateProjectWorkPackagesJob#createstatus&#x27; app/workers/import/jiracreateprojectworkpackagesjob.rb:99:in &#x27;block (4 levels) in Import::JiraCreateProjectWorkPackagesJob#eachiteration&#x27; app/workers/import/jiracreateprojectworkpackagesjob.rb:97:in &#x27;block (3 levels) in Import::JiraCreateProjectWorkPackagesJob#eachiteration&#x27; app/models/journal/eventconfiguration.rb:63:in &#x27;Journal::EventConfiguration.withfirst&#x27; app/models/journal/event\_configuration.rb:46:in &#x27;Journal::EventConfiguration.with&#x27; app/workers/import/jiracreateprojectworkpackagesjob.rb:96:in &#x27;block (2 levels) in Import::JiraCreateProjectWorkPackagesJob#eachiteration&#x27; app/models/journal/notificationconfiguration.rb:64:in &#x27;Journal::NotificationConfiguration.withfirst&#x27; app/models/journal/notification\_configuration.rb:47:in &#x27;Journal::NotificationConfiguration.with&#x27; app/workers/import/jiracreateprojectworkpackagesjob.rb:95:in &#x27;block in Import::JiraCreateProjectWorkPackagesJob#eachiteration&#x27; app/workers/import/jiracreateprojectworkpackagesjob.rb:93:in &#x27;Import::JiraCreateProjectWorkPackagesJob#eachiteration&#x27; appsignal (4.10.1) lib/appsignal/hooks/activesupportnotifications.rb:19:in &#x27;block in ActiveSupport::Notifications.instrument&#x27; appsignal (4.10.1) lib/appsignal/hooks/activesupportnotifications.rb:18:in &#x27;ActiveSupport::Notifications.instrument&#x27; app/workers/sharedjobsetup.rb:59:in &#x27;block in SharedJobSetup#preparejobcontext&#x27; app/workers/sharedjobsetup.rb:76:in &#x27;SharedJobSetup#withcleanrequest\_store&#x27; app/workers/sharedjobsetup.rb:55:in &#x27;SharedJobSetup#preparejobcontext&#x27; appsignal (4.10.1) lib/appsignal/hooks/activesupportnotifications.rb:19:in &#x27;block in ActiveSupport::Notifications.instrument&#x27; appsignal (4.10.1) lib/appsignal/hooks/activesupportnotifications.rb:18:in &#x27;ActiveSupport::Notifications.instrument&#x27; appsignal (4.10.1) lib/appsignal/hooks/active\_job.rb:116:in &#x27;Appsignal::Hooks::ActiveJobHook::ActiveJobClassInstrumentation#execute&#x27; vendor/plugins/openproject-multitenancy/app/extenders/workers/delayedjobextender.rb:21:in &#x27;block in Multitenancy::JobWithSchemaData::ClassMethods#execute&#x27; vendor/plugins/openproject-multitenancy/app/extenders/workers/delayedjobextender.rb:20:in &#x27;Multitenancy::JobWithSchemaData::ClassMethods#execute&#x27; appsignal (4.10.1) lib/appsignal/hooks/activesupportnotifications.rb:19:in &#x27;block in ActiveSupport::Notifications.instrument&#x27; appsignal (4.10.1) lib/appsignal/hooks/activesupportnotifications.rb:18:in &#x27;ActiveSupport::Notifications.instrument&#x27;
