Skip to content

ImmichFrame crashes on missing metadata Immich asset #641

@Girtab2

Description

@Girtab2

Version

v1.0.33.0

Deployment Method

Docker

Description

ImmichFrame (in Docker) crashes if certain exif metadata is missing or is null in the response while retrieving an asset as part of a memory.

Error at /source/ImmichFrame.Core/Logic/Pool/MemoryAssetsPool.cs:line 35

Reproduction

Have an asset with invalid metadata in Immich. Immich v2.7.5 (latest).

Image

C:\Users\Mister>curl -H "x-api-key: xxx" https://xxx.yyy.com:443/api/assets/5f942dda-13d6-463d-8bd5-3bdbb98a629a
{"id":"5f942dda-13d6-463d-8bd5-3bdbb98a629a","createdAt":"2024-01-02T20:16:15.344Z","deviceAssetId":"258DD64F-5823-4D0A-A747-E9BCA70F6068/L0/001","ownerId":"c72e8fde-0fc2-4165-9033-92cfa2f0e545","owner":{"id":"c72e8fde-0fc2-4165-9033-92cfa2f0e545","email":"abc@gmail.com","name":"abc","profileImagePath":"","avatarColor":"yellow","profileChangedAt":"2024-10-03T08:00:08.311409+00:00"},"deviceId":"8c81c29b3f2d32b763687465a0fcc702fdbb131b4c6e2828ed311ac556a783b0","libraryId":null,"type":"IMAGE","originalPath":"/data/upload/c72e8fde-0fc2-4165-9033-92cfa2f0e545/cd2aeb51-9de0-488e-a84b-d1f2bdfb367f.HEIC","originalFileName":"IMG_4256.HEIC","originalMimeType":"image/heic","thumbhash":"3BgGDQIaNJ6X+5nGhoqnh1mfhHIG","fileCreatedAt":"2023-05-06T09:49:59.000Z","fileModifiedAt":"2023-05-17T21:34:33.000Z","localDateTime":"2023-05-06T09:49:59.000Z","updatedAt":"2026-04-19T05:40:42.544Z","isFavorite":false,"isArchived":false,"isTrashed":false,"visibility":"timeline","duration":"0:00:00.000000","livePhotoVideoId":null,"tags":[],"people":[],"unassignedFaces":[],"checksum":"ahztmaeiYz7r9LHUMThWYZdTYm0=","stack":null,"isOffline":false,"hasMetadata":true,"duplicateId":null,"resized":true,"width":null,"height":null,"isEdited":false}

Application crashes while trying to load the memory asset. ImmichFrame on Frameo shows sad smiley. I cannot get it to load in a web browser. Docker logs show error at ImmichFrame.Core.Logic.Pool.MemoryAssetsPool.LoadAssets
Solution: In Immich press the button to refresh the metadata for this asset.

Image

C:\Users\Mister>curl -H "x-api-key: xxx" https://xxx.yyy.com:443/api/assets/5f942dda-13d6-463d-8bd5-3bdbb98a629a
{"id":"5f942dda-13d6-463d-8bd5-3bdbb98a629a","createdAt":"2024-01-02T20:16:15.344Z","deviceAssetId":"258DD64F-5823-4D0A-A747-E9BCA70F6068/L0/001","ownerId":"c72e8fde-0fc2-4165-9033-92cfa2f0e545","owner":{"id":"c72e8fde-0fc2-4165-9033-92cfa2f0e545","email":"abc@gmail.com","name":"abc","profileImagePath":"","avatarColor":"yellow","profileChangedAt":"2024-10-03T08:00:08.311409+00:00"},"deviceId":"8c81c29b3f2d32b763687465a0fcc702fdbb131b4c6e2828ed311ac556a783b0","libraryId":null,"type":"IMAGE","originalPath":"/data/library/abc/2023/2023-05-06/IMG_4256.heic","originalFileName":"IMG_4256.HEIC","originalMimeType":"image/heic","thumbhash":"3BgGDQIaNJ6X+5nGhoqnh1mfhHIG","fileCreatedAt":"2023-05-06T09:49:59.833Z","fileModifiedAt":"2024-01-02T20:16:15.333Z","localDateTime":"2023-05-06T11:49:59.833Z","updatedAt":"2026-05-07T19:56:50.314Z","isFavorite":false,"isArchived":false,"isTrashed":false,"visibility":"timeline","duration":"0:00:00.00000","exifInfo":{"make":"Apple","model":"iPhone 12","exifImageWidth":4032,"exifImageHeight":3024,"fileSizeInByte":2328582,"orientation":"6","dateTimeOriginal":"2023-05-06T09:49:59.833+00:00","modifyDate":"2024-01-02T20:16:15.333+00:00","timeZone":"UTC+2","lensModel":"iPhone 12 back dual wide camera 4.2mm f/1.6","fNumber":1.6,"focalLength":4.2,"iso":125,"exposureTime":"1/121","latitude":null,"longitude":null,"city":null,"state":null,"country":null,"description":"","projectionType":null,"rating":null},"livePhotoVideoId":null,"tags":[],"people":[],"unassignedFaces":[],"checksum":"ahztmaeiYz7r9LHUMThWYZdTYm0=","stack":null,"isOffline":false,"hasMetadata":true,"duplicateId":null,"resized":true,"width":3024,"height":4032,"isEdited":false}

