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

Failed do delete large albumns (more than 32k items) #9132

Open
1 of 3 tasks
chengguangnan opened this issue Apr 28, 2024 · 3 comments
Open
1 of 3 tasks

Failed do delete large albumns (more than 32k items) #9132

chengguangnan opened this issue Apr 28, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@chengguangnan
Copy link

chengguangnan commented Apr 28, 2024

The bug

I have a few large albumns with more than 32k items each, created by cli.

I'm trying to delete them but failed to do so. See the error log below.

The OS that Immich Server is running on

MacOS

Version of Immich Server

1.102.3

Version of Immich Mobile App

n/a

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

default

Your .env content

default

Reproduction steps

Web UI -> Albumns -> Try to delete an large albumn

Relevant log output

("albumsId" = $77805 AND "assetsId" = $77806) OR ("albumsId" = $77807 AND "assetsId" = $77808) OR ("albumsId" = $77809 AND "assetsId" = $77810) OR ("albumsId" = $77811 AND "assetsId" = $77812) OR ("albumsId" = $77813 AND "assetsId" = $77814) OR ("albumsId" = $77815 AND "assetsId" = $77816) OR ("albumsId" = $77817 AND "assetsId" = $77818) OR ("albumsId" = $77819 AND "assetsId" = $77820) OR ("albumsId" = $77821 AND "assetsId" = $77822) OR ("albumsId" = $77823 AND "assetsId" = $77824) OR ("albumsId" = $77825 AND "assetsId" = $77826) OR ("albumsId" = $77827 AND "assetsId" = $77828) OR ("albumsId" = $77829 AND "assetsId" = $77830) OR ("albumsId" = $77831 AND "assetsId" = $77832) OR ("albumsId" = $77833 AND "assetsId" = $77834) OR ("albumsId" = $77835 AND "assetsId" = $77836) OR ("albumsId" = $77837 AND "assetsId" = $77838) OR ("albumsId" = $77839 AND "assetsId" = $77840) OR ("albumsId" = $77841 AND "assetsId" = $77842) OR ("albumsId" = $77843 AND "assetsId" = $77844) OR ("albumsId" = $77845 AND "assetsId" = $77846) OR ("albumsId" = $77847 AND "assetsId" = $77848) OR ("albumsId" = $77849 AND "assetsId" = $77850) OR ("albumsId" = $77851 AND "assetsId" = $77852) OR ("albumsId" = $77853 AND "assetsId" = $77854) OR ("albumsId" = $77855 AND "assetsId" = $77856) OR ("albumsId" = $77857 AND "assetsId" = $77858) OR ("albumsId" = $77859 AND "assetsId" = $77860) OR ("albumsId" = $77861 AND "assetsId" = $77862) OR ("albumsId" = $77863 AND "assetsId" = $77864))
immich_server            | [Nest] 7  - 04/28/2024, 5:53:29 AM   ERROR [QueryFailedError: bind message has 12328 parameter formats but 0 parameters
immich_server            |     at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
immich_server            |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
immich_server            |     at async DeleteQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/DeleteQueryBuilder.js:52:33)
immich_server            |     at async SubjectExecutor.executeRemoveOperations (/usr/src/app/node_modules/typeorm/persistence/SubjectExecutor.js:461:17)
immich_server            |     at async SubjectExecutor.execute (/usr/src/app/node_modules/typeorm/persistence/SubjectExecutor.js:104:9)
immich_server            |     at async EntityPersistExecutor.execute (/usr/src/app/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21)
immich_server            |     at async AlbumRepository.delete (/usr/src/app/dist/repositories/album.repository.js:219:9)
immich_server            |     at async AlbumService.delete (/usr/src/app/dist/services/album.service.js:145:9)] Failed to delete album
immich_server            | [Nest] 7  - 04/28/2024, 5:53:29 AM   ERROR [QueryFailedError: bind message has 12328 parameter formats but 0 parameters
immich_server            |     at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
immich_server            |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
immich_server            |     at async DeleteQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/DeleteQueryBuilder.js:52:33)
immich_server            |     at async SubjectExecutor.executeRemoveOperations (/usr/src/app/node_modules/typeorm/persistence/SubjectExecutor.js:461:17)
immich_server            |     at async SubjectExecutor.execute (/usr/src/app/node_modules/typeorm/persistence/SubjectExecutor.js:104:9)
immich_server            |     at async EntityPersistExecutor.execute (/usr/src/app/node_modules/typeorm/persistence/EntityPersistExecutor.js:140:21)
immich_server            |     at async AlbumRepository.delete (/usr/src/app/dist/repositories/album.repository.js:219:9)
immich_server            |     at async AlbumService.delete (/usr/src/app/dist/services/album.service.js:145:9)] QueryFailedError: bind message has 12328 parameter formats but 0 parameters
@chengguangnan chengguangnan changed the title Failed do delete an large albumn Failed do delete large albumns (more than 32k items) Apr 28, 2024
@bo0tzz
Copy link
Member

bo0tzz commented Apr 28, 2024

Are you trying to delete the album itself, or did you select all the files and try to remove them from the album?

@bo0tzz
Copy link
Member

bo0tzz commented Apr 28, 2024

The album service delete passes in a complete album object to the repository

async delete(auth: AuthDto, id: string): Promise<void> {
await this.access.requirePermission(auth, Permission.ALBUM_DELETE, id);
const album = await this.findOrFail(id, { withAssets: false });
await this.albumRepository.delete(album);
}

Perhaps this should just pass in the album ID and let the delete cascade properly?

@chengguangnan
Copy link
Author

Are you trying to delete the album itself, or did you select all the files and try to remove them from the album?

I wasy trying to delete the album itself.

@jrasm91 jrasm91 added the bug Something isn't working label Apr 29, 2024
@jrasm91 jrasm91 self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants