[Issue]: Updating tags with API fails and corrupts item until rescan #5314

Closed
opened 2026-02-07 01:40:57 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @danieldietsch on GitHub (Dec 14, 2023).

Please describe your bug

I am trying to write a small script to update tags of various items, in particular TV shows.
Using POST to /Items/{item_id} with JSON payload {"Tags": ["SomeTag"]} results in 400 response and Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL POST /Items/<item_id>. System.ArgumentNullException: Value cannot be null. (Parameter 'source').
Afterwards, the TV show cannot be accessed anymore (e.g., GET /Users/<userid>/Items/<itemid> also yields System.ArgumentNullException: Value cannot be null. (Parameter 'source')).
Rescanning the library fixes this, but the tag has not been added.

Jellyfin Version

10.8.z

if other:

No response

Environment

- OS: Gentoo
- Linux Kernel: 6.5.10
- Virtualization: Docker
- Clients: API

Jellyfin logs

jellyfin  | [14:13:43] [ERR] [28] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL POST /Items/<id>.
jellyfin  | System.ArgumentNullException: Value cannot be null. (Parameter 'source')
jellyfin  |    at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
jellyfin  |    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
jellyfin  |    at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(BaseItemDto request, BaseItem item)
jellyfin  |    at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(Guid itemId, BaseItemDto request)
jellyfin  |    at lambda_method1617(Closure , Object )
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
jellyfin  | --- End of stack trace from previous location ---
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
jellyfin  | --- End of stack trace from previous location ---
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
jellyfin  |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
jellyfin  |    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
jellyfin  |    at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
jellyfin  |    at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
jellyfin  |    at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
jellyfin  |    at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
jellyfin  |    at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
jellyfin  |    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
jellyfin  |    at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
jellyfin  |    at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
jellyfin  |    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
jellyfin  |    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
jellyfin  |    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
jellyfin  |    at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
jellyfin  |    at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
jellyfin  |    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
jellyfin  |    at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
jellyfin  |    at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Originally created by @danieldietsch on GitHub (Dec 14, 2023). ### Please describe your bug I am trying to write a small script to update tags of various items, in particular TV shows. Using POST to /Items/{item_id} with JSON payload `{"Tags": ["SomeTag"]}` results in 400 response and ``Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL POST /Items/<item_id>. System.ArgumentNullException: Value cannot be null. (Parameter 'source')``. Afterwards, the TV show cannot be accessed anymore (e.g., ``GET /Users/<userid>/Items/<itemid>`` also yields ``System.ArgumentNullException: Value cannot be null. (Parameter 'source')``). Rescanning the library fixes this, but the tag has not been added. ### Jellyfin Version 10.8.z ### if other: _No response_ ### Environment ```markdown - OS: Gentoo - Linux Kernel: 6.5.10 - Virtualization: Docker - Clients: API ``` ### Jellyfin logs ```shell jellyfin | [14:13:43] [ERR] [28] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL POST /Items/<id>. jellyfin | System.ArgumentNullException: Value cannot be null. (Parameter 'source') jellyfin | at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) jellyfin | at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) jellyfin | at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(BaseItemDto request, BaseItem item) jellyfin | at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(Guid itemId, BaseItemDto request) jellyfin | at lambda_method1617(Closure , Object ) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() jellyfin | --- End of stack trace from previous location --- jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() jellyfin | --- End of stack trace from previous location --- jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) jellyfin | at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) jellyfin | at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) jellyfin | at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) jellyfin | at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) jellyfin | at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) jellyfin | at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager) jellyfin | at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) jellyfin | at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) jellyfin | at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) jellyfin | at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) jellyfin | at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) jellyfin | at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) jellyfin | at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) jellyfin | at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) jellyfin | at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) jellyfin | at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) jellyfin | at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) jellyfin | at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context) ``` ### FFmpeg logs _No response_ ### Please attach any browser or client logs here _No response_ ### Please attach any screenshots here _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct
OVERLORD added the bugstale labels 2026-02-07 01:40:57 +03:00
Author
Owner

@Erotemic commented on GitHub (Jan 2, 2024):

I think I'm also having a similar issue.

I want to programatically update some metadata. I have a MWE:

    export MY_TOKEN_VALUE=................................
    export MY_ITEM_ID=........-....-....-....-............
    export JELLYFIN_URL=localhost:8096

    curl -i -X 'POST' \
      "${JELLYFIN_URL}/Items/${MY_ITEM_ID}" \
      -H 'accept: */*' \
      -H "Authorization: MediaBrowser Token=\"${MY_TOKEN_VALUE}\"" \
      -H 'Content-Type: application/json' \
      -d '{"OriginalTitle": "Foobar"}'

replace MY_TOKEN_VALUE with an access token and replace MY_ITEM_ID with an item id in your library (it seems like the dashes in the UUID might matter? Not 100% sure on that). Then in the json body I'm just setting the "OriginalTitle" field to "Foobar" as a test.

Before I run this I can click the item and look at it in the web browser. After I run the curl command I get:

