immich-app / immich

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

Untitled album disappears after uploading asset and clicking it #12110

Closed enteryournamehere closed 2 months ago

enteryournamehere commented 2 months ago

The bug

Creating a new empty album in the web UI, not naming it, uploading an image to it, and clicking the image, results in the album being deleted, the image stays uploaded but the album is gone.

Not uploading an image, but selecting an existing one, causes the bug not to appear.

The OS that Immich Server is running on

OpenSUSE Tumbleweed

Version of Immich Server

1.112.1

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}accelerated transcoding
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
    extends:
      file: hwaccel.ml.yml
      service: cuda
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=./library
DB_DATA_LOCATION=./postgres
TZ=Europe/Amsterdam
IMMICH_VERSION=release
DB_PASSWORD=...
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

  1. On web, click "Create Album". Do not enter a name yet. Screenshot from 2024-08-29 09-31-40
  2. Click "Select photos", then "Select from computer".
  3. Upload an image that isn't in Immich yet.
  4. This completes fine. At this point, opening the album in a new tab works fine as well. Screenshot from 2024-08-29 09-33-46
  5. Now, remaining on the album page, click the piece of just uploaded media.
  6. Briefly, in the info panel, it'll show that it's part of the album, which then disappears. Screenshot from 2024-08-29 09-33-53 Screenshot from 2024-08-29 09-33-56
  7. Navigating back to the main album view, or reloading the image-in-album page, results in Not found or no album.read access (400). Screenshot from 2024-08-29 09-34-01
  8. The album is gone but the piece of media stays/is in the timeline.

Giving the album a name before step 5 causes the bug not to appear. Not uploading an image, but selecting an existing one, causes the bug not to appear.

Relevant log output

Nothing odd in the immich_server logs. See comment below with DEBUG logs.

[Nest] 17  - 08/29/2024, 9:46:30 AM     LOG [Api:EventRepository] Websocket Connect:    0UHciPaK2prx-SeQAAAn
[Nest] 7  - 08/29/2024, 9:46:48 AM     LOG [Microservices:MediaService] Successfully generated JPEG image preview for asset eebc2f2e-cc39-47dd-a75d-fa9573e1dadd
[Nest] 7  - 08/29/2024, 9:46:48 AM     LOG [Microservices:MediaService] Successfully generated WEBP image thumbnail for asset eebc2f2e-cc39-47dd-a75d-fa9573e1dadd

Additional information

No response

enteryournamehere commented 2 months ago

Upgraded the log level; the album deletion appears to be caused by the web client explicitly requesting it to be deleted.

