Could not deserialize the response body stream

オープン
#672 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp, docker
領域
backend

調査の方向性

Start with the generated API client deserialization at ImmichFrame.Core/obj/immich-openapi-specsClient.cs and the asset-fetching path in ImmichFrame.Core/Logic/Pool/AllAssetsPool.cs; inspect how the Immich response represents duration for images. The report reproduces the failure with a Docker/web deployment and includes the exception. Done when the response no longer fails to deserialize and asset loading works for images with duration 0:00:00.00000.

索引モデルが issue の本文から書いたものです。

説明

bug
Version

1.0.35.0

Deployment Method

Docker/web

Description

When running ImmichFrame in Docker via web, it will give an error Looks like your immich-server is offline or you misconfigured immichFrame. Check the container logs.

After investigation it turns out ImmichFrame gives an error on the Duration of files returned by Immich. Newtonsoft.Json.JsonReaderException: Could not convert string to integer: 0:00:00.00000. Path '[0].duration' All static files (images) have a duration of 0:00:00.00000. I don't know why this happens since it happened without updating. But after updating (both Immich and ImmichFrame) the error remains.

Reproduction

Install the Docker image, run and visit ImmichFrame. The error shows.

Expectations

No response

Configuration
General:
  AuthenticationSecret: null
  DownloadImages: false
  RenewImagesDuration: 30
  RefreshAlbumPeopleInterval: 1
  PhotoDateFormat: dd-MM-yyyy
  ImageLocationFormat: 'City,State,Country'
  #WeatherApiKey: ''
  UnitSystem: metric
  #WeatherLatLong: '40.730610,-73.935242'
  #Webhook: null
  Language: en
  Interval: 45
  TransitionDuration: 2
  ShowClock: false
  ClockFormat: 'hh:mm'
  ClockDateFormat: 'eee, MMM d'
  ShowProgressBar: false
  ShowPhotoDate: true
  ShowImageDesc: true
  ShowPeopleDesc: false
  ShowAlbumName: true
  ShowImageLocation: true
  PrimaryColor: '#dce7ea'
  SecondaryColor: '#000000'
  Style: 'blur'
  BaseFontSize: 26px
  ShowWeatherDescription: true
  WeatherIconUrl: 'https://openweathermap.org/img/wn/{IconId}.png'
  ImageZoom: false
  ImagePan: false
  ImageFill: true
  PlayAudio: false
  Layout: splitview
Accounts:
  - ImmichServerUrl: 'https://immich.domain.local'
# Exactly one of ApiKey or ApiKeyFile must be set.
    ApiKey: "xxxxxkeyxxxxx"
    # ApiKeyFile: "/path/to/api.key"

    ImagesFromDate: '2010-01-01'
    ShowMemories: false
    ShowFavorites: false
    ShowArchived: false
    ShowVideos: false
    ImagesFromDays: null
    ImagesUntilDate: null
    Rating: null
    #Albums:
    #  - UUID
    #ExcludedAlbums:
    #  - UUID
    #People:
    #  - UUID
    #Tags:
    #  - "tag"
Logs
26-07-11 11:16:09 fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HNMV5K5IPKBP", Request id "0HNMV5K5IPKBP:00000001": An unhandled exception was thrown by the application. HTTP Response:     ImmichFrame.Core.Api.ApiException: Could not deserialize the response body stream as System.Collections.Generic.ICollection`1[[ImmichFrame.Core.Api.AssetResponseDto, ImmichFrame.Core, Version=1.0.35.0, Culture=neutral, PublicKeyToken=null]].  Status: 200 Response:    ---> Newtonsoft.Json.JsonReaderException: Could not convert string to integer: 0:00:00.00000. Path '[0].duration', line 1, position 682.    at Newtonsoft.Json.JsonReader.ReadInt32String(String s)    at Newtonsoft.Json.JsonTextReader.FinishReadQuotedNumber(ReadType readType)    at Newtonsoft.Json.JsonTextReader.ReadNumberValue(ReadType readType)    at Newtonsoft.Json.JsonTextReader.ReadAsInt32()    at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)    at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)    at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)    at ImmichFrame.Core.Api.ImmichApi.ReadObjectResponseAsync[T](HttpResponseMessage response, IReadOnlyDictionary`2 headers, CancellationToken cancellationToken) in /source/ImmichFrame.Core/obj/immich-openapi-specsClient.cs:line 24671    --- End of inner exception stack trace ---    at ImmichFrame.Core.Api.ImmichApi.ReadObjectResponseAsync[T](HttpResponseMessage response, IReadOnlyDictionary`2 headers, CancellationToken cancellationToken) in /source/ImmichFrame.Core/obj/immich-openapi-specsClient.cs:line 24679    at ImmichFrame.Core.Api.ImmichApi.SearchRandomAsync(RandomSearchDto body, CancellationToken cancellationToken) in /source/ImmichFrame.Core/obj/immich-openapi-specsClient.cs:line 16083    at ImmichFrame.Core.Logic.Pool.AllAssetsPool.GetAssets(Int32 requested, CancellationToken ct) in /source/ImmichFrame.Core/Logic/Pool/AllAssetsPool.cs:line 63    at ImmichFrame.Core.Logic.PooledImmichFrameLogic.GetAssets() in /source/ImmichFrame.Core/Logic/PooledImmichFrameLogic.cs:line 75    at ImmichFrame.Core.Logic.AccountSelection.TotalAccountImagesSelectionStrategy.<>c__DisplayClass9_0.<<GetAssets>b__2>d.MoveNext() in /source/ImmichFrame.Core/Logic/AccountSelection/TotalAccountImagesSelectionStrategy.cs:line 61 --- End of stack trace from previous location ---    at ImmichFrame.Core.Logic.AccountSelection.TotalAccountImagesSelectionStrategy.GetAssets() in /source/ImmichFrame.Core/Logic/AccountSelection/TotalAccountImagesSelectionStrategy.cs:line 66    at ImmichFrame.Core.Logic.MultiImmichFrameLogicDelegate.GetAssets() in /source/ImmichFrame.Core/Logic/MultiImmichFrameLogicDelegate.cs:line 35    at ImmichFrame.WebApi.Controllers.AssetController.GetAssets(String clientIdentifier) in /source/ImmichFrame.WebApi/Controllers/AssetController.cs:line 42    at lambda_method11(Closure, Object)    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)    at CustomAuthenticationMiddleware.InvokeAsync(HttpContext context) in /source/ImmichFrame.WebApi/Helpers/CustomAuthenticationMiddleware.cs:line 23    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Pre-Submission Checklist
  • This is a bug report and not a feature request

  • I have provided all of the required information to reproduce the bug (config, logs, etc.)

  • I have checked for related issues and checked the documentation

主要言語
C#
スター
2.4k
フォーク
121
平均マージ
18日 20時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

immichFrame/ImmichFrame のほかの issue

immichFrame/ImmichFrame の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。