HTTP/1.1 400 Bad Request
Content-Type: text/plain
Date: Tue, 02 Jan 2024 20:25:22 GMT
Server: Kestrel
Transfer-Encoding: chunked
X-Response-Time-ms: 11

Error processing request.

And then if I click the item in the browser again it locks up and just gives a spinning circle.

But if I open a new page, and rescan the library the item is accessable again (although the metadata has not been updated).

On the sever, running journalctl -u jellyfin.service I see similar error messages as the original issue, with the imporant error seeming to be: System.ArgumentNullException: Value cannot be null. (Parameter 'source').

Full output in details:

Jan 02 15:11:53 Ooo jellyfin[126224]: [15:11:53] [ERR] Error processing request. URL POST /Items/<id>.
Jan 02 15:11:53 Ooo jellyfin[126224]: System.ArgumentNullException: Value cannot be null. (Parameter 'source')
Jan 02 15:11:53 Ooo jellyfin[126224]:    at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(BaseItemDto request, BaseItem item)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(Guid itemId, BaseItemDto request)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at lambda_method1944(Closure , Object )
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
Jan 02 15:11:53 Ooo jellyfin[126224]: --- End of stack trace from previous location ---
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
Jan 02 15:11:53 Ooo jellyfin[126224]: --- End of stack trace from previous location ---
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
Jan 02 15:11:53 Ooo jellyfin[126224]:    at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

Software Info:

