-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Crash adding assets to albums using CLI upload #8608
Comments
Before I tried to add this larger library of pictures and videos, I tested it with a smaller set of files and folders and it did work as expected, but that was on v1.100.0. |
The error message indicates a serverside error. Can you post the corresponding server logs, and the version of the CLI that you're using? |
I have the same problem, my cli version root@debian:~# immich -V
2.2.0 |
Oh, I almost forgot the server log [Nest] 6 - 04/08/2024, 2:35:09 AM LOG [EventRepository] Websocket Connect: 5uQVKsXjT8wKUtoZAAAD
[Nest] 6 - 04/08/2024, 3:52:48 AM ERROR [QueryFailedError: duplicate key value violates unique constraint "PK_c67bc36fa845fb7b18e0e398180"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async AlbumRepository.addAssetIds (/usr/src/app/dist/repositories/album.repository.js:205:9)
at async addAssets (/usr/src/app/dist/utils/asset.util.js:29:9)
at async AlbumService.addAssets (/usr/src/app/dist/services/album.service.js:148:25)] Failed to add assets to album
[Nest] 6 - 04/08/2024, 3:52:48 AM ERROR [QueryFailedError: duplicate key value violates unique constraint "PK_c67bc36fa845fb7b18e0e398180"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async AlbumRepository.addAssetIds (/usr/src/app/dist/repositories/album.repository.js:205:9)
at async addAssets (/usr/src/app/dist/utils/asset.util.js:29:9)
at async AlbumService.addAssets (/usr/src/app/dist/services/album.service.js:148:25)] QueryFailedError: duplicate key value violates unique constraint "PK_c67bc36fa845fb7b18e0e398180"
[Nest] 6 - 04/08/2024, 4:41:52 AM ERROR [QueryFailedError: duplicate key value violates unique constraint "PK_c67bc36fa845fb7b18e0e398180"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async AlbumRepository.addAssetIds (/usr/src/app/dist/repositories/album.repository.js:205:9)
at async addAssets (/usr/src/app/dist/utils/asset.util.js:29:9)
at async AlbumService.addAssets (/usr/src/app/dist/services/album.service.js:148:25)] Failed to add assets to album
[Nest] 6 - 04/08/2024, 4:41:52 AM ERROR [QueryFailedError: duplicate key value violates unique constraint "PK_c67bc36fa845fb7b18e0e398180"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async AlbumRepository.addAssetIds (/usr/src/app/dist/repositories/album.repository.js:205:9)
at async addAssets (/usr/src/app/dist/utils/asset.util.js:29:9)
at async AlbumService.addAssets (/usr/src/app/dist/services/album.service.js:148:25)] QueryFailedError: duplicate key value violates unique constraint "PK_c67bc36fa845fb7b18e0e398180" |
Where do I grab the server log? I am going to try calling immich upload for each asset directory and pass the album name with -A in hope that it might work and maybe I'll see which dir it's having an issue with. |
You can run |
What I found out is that I had duplicate images and videos in my directories and after removing the dups, I was able to workaround this problem. So maybe there is an issue detecting duplicates and rejecting them using the CLI? |
Can confirm. Have the same issue. Tried both adding an external library and from the cli. Getting PK constraint validation error. Also possible I have duplicate images. Cli output:
Microservice container output:
|
I also had this issue. I used a software to detect duplicated images, deleted them and it worked! |
I also had this issue. I deleted the duplicate file, then it worked! |
The bug
I tried uploading 41k images inside 364 folders using the immich cli, specifying that I want it to create albums for each folder. Looks like it was successful uploading the files, but then crashed adding assets to the new albums it created. This is a brand new immich installation, running 1.101.0.
The OS that Immich Server is running on
TrueNAS Scale
Version of Immich Server
1.101.0
Version of Immich Mobile App
N/A
Platform with the issue
Your docker-compose.yml content
NA
Your .env content
Reproduction steps
Additional information
No response
The text was updated successfully, but these errors were encountered: