Lidarr unable to show activity queue after sorting by Artist #1312

Closed
opened 2026-02-20 01:14:05 -05:00 by deekerman · 2 comments
Owner

Originally created by @OgreMHDW on GitHub (Dec 18, 2020).

Originally assigned to: @Qstick on GitHub.

Describe the bug
I tried to sort the activity queue page by artist. After doing that, I now receive the error "Failed to load Queue" when selecting that page.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Activity then Queue'
  2. Click on 'Artist column to sort'
  3. Reopen Activity Queue.
  4. See error "Failed to load Queue"

Expected behavior
Items in the download queue listed.

Screenshots
image

Platform Information (please complete the following information):

  • OS: Windows 10 Pro
  • Docker: No
  • .NET Core - Yes (3.1.7)
  • Lidarr Version - 0.8.0.1948
  • Lidarr Branch - nightly

Event Logs
Message:
API Error: BadRequest: Invalid sort key artists.sortName
Exception:
Lidarr.Http.REST.BadRequestException: BadRequest: Invalid sort key artists.sortName
at Lidarr.Http.REST.RestModule1.ReadPagingResourceFromRequest() in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 314 at Lidarr.Http.REST.RestModule1.<set_GetResourcePaged>b__37_0(Object options) in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 169
at Nancy.NancyModule.<>c__DisplayClass14_01.<Get>b__0(Object args) at Nancy.NancyModule.<>c__DisplayClass16_01.b__0(Object args, CancellationToken ct)
at Nancy.Routing.Route`1.Invoke(DynamicDictionary parameters, CancellationToken cancellationToken)
at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary parameters, NancyContext context)
at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken)
at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pipelines)

Trace Logs
20-12-18 17:32:30.9|Trace|Http|Req: 5 [GET] /api/v1/queue?page=1&pageSize=20&sortDirection=descending&sortKey=artists.sortName&includeUnknownArtistItems=false (from ::ffff:192.168.56.106 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36)
20-12-18 17:32:31.1|Trace|LidarrErrorPipeline|Handling Exception
20-12-18 17:32:31.1|Warn|LidarrErrorPipeline|API Error

[v0.8.0.1948] Lidarr.Http.REST.BadRequestException: BadRequest: Invalid sort key artists.sortName
at Lidarr.Http.REST.RestModule1.ReadPagingResourceFromRequest() in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 314 at Lidarr.Http.REST.RestModule1.<set_GetResourcePaged>b__37_0(Object options) in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 169
at Nancy.NancyModule.<>c__DisplayClass14_01.<Get>b__0(Object args) at Nancy.NancyModule.<>c__DisplayClass16_01.b__0(Object args, CancellationToken ct)
at Nancy.Routing.Route`1.Invoke(DynamicDictionary parameters, CancellationToken cancellationToken)
at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary parameters, NancyContext context)
at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken)
at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pipelines)

Originally created by @OgreMHDW on GitHub (Dec 18, 2020). Originally assigned to: @Qstick on GitHub. **Describe the bug** I tried to sort the activity queue page by artist. After doing that, I now receive the error "Failed to load Queue" when selecting that page. **To Reproduce** Steps to reproduce the behavior: 1. Go to 'Activity then Queue' 2. Click on 'Artist column to sort' 3. Reopen Activity Queue. 4. See error "Failed to load Queue" **Expected behavior** Items in the download queue listed. **Screenshots** ![image](https://user-images.githubusercontent.com/4369476/102677292-a1a6fb00-4156-11eb-9488-ab8f7d6984fa.png) **Platform Information (please complete the following information):** - OS: Windows 10 Pro - Docker: No - .NET Core - Yes (3.1.7) - Lidarr Version - 0.8.0.1948 - Lidarr Branch - nightly **Event Logs** Message: API Error: BadRequest: Invalid sort key artists.sortName Exception: Lidarr.Http.REST.BadRequestException: BadRequest: Invalid sort key artists.sortName at Lidarr.Http.REST.RestModule`1.ReadPagingResourceFromRequest() in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 314 at Lidarr.Http.REST.RestModule`1.<set_GetResourcePaged>b__37_0(Object options) in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 169 at Nancy.NancyModule.<>c__DisplayClass14_0`1.<Get>b__0(Object args) at Nancy.NancyModule.<>c__DisplayClass16_0`1.<Get>b__0(Object args, CancellationToken ct) at Nancy.Routing.Route`1.Invoke(DynamicDictionary parameters, CancellationToken cancellationToken) at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary parameters, NancyContext context) at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken) at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pipelines) **Trace Logs** 20-12-18 17:32:30.9|Trace|Http|Req: 5 [GET] /api/v1/queue?page=1&pageSize=20&sortDirection=descending&sortKey=artists.sortName&includeUnknownArtistItems=false (from ::ffff:192.168.56.106 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36) 20-12-18 17:32:31.1|Trace|LidarrErrorPipeline|Handling Exception 20-12-18 17:32:31.1|Warn|LidarrErrorPipeline|API Error [v0.8.0.1948] Lidarr.Http.REST.BadRequestException: BadRequest: Invalid sort key artists.sortName at Lidarr.Http.REST.RestModule`1.ReadPagingResourceFromRequest() in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 314 at Lidarr.Http.REST.RestModule`1.<set_GetResourcePaged>b__37_0(Object options) in D:\a\1\s\src\Lidarr.Http\REST\RestModule.cs:line 169 at Nancy.NancyModule.<>c__DisplayClass14_0`1.<Get>b__0(Object args) at Nancy.NancyModule.<>c__DisplayClass16_0`1.<Get>b__0(Object args, CancellationToken ct) at Nancy.Routing.Route`1.Invoke(DynamicDictionary parameters, CancellationToken cancellationToken) at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary parameters, NancyContext context) at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken) at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pipelines)
Author
Owner

@OgreMHDW commented on GitHub (Dec 18, 2020):

Also, note on this issue. As the user, I am unable to get back to the "default" sort when these type of issues occur? I would recommend an enhancement to have a "reset sort and filter button".
#1818

@OgreMHDW commented on GitHub (Dec 18, 2020): Also, note on this issue. As the user, I am unable to get back to the "default" sort when these type of issues occur? I would recommend an enhancement to have a "reset sort and filter button". #1818
Author
Owner

@Qstick commented on GitHub (Dec 18, 2020):

@ta264 You may want to look at a better fix for this, for some reason the properties for the artists table are never mapped into the allowable array... The following code gets hit for every table except "artists" when looping thru the tables

github.com/lidarr/Lidarr@eb5a95cfa6/src/NzbDrone.Core/Datastore/TableMapper.cs (L126)

For now I added it to the allowable sorts override in RestModule..

@Qstick commented on GitHub (Dec 18, 2020): @ta264 You may want to look at a better fix for this, for some reason the properties for the artists table are never mapped into the allowable array... The following code gets hit for every table except "artists" when looping thru the tables https://github.com/lidarr/Lidarr/blob/eb5a95cfa6044aba444614ffc71fe68ae7cba547/src/NzbDrone.Core/Datastore/TableMapper.cs#L126 For now I added it to the allowable sorts override in RestModule..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Lidarr#1312
No description provided.