[BUG] Can't execute "FixTimestampDataTypeInAssetTable1662427365521" migration #296

Closed
opened 2026-02-04 19:25:09 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @kai23 on GitHub (Sep 12, 2022).

Describe the bug
Can't execute the FixTimestampDataTypeInAssetTable1662427365521 migration

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

Add any other context about the problem here

Here is the full stacktrace :

[Nest] 7  - 09/12/2022, 9:56:43 AM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (7)...
QueryFailedError: time zone displacement out of range: "+112977-06-13T02:56:00.000000Z"
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FixTimestampDataTypeInAssetTable1662427365521.up (/usr/src/app/dist/apps/immich/libs/database/src/migrations/1662427365521-FixTimestampDataTypeInAssetTable.js:10:9)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:178:17)
    at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:248:35)
    at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:137:17)
Migration "FixTimestampDataTypeInAssetTable1662427365521" failed, error: time zone displacement out of range: "+112977-06-13T02:56:00.000000Z"
Originally created by @kai23 on GitHub (Sep 12, 2022). **Describe the bug** Can't execute the FixTimestampDataTypeInAssetTable1662427365521 migration **Task List** *Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.* - [X] I have read thoroughly the README setup and installation instructions. - [ ] I have included my `docker-compose` file. - [ ] I have included my redacted `.env` file. - [ ] I have included information on my machine, and environment. Add any other context about the problem here Here is the full stacktrace : ``` [Nest] 7 - 09/12/2022, 9:56:43 AM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (7)... QueryFailedError: time zone displacement out of range: "+112977-06-13T02:56:00.000000Z" at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async FixTimestampDataTypeInAssetTable1662427365521.up (/usr/src/app/dist/apps/immich/libs/database/src/migrations/1662427365521-FixTimestampDataTypeInAssetTable.js:10:9) at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/typeorm/migration/MigrationExecutor.js:178:17) at async DataSource.runMigrations (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:248:35) at async DataSource.initialize (/usr/src/app/node_modules/typeorm/data-source/DataSource.js:137:17) Migration "FixTimestampDataTypeInAssetTable1662427365521" failed, error: time zone displacement out of range: "+112977-06-13T02:56:00.000000Z"
Author
Owner

@kai23 commented on GitHub (Sep 12, 2022):

I finished by finding the corresponding assets and update the createdAt field

UPDATE assets SET "createdAt" = '2022-09-12T20:07:28.000' WHERE id = '02260043-deab-4603-a7f6-4d0bb2ba9bc6';
@kai23 commented on GitHub (Sep 12, 2022): I finished by finding the corresponding assets and update the `createdAt` field ``` UPDATE assets SET "createdAt" = '2022-09-12T20:07:28.000' WHERE id = '02260043-deab-4603-a7f6-4d0bb2ba9bc6'; ```
Author
Owner

@zackpollard commented on GitHub (Sep 12, 2022):

Thanks for raising the issue, this was a known potential problem when we decided to make this change but as the app is still in development rather than a full release version, our view on making breaking changes is that we should do so rather than spend lots of time building workarounds for niche problems. Once we hit a full release this will obviously change but for now these kind of things can happen.

I'm glad you managed to fix the issue yourself 🙂

@zackpollard commented on GitHub (Sep 12, 2022): Thanks for raising the issue, this was a known potential problem when we decided to make this change but as the app is still in development rather than a full release version, our view on making breaking changes is that we should do so rather than spend lots of time building workarounds for niche problems. Once we hit a full release this will obviously change but for now these kind of things can happen. I'm glad you managed to fix the issue yourself 🙂
Author
Owner

@panoti commented on GitHub (Sep 12, 2022):

Hi @kai23, would you mind sending me this error file? I think this file will help us find out the root cause.

@panoti commented on GitHub (Sep 12, 2022): Hi @kai23, would you mind sending me this error file? I think this file will help us find out the root cause.
Author
Owner

@kai23 commented on GitHub (Sep 12, 2022):

@zackpollard : alright, I can hear that. My goal here was mainly to help people who run through the same error :)
@panoti The error was located here :

b081eda76f/server/libs/database/src/migrations/1662427365521-FixTimestampDataTypeInAssetTable.ts (L11-L13)

Specially if you have some assets with weird createdAt value (as I had)

@kai23 commented on GitHub (Sep 12, 2022): @zackpollard : alright, I can hear that. My goal here was mainly to help people who run through the same error :) @panoti The error was located here : https://github.com/immich-app/immich/blob/b081eda76fbd3adfe35c5358afc16363de177c92/server/libs/database/src/migrations/1662427365521-FixTimestampDataTypeInAssetTable.ts#L11-L13 Specially if you have some assets with weird createdAt value (as I had)
Author
Owner

@panoti commented on GitHub (Sep 12, 2022):

@kai23 How can you find exact date 2022-09-12T20:07:28.000 of the asset 02260043-deab-4603-a7f6-4d0bb2ba9bc6? Did you use another exiftool?

@panoti commented on GitHub (Sep 12, 2022): @kai23 How can you find exact date `2022-09-12T20:07:28.000` of the asset `02260043-deab-4603-a7f6-4d0bb2ba9bc6`? Did you use another exiftool?
Author
Owner

@kai23 commented on GitHub (Sep 12, 2022):

@panoti : The date was "+112977-06-13T02:56:00.000000Z". To be honest, I had no idea of the correct date, that's why I put something today to make the asset on top of my recent photos.

After that, I deleted it as it was something really old and useless

@kai23 commented on GitHub (Sep 12, 2022): @panoti : The date was "+112977-06-13T02:56:00.000000Z". To be honest, I had no idea of the correct date, that's why I put something today to make the asset on top of my recent photos. After that, I deleted it as it was something really old and useless
Author
Owner

@panoti commented on GitHub (Sep 12, 2022):

Thanks @kai23 for your response.

@panoti commented on GitHub (Sep 12, 2022): Thanks @kai23 for your response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#296