Image

Expectations

ImmichFrame to handle these kind of exceptions and not fatally crash, maybe skip the asset?

Configuration

{
  "General": {
    "AuthenticationSecret": "xxx",
    "PhotoDateFormat": "dd/MM/yyyy",
    "WeatherApiKey": "xxx",
    "UnitSystem": "metric",
    "WeatherLatLong": "xx.xx,xx.xx",
        "Language": "nl",
    "Interval": 60,
    "TransitionDuration": 2,
    "ShowClock": true,
    "ClockFormat": "HH:mm",
    "ClockDateFormat": "eee, MMM d",
    "ShowProgressBar": false,
    "ShowPhotoDate": true,
    "ShowImageDesc": false,
    "ShowPeopleDesc": false,
    "ShowAlbumName": false,
    "ShowImageLocation": false,
    "Style": "none",
    "BaseFontSize": "20px",
    "ShowWeatherDescription": true,
    "ImageZoom": true,
    "Layout": "single"
  },
  "Accounts": [
    {
      "ImmichServerUrl": "http://immich_server:2283",
      "ApiKey": "xxx",
      "ImagesFromDate": "2013-11-01",
      "ShowMemories": true,
      "ShowFavorites": true,
      "Albums": [
        "473edd82-7845-45fd-851c-56540325b0d9"
      ]
    }
  ]
}

Logs

26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.LogicalHandler[100] Start processing HTTP request GET http://immich_server:2283/api/assets/f974d4e7-bcfc-4fbb-a8fa-796c0954ea4b 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.ClientHandler[100] Sending HTTP request GET http://immich_server:2283/api/assets/f974d4e7-bcfc-4fbb-a8fa-796c0954ea4b 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.ClientHandler[101] Received HTTP response headers after 20.1805ms - 200 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.LogicalHandler[101] End processing HTTP request after 20.4502ms - 200 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.LogicalHandler[100] Start processing HTTP request GET http://immich_server:2283/api/assets/5f942dda-13d6-463d-8bd5-3bdbb98a629a 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.ClientHandler[100] Sending HTTP request GET http://immich_server:2283/api/assets/5f942dda-13d6-463d-8bd5-3bdbb98a629a 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.ClientHandler[101] Received HTTP response headers after 22.261ms - 200 26-05-07 21:07:07 info: System.Net.Http.HttpClient.ImmichApiAccountClient.LogicalHandler[101] End processing HTTP request after 22.7483ms - 200 26-05-07 21:07:07 fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HNLCDEMAUNT6", Request id "0HNLCDEMAUNT6:00000004": An unhandled exception was thrown by the application. System.NullReferenceException: Object reference not set to an instance of an object. at ImmichFrame.Core.Logic.Pool.MemoryAssetsPool.LoadAssets(CancellationToken ct) in /source/ImmichFrame.Core/Logic/Pool/MemoryAssetsPool.cs:line 35 at ImmichFrame.Core.Helpers.AssetExtensionMethods.ApplyAccountFilters(Task1 unfilteredAssets, IAccountSettings accountSettings, IEnumerable1 excludedAlbumAssets) in /source/ImmichFrame.Core/Helpers/AssetExtensionMethods.cs:line 15 at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func2 factory, MemoryCacheEntryOptions createOptions) at ImmichFrame.Core.Logic.Pool.CachingApiAssetsPool.AllAssets(CancellationToken ct) in /source/ImmichFrame.Core/Logic/Pool/CachingApiAssetsPool.cs:line 25 at ImmichFrame.Core.Logic.Pool.CachingApiAssetsPool.GetAssetCount(CancellationToken ct) in /source/ImmichFrame.Core/Logic/Pool/CachingApiAssetsPool.cs:line 13 at ImmichFrame.Core.Logic.Pool.MultiAssetPool.GetAssetCount(CancellationToken ct) in /source/ImmichFrame.Core/Logic/Pool/MultiAssetPool.cs:line 11 at ImmichFrame.Core.Logic.AccountSelection.TotalAccountImagesSelectionStrategy.GetWeights(IList1 accounts) in /source/ImmichFrame.Core/Logic/AccountSelection/TotalAccountImagesSelectionStrategy.cs:line 34 at ImmichFrame.Core.Logic.AccountSelection.TotalAccountImagesSelectionStrategy.GetProportions(IList1 accounts) in /source/ImmichFrame.Core/Logic/AccountSelection/TotalAccountImagesSelectionStrategy.cs:line 40 at ImmichFrame.Core.Logic.AccountSelection.TotalAccountImagesSelectionStrategy.GetAssets() in /source/ImmichFrame.Core/Logic/AccountSelection/TotalAccountImagesSelectionStrategy.cs:line 51 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_method19(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, ValueTask1 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](IHttpApplication1 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions