immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
52.82k stars 2.8k forks source link

Image thumbnails fails to load when clicking timeline back / forth (failed promise) #13574

Open ygaeon opened 1 month ago

ygaeon commented 1 month ago

The bug

Image thumbnails fails to load when clicking timeline back / forth a few times (eg. while searching in the timeline).

Can observe Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split') in browser Console.

After which the entire UI is "frozen" and no longer works. A page reload is necessary.

I don't know if relevant but I have ~80k images between two users and one external library. The area where I scroll to contains the images from the external library.

Image of error

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.118.2

Version of Immich Mobile App

v1.118.0

Platform with the issue

Did not observe this in the mobile app.

Your docker-compose.yml content

N/A .. running podman

podman pod create --name $POD --hostname immich --publish 2283:2283

podman run -d --pod $POD --name immich_redis redis:6.2-alpine 

podman run -d --pod $POD --name immich_postgres --env-file $ENV --volume $DATA/postgres:/var/lib/postgresql/data tensorchord/pgvecto-rs:pg14-v0.2.0

podman run -d --pod $POD --name immich_machine_learning --env-file $ENV --volume $DATA/model-cache:/cache immich-machine-learning:$VER

podman run -d --pod $POD --name immich_server --env-file $ENV --volume $d/upload:/usr/src/app/upload --volume <EXT LIB PATH>:/mnt/photos:ro --volume /etc/localtime:/etc/localtime:ro immich-server:$VER

Your .env content

# General
TZ="Europe/Stockholm"

# Database
DB_HOSTNAME=immich_postgres
DB_USERNAME=immich
DB_PASSWORD=xxxxx

DB_DATABASE=immich
DB_DATABASE_NAME=immich

# Postgres
POSTGRES_USER=immich
POSTGRES_PASSWORD=xxxxx
POSTGRES_DB=immich

# Redis
REDIS_HOSTNAME=immich_redis

Reproduction steps

  1. Click in the timeline (in my case 2012)
  2. Click another part of the timeline (in my case 2013)
  3. Repeat 1 and 2 clicking different parts of the timeline
  4. Exception is observed in Console

Relevant log output

Brave browser exception # Brave browser exception ``` Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split') at bl (portal.BczTKgiU.js:1:7219) at Ke (thumbnail.BJilVSeS.js:1:19582) at Le (thumbnail.BJilVSeS.js:1:10817) at Object.p (thumbnail.BJilVSeS.js:1:22006) at yt (scheduler.7z7EQB7W.js:1:11059) at mt (scheduler.7z7EQB7W.js:1:10712) bl @ portal.BczTKgiU.js:1 Ke @ thumbnail.BJilVSeS.js:1 Le @ thumbnail.BJilVSeS.js:1 p @ thumbnail.BJilVSeS.js:1 yt @ scheduler.7z7EQB7W.js:1 mt @ scheduler.7z7EQB7W.js:1 Promise.then (async) ht @ scheduler.7z7EQB7W.js:1 ht @ index.DoTFCMjV.js:4 (anonymous) @ index.DoTFCMjV.js:4 Ce @ thumbnail.BJilVSeS.js:1 (anonymous) @ thumbnail.BJilVSeS.js:1 s @ shortcut.BJeuo_kK.js:1 (anonymous) @ shortcut.BJeuo_kK.js:1 setTimeout (async) scheduleDrainIntersectedQueue @ shortcut.BJeuo_kK.js:1 (anonymous) @ shortcut.BJeuo_kK.js:1 setTimeout (async) scheduleDrainIntersectedQueue @ shortcut.BJeuo_kK.js:1 (anonymous) @ shortcut.BJeuo_kK.js:1 setTimeout (async) scheduleDrainIntersectedQueue @ shortcut.BJeuo_kK.js:1 (anonymous) @ shortcut.BJeuo_kK.js:1 setTimeout (async) scheduleDrainIntersectedQueue @ shortcut.BJeuo_kK.js:1 queueScrollSensitiveTask @ shortcut.BJeuo_kK.js:1 scheduleIntersected @ shortcut.BJeuo_kK.js:1 intersectedThumbnail @ shortcut.BJeuo_kK.js:1 intersectedThumbnail @ shortcut.BJeuo_kK.js:1 st @ thumbnail.BJilVSeS.js:1 IntersectionObserver.rootMargin @ thumbnail.BJilVSeS.js:1 ```
Firefox browser exception # Firefox browser exception ``` 11:52:43.599 Uncaught (in promise) TypeError: e[2] is undefined Immutable 74 bl Ke Le p yt mt promise callback*ht ht ctx Ce st s drainIntersectedQueue queueScrollSensitiveTask scheduleIntersected intersectedThumbnail intersectedThumbnail st g jt Ve He Rt m _t m m p pe X Y pe p yt mt promise callback*ht ht ctx A a emit updateBucketDateGroup V s queueTimer setTimeout handler*scheduleDrainIntersectedQueue queueScrollSensitiveTask scheduleIntersected intersectedDateGroup intersectedDateGroup V k g jt Ve He Rt m m _t m p pe X Y pe p yt mt promise callback*ht ht ctx A a portal.BczTKgiU.js:1:7209 Immutable 25 mt (Async: promise callback) ht ht ctx Ce st s drainIntersectedQueue queueScrollSensitiveTask scheduleIntersected intersectedThumbnail intersectedThumbnail st g (Async: IntersectionCallback) jt Ve He Rt m _t m m p pe X forEach self-hosted:157 Immutable 34 Y pe p yt mt (Async: promise callback) ht ht ctx A a emit updateBucketDateGroup V s queueTimer (Async: setTimeout handler) scheduleDrainIntersectedQueue queueScrollSensitiveTask scheduleIntersected intersectedDateGroup intersectedDateGroup V k g (Async: IntersectionCallback) jt Ve He Rt m m _t m p pe X forEach self-hosted:157 Immutable 10 Y pe p yt mt (Async: promise callback) ht ht ctx A a ```
zynexiz commented 1 month ago

