# Bug OP-11046 - SystemStackError (stack level too deep) when trying to assign new parent or children to a work package

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 12.3.0 |
| Observed in versions | 12.2.0 |
| Sprint | 12.3.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 12.2.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 |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

_Please write down the steps to reproduce. Try to write down all necessary preconditions (what permissions do you have, are other users involved?). Example:_

1.  Using a test project I was not able to reproduce the behavior. Maybe I had to create a very big test project with deep hierarchies in order to reproduce. The user who reported the bug told me that it appeared quite soon after doing the update from 12.1.5 to 12.2.1.  There might be a timely coincidence between performing the update and creation one of the mentioned work packages.

### What is the buggy behavior?

_Please describe the bug with as most details as possible. Example:_

*   After upgrading OP 12.1.5 to 12.2.1, in a project with 250 workpackages and other components, assigning a package a different parent, or in a parent, assigning new children 
*   There was an error notification shown with the message &quot;An internal error has occurred.&quot; (screenshot not-movable-workpackage.png)  
      
    
*   When trying to move a work package with children under another new parent, a message is shown: &quot;Http failure response for https://servername/api/v3/work\_packages/4306: 500 Internal Server Error&quot; (screenshot workpackages-view-after-trying-to-move-wp.png
*   HTTP command was 

<figure class="table op-uc-figure_align-center op-uc-figure"><table class="op-uc-table"><tbody><tr class="op-uc-table--row"><td class="op-uc-p op-uc-table--cell">PATCH</td><td class="op-uc-p op-uc-table--cell"></td></tr><tr class="op-uc-table--row"><td class="op-uc-p op-uc-table--cell">scheme</td><td class="op-uc-p op-uc-table--cell">https</td></tr><tr class="op-uc-table--row"><td class="op-uc-p op-uc-table--cell">host</td><td class="op-uc-p op-uc-table--cell">server name</td></tr><tr class="op-uc-table--row"><td class="op-uc-p op-uc-table--cell">filename</td><td class="op-uc-p op-uc-table--cell">/api/v3/work_packages/4306</td></tr></tbody></table></figure>

*   payload:  {&quot;lockVersion&quot;:15,&quot;\_links&quot;:{&quot;parent&quot;:{&quot;href&quot;:&quot;/api/v3/work\_packages/3235&quot;}}}
*   HTTP Response: &quot;Home \[Error 500\] An error occurred on the page you were trying to access. If you continue to experience problems please contact your XYZ OpenProject administrator for assistance.&quot;  
      
    
*   Server log for the command &quot;Started PATCH &quot;/api/v3/work\_packages/4306&quot;  yield  &quot;SystemStackError (stack level too deep):&quot; + a stacktrace (attached server.log)

### What is the expected behavior?

1.  The workpackage should be moved under and assigned to the intended parent. 

### Screenshots and other files

see below in files section

### Environment information

_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_

**OpenProject installation type**

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

**OpenProject version**

12.2.1

**Browser**

*   [ ] Chrome
*   [x] Firefox
*   [ ] Safari
*   [ ] Mobile Safari
*   [ ] Other (please specify)

**Language**

German and English, in that order
