# Bug MEET-551 - ActiveRecord::InvalidForeignKey on RecurringMeetingsController#end_series

Project: Stream Meetings
Status: closed
URL: https://community.openproject.org/work_packages/MEET-551

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Meetings |
| Target versions | 17.5.0 |
| Observed in versions |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Oliver Günther |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

*   Have a future instantiated meeting
    
*   Cancel that future instance
    
*   End the meeting
    

### What is the buggy behavior?

*   Internal error
    

### What is the expected behavior?

*   Ending works
    

### **Logs**

*   AppSignal on Community: [https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1611/samples/673c529383eb67b55471dda2-1349201345253743005817800419601](https://appsignal.com/openproject-gmbh/sites/673c529383eb67b55471dda2/exceptions/incidents/1611/samples/673c529383eb67b55471dda2-1349201345253743005817800419601)&nbsp;
    

```text
PG::ForeignKeyViolation: ERROR:  update or delete on table "meetings" violates foreign key constraint "fk_rails_613c652e16" on table "meeting_sections"
DETAIL:  Key (id)=(10205) is still referenced from table "meeting_sections".
```

Backtrace:

```text
modules/meeting/app/services/recurring_meetings/update_service.rb:178 block in RecurringMeetings::UpdateService#cleanup_cancelled_schedules
modules/meeting/app/services/recurring_meetings/update_service.rb:176 RecurringMeetings::UpdateService#cleanup_cancelled_schedules
modules/meeting/app/services/recurring_meetings/update_service.rb:55 RecurringMeetings::UpdateService#after_perform
```

<br>