Show log ``` [Nest] 17 - 08/30/2024, 12:08:00 AM DEBUG [Api:LoggingInterceptor~5nvp6zwh] POST /api/albums 201 21.19ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:00 AM VERBOSE [Api:LoggingInterceptor~5nvp6zwh] {"albumName":""} [Nest] 17 - 08/30/2024, 12:08:00 AM DEBUG [Api:LoggingInterceptor~vzaf0sng] GET /api/albums/276fbfb3-c705-461d-9550-eabfc7139a21?withoutAssets=true 200 7.38ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:01 AM DEBUG [Api:LoggingInterceptor~2prswifs] GET /api/timeline/buckets?albumId=276fbfb3-c705-461d-9550-eabfc7139a21&order=desc&size=MONTH 200 3.96ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:01 AM DEBUG [Api:LoggingInterceptor~m3w214zc] GET /api/timeline/buckets?isArchived=false&size=MONTH 200 42.17ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:02 AM DEBUG [Api:LoggingInterceptor~oox3d508] GET /api/timeline/bucket?isArchived=false&size=MONTH&timeBucket=2024-08-01T00%3A00%3A00.000Z 200 269.19ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:02 AM DEBUG [Api:LoggingInterceptor~pcelq8kn] GET /api/timeline/bucket?albumId=276fbfb3-c705-461d-9550-eabfc7139a21&size=MONTH&timeBucket=2024-08-01T00%3A00%3A00.000Z 200 3.64ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:13 AM DEBUG [Api:LoggingInterceptor~0e4egd8d] POST /api/assets/bulk-upload-check 200 2.56ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:13 AM VERBOSE [Api:LoggingInterceptor~0e4egd8d] {"assets":[{"id":"logo.png","checksum":"ffefe1ac01ad32ae305b8e81e18844bee4f44ff8"}]} [Nest] 17 - 08/30/2024, 12:08:13 AM DEBUG [Api:LoggingInterceptor~hi5e1kk6] POST /api/assets 201 21.21ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:13 AM VERBOSE [Api:LoggingInterceptor~hi5e1kk6] {"deviceAssetId":"web-logo.png-1715892278758","deviceId":"WEB","fileCreatedAt":"2024-05-16T20:44:38.758Z","fileModifiedAt":"2024-05-16T20:44:38.758Z","isFavorite":"false","duration":"0:00:00.000000"} [Nest] 17 - 08/30/2024, 12:08:13 AM DEBUG [Api:LoggingInterceptor~vzzudtiw] PUT /api/albums/276fbfb3-c705-461d-9550-eabfc7139a21/assets 200 21.20ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:13 AM VERBOSE [Api:LoggingInterceptor~vzzudtiw] {"ids":["a4ec924e-6483-4792-88c5-740b999e503a"]} [Nest] 17 - 08/30/2024, 12:08:13 AM DEBUG [Api:LoggingInterceptor~s0tnlij7] GET /api/timeline/buckets?albumId=276fbfb3-c705-461d-9550-eabfc7139a21&order=desc&size=MONTH 200 3.29ms ::ffff:172.19.0.1 [Nest] 7 - 08/30/2024, 12:08:13 AM VERBOSE [Microservices:MetadataService] Exif Tags [Nest] 7 - 08/30/2024, 12:08:13 AM VERBOSE [Microservices:MetadataService] Object: -- removed -- [Nest] 17 - 08/30/2024, 12:08:13 AM DEBUG [Api:LoggingInterceptor~1c6bhilr] GET /api/timeline/bucket?albumId=276fbfb3-c705-461d-9550-eabfc7139a21&order=desc&size=MONTH&timeBucket=2024-05-01T00%3A00%3A00.000Z 200 5.51ms ::ffff:172.19.0.1 [Nest] 7 - 08/30/2024, 12:08:13 AM DEBUG [Microservices:MediaService] Attempting to rename file: upload/upload/476fc812-207e-49f8-a256-e91444ed90e3/f4/b5/f4b5e307-b240-44f1-ab24-bb861436d26b.png => upload/library/admin/2024/2024-05-16/logo.png [Nest] 7 - 08/30/2024, 12:08:13 AM LOG [Microservices:MediaService] Successfully generated JPEG image preview for asset a4ec924e-6483-4792-88c5-740b999e503a [Nest] 7 - 08/30/2024, 12:08:13 AM LOG [Microservices:MediaService] Successfully generated WEBP image thumbnail for asset a4ec924e-6483-4792-88c5-740b999e503a [Nest] 17 - 08/30/2024, 12:08:14 AM DEBUG [Api:LoggingInterceptor~bra9c5cf] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a/thumbnail?size=thumbnail&c=%2F%2B%2FhrAGtMq4wW46B4YhEvuT0T%2Fg%3D 200 4.18ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~5ml9kjm9] GET /api/albums?assetId=a4ec924e-6483-4792-88c5-740b999e503a 200 13.89ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~qcf8z69h] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a 200 16.81ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~tuptjd38] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a/thumbnail?size=preview&c=%2F%2B%2FhrAGtMq4wW46B4YhEvuT0T%2Fg%3D 200 6.11ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~kh707wzc] GET /api/albums/276fbfb3-c705-461d-9550-eabfc7139a21?withoutAssets=true 200 20.76ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~wl7lczoh] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a 200 25.57ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~r29hhbs5] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a 200 15.02ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~3ijn2lms] GET /api/albums/276fbfb3-c705-461d-9550-eabfc7139a21?withoutAssets=true 200 24.29ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:16 AM DEBUG [Api:LoggingInterceptor~ymght346] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a/thumbnail?size=preview 200 7.49ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:17 AM DEBUG [Api:LoggingInterceptor~v1uqq4cu] DELETE /api/albums/276fbfb3-c705-461d-9550-eabfc7139a21 200 8.43ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:17 AM DEBUG [Api:LoggingInterceptor~eek2id7l] GET /api/albums?assetId=a4ec924e-6483-4792-88c5-740b999e503a 200 9.51ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:17 AM DEBUG [Api:LoggingInterceptor~aw8437uq] GET /api/assets/a4ec924e-6483-4792-88c5-740b999e503a 200 16.14ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:17 AM DEBUG [Api:LoggingInterceptor~4ufjikol] GET /api/albums?assetId=a4ec924e-6483-4792-88c5-740b999e503a 200 10.33ms ::ffff:172.19.0.1 [Nest] 7 - 08/30/2024, 12:08:18 AM DEBUG [Microservices:PersonService] 0 faces detected in upload/thumbs/476fc812-207e-49f8-a256-e91444ed90e3/a4/ec/a4ec924e-6483-4792-88c5-740b999e503a-preview.jpeg [Nest] 17 - 08/30/2024, 12:08:21 AM DEBUG [Api:LoggingInterceptor~oobn6hp6] GET /api/albums/276fbfb3-c705-461d-9550-eabfc7139a21?withoutAssets=true 200 4.32ms ::ffff:172.19.0.1 [Nest] 17 - 08/30/2024, 12:08:21 AM DEBUG [Api:HttpExceptionFilter~oobn6hp6] HttpException(400) {"message":"Not found or no album.read access","error":"Bad Request","statusCode":400} ```