# Bug OP-15870 - Cannot delete users who created meeting agenda items

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 14.5.1 |
| Observed in versions | 14.5.0 |
| Sprint | 14.5.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 14.5.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 | Oliver Günther |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Create a user
    
2.  Add the user to a project with the meetings module enabled
    
3.  Create a meeting and a meeting agenda item with that user
    
4.  As an admin, try deleting that user
    

### What is the buggy behavior?

*   nothing happens
    

### What is the expected behavior?

*   the user should be deleted
    

### **Logs**

```text
app/workers/principals/delete_job.rb:40:in `block in perform': PG::ForeignKeyViolation: ERROR:  update or delete on table "users" violates foreign key constraint "fk_rails_06b94602d9" on table "meeting_agenda_items" (ActiveRecord::InvalidForeignKey)
DETAIL:  Key (id)=(4) is still referenced from table "meeting_agenda_items".

        from app/workers/principals/delete_job.rb:33:in `perform'
        from app/workers/application_job.rb:106:in `block in prepare_job_context'
        from app/workers/application_job.rb:79:in `with_clean_request_store'
        from app/workers/application_job.rb:102:in `prepare_job_context'
        from appsignal (3.10.0) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
        from appsignal (3.10.0) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
        from (irb):94:in `<main>'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:894:in `exec_params': ERROR:  update or delete on table "users" violates foreign key constraint "fk_rails_06b94602d9" on table "meeting_agenda_items" (PG::ForeignKeyViolation)
DETAIL:  Key (id)=(4) is still referenced from table "meeting_agenda_items".
```

### Environment information

**OpenProject installation type**

*   [x] Hosted cloud edition
*   [ ] Packaged installation
    *   What distribution?
        
*   [ ] Docker All-in-one container
*   [ ] Docker-compose installation
*   [ ] Other (please specify)

**OpenProject version**

_v14.5.0_
