Closed deiop closed 9 months ago
I get this beauty when upgrading from 1.93.latest to 1.94.1
Migration "AddAutoStackId1703035138085" failed, error: column "autoStackId" of relation "exif" already exists
/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219
throw new QueryFailedError_1.QueryFailedError(query, parameters, err);
^
QueryFailedError: column "autoStackId" of relation "exif" already exists
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 AddAutoStackId1703035138085.up (/usr/src/app/dist/infra/migrations/1703035138085-AddAutoStackId.js:9:9)
at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:263:35)
at async DatabaseRepository.runMigrations (/usr/src/app/dist/infra/repositories/database.repository.js:42:9)
at async DatabaseService.init (/usr/src/app/dist/domain/database/database.service.js:33:9)
at async AppService.init (/usr/src/app/dist/immich/app.service.js:56:9)
at async AppModule.onModuleInit (/usr/src/app/dist/immich/app.module.js:32:9)
at async callModuleInitHook (/usr/src/app/node_modules/@nestjs/core/hooks/on-module-init.hook.js:51:9) {
query: 'ALTER TABLE "exif" ADD "autoStackId" character varying',
parameters: undefined,
driverError: error: column "autoStackId" of relation "exif" already exists
at /usr/src/app/node_modules/pg/lib/client.js:526:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)
at async AddAutoStackId1703035138085.up (/usr/src/app/dist/infra/migrations/1703035138085-AddAutoStackId.js:9:9)
at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:225:17)
at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:263:35)
at async DatabaseRepository.runMigrations (/usr/src/app/dist/infra/repositories/database.repository.js:42:9)
at async DatabaseService.init (/usr/src/app/dist/domain/database/database.service.js:33:9)
at async AppService.init (/usr/src/app/dist/immich/app.service.js:56:9)
at async AppModule.onModuleInit (/usr/src/app/dist/immich/app.module.js:32:9) {
length: 134,
severity: 'ERROR',
code: '42701',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'tablecmds.c',
line: '7242',
routine: 'check_for_column_name_collision'
},
length: 134,
severity: 'ERROR',
code: '42701',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'tablecmds.c',
line: '7242',
routine: 'check_for_column_name_collision'
}
The bug
on example log extraction:
immich_microservices | [Nest] 7 - 02/01/2024, 8:18:51 AM LOG [MetadataService] Removed old motion photo video asset (981df849-9b5d-43c4-8e0f-7da9276a11a5) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:51 AM LOG [MetadataService] Removed old motion photo video asset (981df849-9b5d-43c4-8e0f-7da9276a11a5) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM LOG [MetadataService] Removed old motion photo video asset (5b32fc7b-191a-429b-9fc7-9df335a3da44) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM LOG [MetadataService] Removed old motion photo video asset (5b32fc7b-191a-429b-9fc7-9df335a3da44) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM LOG [MetadataService] Removed old motion photo video asset (29291517-abbc-4c45-a67a-a5589b65efe9) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM LOG [MetadataService] Removed old motion photo video asset (29291517-abbc-4c45-a67a-a5589b65efe9) immich_postgres | 2024-02-01 08:18:52.482 UTC [524] ERROR: insert or update on table "exif" violates foreign key constraint "FK_c0117fdbc50b917ef9067740c44" immich_postgres | 2024-02-01 08:18:52.482 UTC [524] DETAIL: Key (assetId)=(29291517-abbc-4c45-a67a-a5589b65efe9) is not present in table "assets". immich_postgres | 2024-02-01 08:18:52.482 UTC [524] STATEMENT: INSERT INTO "exif"("assetId", "description", "exifImageWidth", "exifImageHeight", "fileSizeInByte", "orientation", "dateTimeOriginal", "modifyDate", "timeZone", "latitude", "longitude", "projectionType", "city", "livePhotoCID", "autoStackId", "state", "country", "make", "model", "lensModel", "fNumber", "focalLength", "iso", "exposureTime", "profileDescription", "colorspace", "bitsPerSample", "fps", "exifTextSearchableColumn") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, DEFAULT) ON CONFLICT ( "assetId" ) DO UPDATE SET "assetId" = EXCLUDED."assetId", "description" = EXCLUDED."description", "exifImageWidth" = EXCLUDED."exifImageWidth", "exifImageHeight" = EXCLUDED."exifImageHeight", "fileSizeInByte" = EXCLUDED."fileSizeInByte", "orientation" = EXCLUDED."orientation", "dateTimeOriginal" = EXCLUDED."dateTimeOriginal", "modifyDate" = EXCLUDED."modifyDate", "timeZone" = EXCLUDED."timeZone", "latitude" = EXCLUDED."latitude", "longitude" = EXCLUDED."longitude", "projectionType" = EXCLUDED."projectionType", "city" = EXCLUDED."city", "livePhotoCID" = EXCLUDED."livePhotoCID", "autoStackId" = EXCLUDED."autoStackId", "state" = EXCLUDED."state", "country" = EXCLUDED."country", "make" = EXCLUDED."make", "model" = EXCLUDED."model", "lensModel" = EXCLUDED."lensModel", "fNumber" = EXCLUDED."fNumber", "focalLength" = EXCLUDED."focalLength", "iso" = EXCLUDED."iso", "exposureTime" = EXCLUDED."exposureTime", "profileDescription" = EXCLUDED."profileDescription", "colorspace" = EXCLUDED."colorspace", "bitsPerSample" = EXCLUDED."bitsPerSample", "fps" = EXCLUDED."fps" RETURNING "description" immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM ERROR [JobService] Unable to run job handler (metadataExtraction/metadata-extraction): QueryFailedError: insert or update on table "exif" violates foreign key constraint "FK_c0117fdbc50b917ef9067740c44" immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM ERROR [JobService] QueryFailedError: insert or update on table "exif" violates foreign key constraint "FK_c0117fdbc50b917ef9067740c44" immich_microservices | at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19) immich_microservices | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) immich_microservices | at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33) immich_microservices | at async AssetRepository.upsertExif (/usr/src/app/dist/infra/repositories/asset.repository.js:43:9) immich_microservices | at async MetadataService.handleMetadataExtraction (/usr/src/app/dist/domain/metadata/metadata.service.js:172:9) immich_microservices | at async /usr/src/app/dist/domain/job/job.service.js:116:37 immich_microservices | at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28) immich_microservices | at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM ERROR [JobService] Object: immich_microservices | { immich_microservices | "id": "29291517-abbc-4c45-a67a-a5589b65efe9" immich_microservices | } immich_microservices | immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM ERROR [JobService] Unable to run job handler (metadataExtraction/metadata-extraction): QueryFailedError: insert or update on table "exif" violates foreign key constraint "FK_c0117fdbc50b917ef9067740c44" immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM ERROR [JobService] QueryFailedError: insert or update on table "exif" violates foreign key constraint "FK_c0117fdbc50b917ef9067740c44" immich_microservices | at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19) immich_microservices | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) immich_microservices | at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33) immich_microservices | at async AssetRepository.upsertExif (/usr/src/app/dist/infra/repositories/asset.repository.js:43:9) immich_microservices | at async MetadataService.handleMetadataExtraction (/usr/src/app/dist/domain/metadata/metadata.service.js:172:9) immich_microservices | at async /usr/src/app/dist/domain/job/job.service.js:116:37 immich_microservices | at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28) immich_microservices | at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24) immich_microservices | [Nest] 7 - 02/01/2024, 8:18:52 AM ERROR [JobService] Object: immich_microservices | { immich_microservices | "id": "29291517-abbc-4c45-a67a-a5589b65efe9" immich_microservices | }
The OS that Immich Server is running on
Ubuntu 22.04.3 LTS
Version of Immich Server
1.94.1
Version of Immich Mobile App
1.94.1
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information
No response