# Bug OP-1773 - Sorting by version leads to 500 in experimental API ("Unable to retrieve query from URL")

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 4.0.5 |
| Observed in versions |  |
| Sprint | 4.0.5 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| 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

**Preconditions**

  - Work package module activated.

**Steps to reproduce**

1.  Go to work package page.
2.  Sort by version (either ascending or descending)
3.  Save query.
4.  Go to saved query and then to “work packages” (either in same project or in global work package page)

**Actual behavior**

  - Internal error (500) when creating query (in some cases) and internal query when first going to saved query and then to work packges.

**Expected behavior**

  - No internal error / error message.

**Screenshot**  
![](Bug_Version-Sorting.png)

**QA system**

  - openproject-org.qa.finn.de
  - OpenProject 4.0.4