Version: 10.8.13
Operating System: Linux
Architecture: X64
@Erotemic commented on GitHub (Jan 2, 2024): I think I'm also having a similar issue. I want to programatically update some metadata. I have a MWE: ```bash export MY_TOKEN_VALUE=................................ export MY_ITEM_ID=........-....-....-....-............ export JELLYFIN_URL=localhost:8096 curl -i -X 'POST' \ "${JELLYFIN_URL}/Items/${MY_ITEM_ID}" \ -H 'accept: */*' \ -H "Authorization: MediaBrowser Token=\"${MY_TOKEN_VALUE}\"" \ -H 'Content-Type: application/json' \ -d '{"OriginalTitle": "Foobar"}' ``` replace `MY_TOKEN_VALUE` with an [access token](https://gist.github.com/nielsvanvelzen/ea047d9028f676185832e51ffaf12a6f) and replace `MY_ITEM_ID` with an item id in your library (it seems like the dashes in the UUID might matter? Not 100% sure on that). Then in the json body I'm just setting the "OriginalTitle" field to "Foobar" as a test. Before I run this I can click the item and look at it in the web browser. After I run the curl command I get: ``` HTTP/1.1 400 Bad Request Content-Type: text/plain Date: Tue, 02 Jan 2024 20:25:22 GMT Server: Kestrel Transfer-Encoding: chunked X-Response-Time-ms: 11 Error processing request. ``` And then if I click the item in the browser again it locks up and just gives a spinning circle. But if I open a new page, and rescan the library the item is accessable again (although the metadata has not been updated). On the sever, running `journalctl -u jellyfin.service` I see similar error messages as the original issue, with the imporant error seeming to be: `System.ArgumentNullException: Value cannot be null. (Parameter 'source')`. Full output in details: <details> ``` Jan 02 15:11:53 Ooo jellyfin[126224]: [15:11:53] [ERR] Error processing request. URL POST /Items/<id>. Jan 02 15:11:53 Ooo jellyfin[126224]: System.ArgumentNullException: Value cannot be null. (Parameter 'source') Jan 02 15:11:53 Ooo jellyfin[126224]: at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) Jan 02 15:11:53 Ooo jellyfin[126224]: at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(BaseItemDto request, BaseItem item) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Api.Controllers.ItemUpdateController.UpdateItem(Guid itemId, BaseItemDto request) Jan 02 15:11:53 Ooo jellyfin[126224]: at lambda_method1944(Closure , Object ) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() Jan 02 15:11:53 Ooo jellyfin[126224]: --- End of stack trace from previous location --- Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Jan 02 15:11:53 Ooo jellyfin[126224]: --- End of stack trace from previous location --- Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) Jan 02 15:11:53 Ooo jellyfin[126224]: at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext) Jan 02 15:11:53 Ooo jellyfin[126224]: at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Jan 02 15:11:53 Ooo jellyfin[126224]: at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Jan 02 15:11:53 Ooo jellyfin[126224]: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) Jan 02 15:11:53 Ooo jellyfin[126224]: at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context) ``` </details> Software Info: ``` Version: 10.8.13 Operating System: Linux Architecture: X64 ```
Author
Owner

@Erotemic commented on GitHub (Jan 3, 2024):

@danieldietsch After debugging with folks in the matrix chat, I think I found the issue.

The null exception is from: https://github.com/jellyfin/jellyfin/blob/release-10.8.z/Jellyfin.Api/Controllers/ItemUpdateController.cs#L303

The ItemUpdate POST to POST to /Items/{item_id} requires that you pass ALL of the information to it. Anything you don't pass is nulled. From @nielsvanvelzen in the chat:

I'm quite sure the bad request is because you didn't provide the ProviderIds, which means you likely did not retrieve the item first via the API. What you should do is

  1. Get the item via the API
  2. Modify the fields you want to change
  3. Update the item with ALL its data
    If you don't get the current data first you will basically delete all information from the item
    And before you tell me: yes this API is insane and stupid

I did this via the Python API:

from jellyfin_apiclient_python import JellyfinClient
from jellyfin_apiclient_python import http

import logging
# Verbose logging
http.LOG.setLevel(logging.DEBUG)

# MODIFY CREDENTIALS
url = 'http://192.168.1.2:8096'
username = 'yourusername'
password = 'yourpassword'

# Login
client = JellyfinClient()
client.config.app(
    name='DemoApp',
    version='0.0.1',
    device_name='machine_name',
    device_id='unique_id')
client.config.data["auth.ssl"] = True

client.auth.connect_to_address(url)
client.auth.login(url, username, password)


chosen_item_id = '...'  # Choose Your ItemId

# Get all information from the API
body = client.jellyfin.get_items([chosen_item_id])['Items'][0]

# Modify properties you want
body['OriginalTitle'] = "NewCustomTitle"

# POST with the new information
handler = 'Items/' + body['Id']
client.jellyfin._post(handler, params=None, json=body)
@Erotemic commented on GitHub (Jan 3, 2024): @danieldietsch After debugging with folks in the matrix chat, I think I found the issue. The null exception is from: https://github.com/jellyfin/jellyfin/blob/release-10.8.z/Jellyfin.Api/Controllers/ItemUpdateController.cs#L303 The [ItemUpdate](https://api.jellyfin.org/#tag/ItemUpdate/operation/UpdateItem) POST to `POST to /Items/{item_id}` requires that you pass ALL of the information to it. Anything you don't pass is nulled. From @nielsvanvelzen in the chat: > I'm quite sure the bad request is because you didn't provide the ProviderIds, which means you likely did not retrieve the item first via the API. What you should do is > 1. Get the item via the API > 2. Modify the fields you want to change > 3. Update the item with ALL its data > If you don't get the current data first you will basically delete all information from the item And before you tell me: yes this API is insane and stupid I did this via the Python API: ```python from jellyfin_apiclient_python import JellyfinClient from jellyfin_apiclient_python import http import logging # Verbose logging http.LOG.setLevel(logging.DEBUG) # MODIFY CREDENTIALS url = 'http://192.168.1.2:8096' username = 'yourusername' password = 'yourpassword' # Login client = JellyfinClient() client.config.app( name='DemoApp', version='0.0.1', device_name='machine_name', device_id='unique_id') client.config.data["auth.ssl"] = True client.auth.connect_to_address(url) client.auth.login(url, username, password) chosen_item_id = '...' # Choose Your ItemId # Get all information from the API body = client.jellyfin.get_items([chosen_item_id])['Items'][0] # Modify properties you want body['OriginalTitle'] = "NewCustomTitle" # POST with the new information handler = 'Items/' + body['Id'] client.jellyfin._post(handler, params=None, json=body) ```
Author
Owner

@jellyfin-bot commented on GitHub (May 2, 2024):

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

@jellyfin-bot commented on GitHub (May 2, 2024): This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs. If you have any questions you can use one of several ways to [contact us](https://jellyfin.org/contact).
Author
Owner

@Erotemic commented on GitHub (May 2, 2024):

I don't think this has been fixed yet. I think an actual fix will be hard without breaking backwards compatibility, but at the very least some notes should be added to the API documentation.

@Erotemic commented on GitHub (May 2, 2024): I don't think this has been fixed yet. I think an actual fix will be hard without breaking backwards compatibility, but at the very least some notes should be added to the API documentation.
Author
Owner

@nielsvanvelzen commented on GitHub (May 2, 2024):

We've discussed this in chat and determined this is not a bug. The API was intentionally designed to receive the complete item data.
A pull request to add a note about this behavior to the API would be accepted.

@nielsvanvelzen commented on GitHub (May 2, 2024): We've discussed this in chat and determined this is not a bug. The API was intentionally designed to receive the complete item data. A pull request to add a note about this behavior to the API would be accepted.
Author
Owner

@lrsvmb commented on GitHub (Jun 28, 2025):

For anyone wondering how to achieve that in the typescript-sdk, you'll need to include ALL the fields:

await getItemsApi(api).getItems({
  ids: [// your ids //],
  fields: Object.keys(ItemFields) as ItemFields[], // !! This creates a list of all possible item fields to retrieve
})

Then you can update the tags:

await getItemUpdateApi(api).updateItem({
  itemId: // item id //,
  baseItemDto: item, // The item from before
})
@lrsvmb commented on GitHub (Jun 28, 2025): For anyone wondering how to achieve that in the `typescript-sdk`, you'll need to include **ALL** the fields: ```typescript await getItemsApi(api).getItems({ ids: [// your ids //], fields: Object.keys(ItemFields) as ItemFields[], // !! This creates a list of all possible item fields to retrieve }) ``` Then you can update the tags: ```typescript await getItemUpdateApi(api).updateItem({ itemId: // item id //, baseItemDto: item, // The item from before }) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#5314