Just noticed the same, seems that the entire interface freezes. Can't change pages, jump to other times etc.

ygaeon commented 1 month ago

Exactly that @zynexiz .. same .. thanks for reminding me (Updated the main issue description)

zynexiz commented 1 month ago

Although, it doesn't seems to happen all the time. Scrolling thru albums doesn't crash it, but the number of images are lot less than my entire collection, so it could have something to do with the number of objects?

zynexiz commented 1 month ago

Seems like it could have something to do with this error? Did some testing, and as soon as this error occurred, the webpage failed.

Skärmbild_20241018_164005

[EDIT] Saw that you mentioned that in the report :)

krypton9208 commented 1 month ago

I have problem with stability after upgrade to 1.118.2 (from 1.117.0). I use helm-char to provide immich, thats logs from database container.... i using

  image:
    repository: tensorchord/pgvecto-rs
    tag: pg14-v0.2.0

LOGS before crash of container

2024-10-23T12:16:23.410671812Z PostgreSQL Database directory appears to contain a database; Skipping initialization

2024-10-23 12:16:24.305 UTC [1] LOG:  starting PostgreSQL 14.10 (Debian 14.10-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-10-23 12:16:24.307 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-10-23T12:16:24.307721996Z 2024-10-23 12:16:24.307 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2024-10-23 12:16:24.339 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-10-23 12:16:24.412 UTC [13] LOG:  database system was shut down at 2024-10-23 12:16:22 UTC
[2024-10-23T12:16:24Z INFO  service::utils::clean] Find directory "pg_vectors/indexes/873197".
2024-10-23T12:16:24.463944209Z [2024-10-23T12:16:24Z INFO  service::utils::clean] Find directory "pg_vectors/indexes/17336".
[2024-10-23T12:16:24Z INFO  service::utils::clean] Find directory "pg_vectors/indexes/873197/segments/405cfd17-c170-4df6-81d3-e560ced91c62".
2024-10-23T12:16:24.608379336Z 2024-10-23 12:16:24.607 UTC [1] LOG:  database system is ready to accept connections
2024-10-23T12:16:37.653001994Z [2024-10-23T12:16:37Z INFO  service::utils::clean] Find directory "pg_vectors/indexes/17336/segments/2d0f2d7d-600f-4271-89b2-b8945d5a1ca3".
2024-10-23T12:16:37.653198455Z [2024-10-23T12:16:37Z INFO  service::utils::clean] Delete outdated directory "pg_vectors/indexes/17336/segments/04dc78ea-c970-4a95-9a9f-e79c6a8919eb".
2024-10-23T12:16:37.705297318Z [2024-10-23T12:16:37Z INFO  service::utils::clean] Find directory "pg_vectors/indexes/17336/segments/8c8414a2-c4c0-4a2a-902f-4e91ebb3cbec".
2024-10-23T12:17:56.709638843Z 2024-10-23 12:17:56.704 UTC [144] LOG:  could not receive data from client: Connection reset by peer
2024-10-23 12:20:28.003 UTC [366] LOG:  could not receive data from client: Connection reset by peer
2024-10-23T12:24:06.304252344Z 2024-10-23 12:24:06.303 UTC [698] LOG:  could not receive data from client: Connection reset by peer
2024-10-23 12:24:16.103 UTC [712] LOG:  could not receive data from client: Connection reset by peer
2024-10-23 12:27:16.603 UTC [1] LOG:  received fast shutdown request
2024-10-23 12:27:16.612 UTC [1] LOG:  aborting any active transactions
2024-10-23T12:27:16.612902278Z 2024-10-23 12:27:16.612 UTC [848] FATAL:  terminating connection due to administrator command
2024-10-23 12:27:16.612 UTC [848] STATEMENT:  SELECT "album"."id" AS "album_id", MIN("assets"."fileCreatedAt") AS "start_date", MAX("assets"."fileCreatedAt") AS "end_date", COUNT("assets"."id") AS "asset_count" FROM "albums" "album" LEFT JOIN "albums_assets_assets" "album_assets" ON "album_assets"."albumsId" = "album"."id"  LEFT JOIN "assets" "assets" ON  "assets"."id" = "album_assets"."assetsId" AND "assets"."deletedAt" IS NULL WHERE ( "album"."id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) ) AND ( "album"."deletedAt" IS NULL ) GROUP BY "album"."id"
2024-10-23 12:27:16.705 UTC [844] FATAL:  terminating connection due to administrator command
2024-10-23 12:27:16.705 UTC [844] STATEMENT:  SELECT COUNT("asset"."id")::int AS "count", (date_trunc('month', (asset."localDateTime" at time zone 'UTC')) at time zone 'UTC')::timestamptz AS "timeBucket" FROM "assets" "asset" LEFT JOIN "exif" "exifInfo" ON "exifInfo"."assetId"="asset"."id"  LEFT JOIN "asset_stack" "stack" ON "stack"."id"="asset"."stackId"  LEFT JOIN "assets" "stackedAssets" ON "stackedAssets"."stackId"="stack"."id" AND ("stackedAssets"."deletedAt" IS NULL) WHERE ( "asset"."isVisible" = true AND "asset"."ownerId" IN ($1 ) AND "asset"."isArchived" = $2 ) AND ( "asset"."deletedAt" IS NULL ) GROUP BY (date_trunc('month', (asset."localDateTime" at time zone 'UTC')) at time zone 'UTC')::timestamptz ORDER BY (date_trunc('month', (asset."localDateTime" at time zone 'UTC')) at time zone 'UTC')::timestamptz DESC
2024-10-23 12:27:16.711 UTC [915] FATAL:  terminating connection due to administrator command
2024-10-23T12:27:16.715099846Z 2024-10-23 12:27:16.711 UTC [915] STATEMENT:  SELECT COUNT("asset"."id")::int AS "count", (date_trunc('month', (asset."localDateTime" at time zone 'UTC')) at time zone 'UTC')::timestamptz AS "timeBucket" FROM "assets" "asset" LEFT JOIN "exif" "exifInfo" ON "exifInfo"."assetId"="asset"."id"  LEFT JOIN "asset_stack" "stack" ON "stack"."id"="asset"."stackId"  LEFT JOIN "assets" "stackedAssets" ON "stackedAssets"."stackId"="stack"."id" AND ("stackedAssets"."deletedAt" IS NULL) WHERE ( "asset"."isVisible" = true AND "asset"."ownerId" IN ($1 ) AND "asset"."isArchived" = $2 ) AND ( "asset"."deletedAt" IS NULL ) GROUP BY (date_trunc('month', (asset."localDateTime" at time zone 'UTC')) at time zone 'UTC')::timestamptz ORDER BY (date_trunc('month', (asset."localDateTime" at time zone 'UTC')) at time zone 'UTC')::timestamptz DESC
2024-10-23T12:27:16.904433070Z 2024-10-23 12:27:16.904 UTC [1] LOG:  background worker "logical replication launcher" (PID 20) exited with exit code 1
2024-10-23T12:27:17.003404457Z 2024-10-23 12:27:17.003 UTC [15] LOG:  shutting down
2024-10-23T12:27:17.108631707Z 2024-10-23 12:27:17.108 UTC [1] LOG:  database system is shut down
ygaeon commented 1 month ago

Thanks @krypton9208 . I checked my postgres instance and provoked the "failed promise" error in the UI .. but there's nothing in the postgres logs nor in any of the other containers' logs. Is this related?

zynexiz commented 1 month ago

Actually noticed error today to after changing some time stamps on two video files. After I changed their date, they fail to load and raise the error described earlier.

milos7250 commented 3 weeks ago

Just want to chip in, I've also found this error breaking my website. I've used the search function to isolate the entries that were causing the error, it was two video files (that I've changed the timestamp on previously...). I've deleted the assets through the mobile app and re-uploaded the videos, changed the timestamps again and the error is gone.

zynexiz commented 3 weeks ago

Just want to chip in, I've also found this error breaking my website. I've used the search function to isolate the entries that were causing the error, it was two video files (that I've changed the timestamp on previously...). I've deleted the assets through the mobile app and re-uploaded the videos, changed the timestamps again and the error is gone.

Did reuploading them, and change the timestamp again worked? I have two clips I changed the date for that broke the interface to.

milos7250 commented 3 weeks ago

Yes, changing the timestamps after re-uploading (on version 1.119.1) works with no further errors. There have been some timezone related changes since first time the videos were uploaded (on version 1.117.0 I believe), that might have sth to do with it.

zynexiz commented 3 weeks ago

Yes, changing the timestamps after re-uploading (on version 1.119.1) works with no further errors. There have been some timezone related changes since first time the videos were uploaded (on version 1.117.0 I believe), that might have sth to do with it.

I didn't need to reupload the videos affected, just updated the timestamp from the Android App.