immich-app / immich

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

cannot set shared photo as profile or add faces #12493

Closed akostadinov closed 1 month ago

akostadinov commented 1 month ago

The bug

I created a shared album with another user. My user is the admin. Also I am the owner of the shared album. The other user is an editor.

The other user uploaded a picture to the album.

Now I don't see an option to set this picture as profile neither on the web nor in the android app.

Also 2 faces are detected on the photo but are unassigned. I try to edit assignment which fails with "Not found or not ... some permission". I couldn't copy/paste it and somehow after several times I can't see this anymore.

As a user, my expectation is that shared picture I can use the same as my own pictures and search in the same way.

The OS that Immich Server is running on

Fedora 40

Version of Immich Server

v1.114.0

Version of Immich Mobile App

v1.114.0 build.158

Platform with the issue

Your docker-compose.yml content

I have converted the compose items into systemd services. Using quadlet for a systemd user services with rootless podman. But basically it is the v1.114.0 version of the compose converted with some a little change in how postgres env variables are handled (but the database works fine, it is accessible and shows healthy check status).

;/etc/containers/systemd/users/1002/immich-redis.container
[Container]
ContainerName=immich_redis
Network=immich
NetworkAlias=redis
HealthCmd=redis-cli ping || exit 1
Image=docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e

[Service]
TimeoutStartSec=900
Restart=always

;/etc/containers/systemd/users/1002/immich-pgsql.container
[Container]
ContainerName=immich_postgres
Environment=POSTGRES_INITDB_ARGS=--data-checksums
EnvironmentFile=/media/toshsec/containers_services_data/immich/pgsql.env
Exec=postgres -c 'shared_preload_libraries=vectors.so' -c 'search_path="$user", public, vectors' -c 'logging_collector=off' -c 'log_destination=stderr' -c 'max_wal_size=2GB' -c 'shared_buffers=512MB' -c 'wal_compression=on'
HealthCmd=pg_isready --dbname=$${POSTGRES_DB} --username=$${POSTGRES_USER} || exit 1; Chksum="$$(psql --dbname=$${POSTGRES_DB} --username=$${POSTGRES_USER} --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
HealthInterval=5m
HealthStartPeriod=5m
HealthStartupInterval=30s
Network=immich
NetworkAlias=postgres
Image=docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
Volume=/media/toshsec/containers_services_data/immich/postgresql/data:/var/lib/postgresql/data,Z

[Service]
TimeoutStartSec=900
Restart=always

/etc/containers/systemd/users/1002/immich-machine-learning.container 
[Container]
ContainerName=immich_machine_learning
# EnvironmentFile=/media/toshsec/containers_services_data/immich/immich.env
Image=ghcr.io/immich-app/immich-machine-learning:v1.114.0
Network=immich,podman
DNS=none
NetworkAlias=immich-machine-learning
Volume=immich-model-cache.volume:/cache

[Service]
TimeoutStartSec=900
Restart=always

;/etc/containers/systemd/users/1002/immich-server.container
[Unit]
Requires=immich-redis.service immich-pgsql.service
After=immich-redis.service immich-pgsql.service
Wants=immich-machine-learning

[Container]
ContainerName=immich_server
EnvironmentFile=/media/toshsec/containers_services_data/immich/immich.env
Image=ghcr.io/immich-app/immich-server:v1.114.0
PublishPort=8102:3001
Network=immich
Volume=/media/toshsec/containers_services_data/immich/library:/usr/src/app/upload:Z
Volume=/etc/localtime:/etc/localtime:ro

[Install]
WantedBy=multi-user.target default.target

[Service]
TimeoutStartSec=900
Restart=always

Your .env content

#immich.env
DB_PASSWORD=REDACTED
DB_HOSTNAME=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

#pgsql.env
POSTGRES_PASSWORD=REDACTED
POSTGRES_USER=postgres
POSTGRES_DB=immich

Reproduction steps

  1. Create shared album
  2. Second user uploads photo
  3. Try to set photo as profile for the first user
  4. Try to assign missing faces

Relevant log output

I don't know if this is relevant or not. Doesn't look like it but might be.

[Nest] 2  - 09/08/2024, 9:25:58 PM   ERROR [Microservices:JobService] Unable to 
run job handler (smartSearch/smart-search): Error: Machine learning request '{"c
lip":{"visual":{"modelName":"ViT-B-32__openai"}}}' failed with status 500: Inter
nal Server Error
[Nest] 2  - 09/08/2024, 9:25:58 PM   ERROR [Microservices:JobService] Error: Mac
hine learning request '{"clip":{"visual":{"modelName":"ViT-B-32__openai"}}}' fai
led with status 500: Internal Server Error
    at MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine
-learning.repository.js:22:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
)
    at async MachineLearningRepository.encodeImage (/usr/src/app/dist/repositori
es/machine-learning.repository.js:42:26)
    at async SmartInfoService.handleEncodeClip (/usr/src/app/dist/services/smart-info.service.js:132:27)
    at async /usr/src/app/dist/services/job.service.js:148:36
    at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
    at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
[Nest] 2  - 09/08/2024, 9:25:58 PM   ERROR [Microservices:JobService] Object:
{
  "id": "e12ac784-f1c7-44bd-8c8f-371643e7c122",
  "source": "upload"
}

[Nest] 2  - 09/09/2024, 9:15:52 AM   ERROR [Microservices:JobService] Unable to run job handler (smartSearch/smart-search): Error: Machine learning request to "http://immich-machine-learning:3003" failed with Error: write EPIPE
[Nest] 2  - 09/09/2024, 9:15:52 AM   ERROR [Microservices:JobService] Error: Machine learning request to "http://immich-machine-learning:3003" failed with Error: write EPIPE
    at /usr/src/app/dist/repositories/machine-learning.repository.js:19:19
    at async MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine-learning.repository.js:18:21)
    at async MachineLearningRepository.encodeImage (/usr/src/app/dist/repositories/machine-learning.repository.js:42:26)
    at async SmartInfoService.handleEncodeClip (/usr/src/app/dist/services/smart-info.service.js:132:27)
    at async /usr/src/app/dist/services/job.service.js:148:36
    at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
    at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
[Nest] 2  - 09/09/2024, 9:15:52 AM   ERROR [Microservices:JobService] Object:
{
  "id": "5f670ac6-f1ab-4eec-9de2-7dd450143a35",
  "source": "upload"
}

Idk why it happens because overnight I triggered face detection and smart search from Administration -> Jobs and that appears to have worked fine. A lot of faces were detected and I don't see any errors in machine learning container logs. Only warnings like:

2024-09-08 23:16:27.723296466 [W:onnxruntime:, execution_frame.cc:870 VerifyOutputSizes] Expected shape from model of {1,512} does not match actual shape of {8,512} for output 683

UPDATE: I see such errors are probably harmless according to #12417

Additional information

No response

bo0tzz commented 1 month ago

This is currently working as expected, there are open feature requests for deeper integration of shared assets.

akostadinov commented 1 month ago

@bo0tzz , could you point me at that RFE so I can watch it? I searched before filing the issue. Also now rsearching for "shared assets", "shared photo" and no issues come up.