After upgrading from (I believe 1.92.2) to 1.94.1 this was logged by the "server" container when then exited.
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'
}
After restarting the container without other changes made the error disappeared.
I now wonder:
Have the migrations been run successfully or not?
How can one verify the DB schema matches the expectations made by the code?
My impression of the current migration system is that it is rather unreliable: Even if they now succeeded, why did the error occur during the first start of the container?
Are there situations where the migration log (I assume there is such a table) recorded a successful migration while the actual migration was not run (transactionality)?
The bug
After upgrading from (I believe 1.92.2) to 1.94.1 this was logged by the "server" container when then exited.
After restarting the container without other changes made the error disappeared.
I now wonder:
The OS that Immich Server is running on
docker
Version of Immich Server
1.94.1
Version of Immich Mobile App
unrelated
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information
No response