Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error changing name people faces when you have assets in trash #4448

Closed
1 of 3 tasks
enoixer opened this issue Oct 11, 2023 · 2 comments · Fixed by #4450
Closed
1 of 3 tasks

[BUG] Error changing name people faces when you have assets in trash #4448

enoixer opened this issue Oct 11, 2023 · 2 comments · Fixed by #4450

Comments

@enoixer
Copy link

enoixer commented Oct 11, 2023

The bug

I'm getting this error when I changes some face name from people menu:

immich-microservices[2246]: #033[31m[Nest] 2246  - #033[39m10/11/2023, 8:30:17 PM #033[31m  ERROR#033[39m #033[38;5;3m[JobService] #033[39m#033[31mUnable to run job handler (search/search-index-faces): TypeError: Cannot read properties of null (reading 'ownerId')#033[39m
immich-microservices[2246]: #033[31m[Nest] 2246  - #033[39m10/11/2023, 8:30:17 PM #033[31m  ERROR#033[39m #033[38;5;3m[JobService] #033[39m#033[31mTypeError: Cannot read properties of null (reading 'ownerId')
immich-microservices[2246]:     at /var/lib/immich/app/server/dist/domain/search/search.service.js:293:33
immich-microservices[2246]:     at Array.map (<anonymous>)
immich-microservices[2246]:     at SearchService.patchFaces (/var/lib/immich/app/server/dist/domain/search/search.service.js:291:22)
immich-microservices[2246]:     at SearchService.handleIndexFaces (/var/lib/immich/app/server/dist/domain/search/search.service.js:172:28)
immich-microservices[2246]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
immich-microservices[2246]:     at async /var/lib/immich/app/server/dist/domain/job/job.service.js:108:37
immich-microservices[2246]:     at async Worker.processJob (/var/lib/immich/app/server/node_modules/bullmq/dist/cjs/classes/worker.js:350:28)
immich-microservices[2246]:     at async Worker.retryIfFailed (/var/lib/immich/app/server/node_modules/bullmq/dist/cjs/classes/worker.js:535:24)#033[39m
immich-microservices[2246]: #033[31m[Nest] 2246  - #033[39m10/11/2023, 8:30:17 PM #033[31m  ERROR#033[39m #033[38;5;3m[JobService] #033[39m#033[31mObject:#033[39m
immich-microservices[2246]: {}

Looking for the issue in code, I found the issue occurs when you have some asset in trash, so the map in patchFaces function fails because the asset array is null for the deleted assets (in trash), so ownerId is not readable because is null:

patchFaces(faces) {
        return faces.map((face) => ({
            id: this.asKey(face),
            ownerId: face.asset.ownerId,
            assetId: face.assetId,
            personId: face.personId,
            embedding: face.embedding,
        }));
    }

The problem is solved clicking the empty trash button deleting all pending deleted files, so faces array dont have any item with asset null and no error logs anymore.

The OS that Immich Server is running on

Debian 12 Proxmox Container

Version of Immich Server

1.81.1

Version of Immich Mobile App

1.80.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Not used in Proxmox

Your .env content

IMMICH_VERSION=release

TZ=UTC

PUID=immich
PGID=immich

TYPESENSE_ENABLED=true
TYPESENSE_API_KEY=rjUduWsuYtV4tXjX0qlpyTxYJO1NGyyJgUmdx0WlwqWQz9v5
TYPESENSE_DATA_DIR=/var/lib/typesense/
TYPESENSE_HOST=localhost
TYPESENSE_PORT=8108

DB_HOSTNAME=localhost
DB_USERNAME=immich_user
DB_DATABASE_NAME=immich_data
DB_PASSWORD=immich_password


REDIS_HOSTNAME=localhost

UPLOAD_LOCATION=/var/lib/immich/upload

JWT_SECRET=zheshiyigejwtsecretgergreh2jnH5juUh3y45

ENABLE_MAPBOX=false
MAPBOX_KEY=

IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003
MACHINE_LEARNING_CACHE_FOLDER=/tmp
MACHINE_LEARNING_REQUEST_THREADS=20
TRANSFORMERS_CACHE=/tmp
MPLCONFIGDIR=/tmp
TRANSFORMERS_CACHE=/tmp
REVERSE_GEOCODING_DUMP_DIRECTORY=/tmp

Reproduction steps

1. Delete an asset with trash enabled.
2. Change name for a people face.

Additional information

No response

@enoixer enoixer changed the title [BUG] Error changing name people faces when have some images in trash [BUG] Error changing name people faces when you have some images in trash Oct 11, 2023
@enoixer enoixer changed the title [BUG] Error changing name people faces when you have some images in trash [BUG] Error changing name people faces when you have assets in trash Oct 11, 2023
@shenlong-tanwen
Copy link
Member

Thank you for the report. The face re-indexing happens during face merges. Do you by any chance happen to merge faces during rename? Either ways, a PR has been raised to address this #4450

@enoixer
Copy link
Author

enoixer commented Oct 12, 2023

Yes, I was merging faces when this error appears.

Thanks @shalong-tanwen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants