# Bug OP-17125 - ActiveRecord::RecordNotUnique in POST::API::V3::TimeEntries::TimeEntriesAPI#/time_entries

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-17125

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Time tracking |
| Target versions | 16.1.0 |
| Observed in versions | 16.0.0 |
| Sprint | 16.1.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.0.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

###   

### Steps to reproduce

_??_

### What is the buggy behavior?

*   Appsignal:
    
    *   [https://appsignal.com/openproject-gmbh/sites/681379ae55b0b20ed3735994/exceptions/incidents/603](https://appsignal.com/openproject-gmbh/sites/681379ae55b0b20ed3735994/exceptions/incidents/603)
        
    *   [https://appsignal.com/openproject-gmbh/sites/674718f1d2a5e4a7cb8b2298/exceptions/incidents/509](https://appsignal.com/openproject-gmbh/sites/674718f1d2a5e4a7cb8b2298/exceptions/incidents/509)
        
    *   [https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/762](https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/762)
        
*   Message: `PG::UniqueViolation: ERROR: &nbsp;duplicate key value violates unique constraint "index_time_entries_on_user_id_and_ongoing"`  
    `DETAIL: &nbsp;Key (user_id, ongoing)=(?) already exists.`
    
*   Backtrace: app/services/base\_services/write.rb:36 in BaseServices::Write#persist
    

### What is the expected behavior?

??

###
