Failed upload of many files from iOS app due to "date/time field value out of range". #5329

Open
opened 2026-02-05 11:20:43 +03:00 by OVERLORD · 41 comments
Owner

Originally created by @mattalat1 on GitHub (Feb 5, 2025).

The bug

Out of my roughly 11,000 photos that I uploaded from my phone to my server, ~900 or so failed to upload. Checking the container logs reveals this:
[Nest] 695 - 02/04/2025, 10:35:14 PM ERROR [Api:AssetMediaService~79jmlv9f] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/app/immich/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) [Nest] 695 - 02/04/2025, 10:35:14 PM ERROR [Api:ErrorInterceptor~79jmlv9f] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/app/immich/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

It seems to be an issue with the date/time metadata. Possibly similar or the same as this previously closed issue: https://github.com/immich-app/immich/issues/670

Similarly to the above linked issue, if I manually adjust the date/time of a failed photo and click "revert", the photo then uploads.

The OS that Immich Server is running on

Unraid 7.0

Version of Immich Server

1.125.7

Version of Immich Mobile App

1.125.3 build.191

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker create --name='immich' --net='bridge' --pids-limit 2048 -e TZ="America/Chicago" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Green" -e HOST_CONTAINERNAME="immich" -e 'DB_HOSTNAME'='192.168.0.79' -e 'DB_USERNAME'='postgres' -e 'DB_PASSWORD'='postgres' -e 'DB_DATABASE_NAME'='immich' -e 'REDIS_HOSTNAME'='localhost' -e 'DB_PORT'='5433' -e 'REDIS_PORT'='6379' -e 'REDIS_PASSWORD'='' -e 'MACHINE_LEARNING_HOST'='0.0.0.0' -e 'MACHINE_LEARNING_PORT'='3003' -e 'MACHINE_LEARNING_WORKERS'='1' -e 'MACHINE_LEARNING_WORKER_TIMEOUT'='120' -e 'DOCKER_MODS'='imagegenius/mods:universal-redis' -e 'PUID'='99' -e 'PGID'='100' -e 'UMASK'='022' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:8080]' -l net.unraid.docker.icon='https://raw.githubusercontent.com/imagegenius/templates/main/unraid/img/immich.png' -p '8080:8080/tcp' -v '/mnt/user/photos/':'/photos':'rw' -v '/mnt/cache/appdata/immich':'/config':'rw' --device='/dev/dri' 'ghcr.io/imagegenius/immich:latest'

Your .env content

n/a

Reproduction steps

  1. Attempt to upload photo from iOS app
  2. Upload fails

Example file that fails upload:
Image

...

Relevant log output


Additional information

No response

Originally created by @mattalat1 on GitHub (Feb 5, 2025). ### The bug Out of my roughly 11,000 photos that I uploaded from my phone to my server, ~900 or so failed to upload. Checking the container logs reveals this: `[Nest] 695 - 02/04/2025, 10:35:14 PM ERROR [Api:AssetMediaService~79jmlv9f] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/app/immich/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) [Nest] 695 - 02/04/2025, 10:35:14 PM ERROR [Api:ErrorInterceptor~79jmlv9f] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/app/immich/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17)` It seems to be an issue with the date/time metadata. Possibly similar or the same as this previously closed issue: https://github.com/immich-app/immich/issues/670 Similarly to the above linked issue, if I manually adjust the date/time of a failed photo and click "revert", the photo then uploads. ### The OS that Immich Server is running on Unraid 7.0 ### Version of Immich Server 1.125.7 ### Version of Immich Mobile App 1.125.3 build.191 ### Platform with the issue - [x] Server - [ ] Web - [x] Mobile ### Your docker-compose.yml content ```YAML /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker create --name='immich' --net='bridge' --pids-limit 2048 -e TZ="America/Chicago" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Green" -e HOST_CONTAINERNAME="immich" -e 'DB_HOSTNAME'='192.168.0.79' -e 'DB_USERNAME'='postgres' -e 'DB_PASSWORD'='postgres' -e 'DB_DATABASE_NAME'='immich' -e 'REDIS_HOSTNAME'='localhost' -e 'DB_PORT'='5433' -e 'REDIS_PORT'='6379' -e 'REDIS_PASSWORD'='' -e 'MACHINE_LEARNING_HOST'='0.0.0.0' -e 'MACHINE_LEARNING_PORT'='3003' -e 'MACHINE_LEARNING_WORKERS'='1' -e 'MACHINE_LEARNING_WORKER_TIMEOUT'='120' -e 'DOCKER_MODS'='imagegenius/mods:universal-redis' -e 'PUID'='99' -e 'PGID'='100' -e 'UMASK'='022' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:8080]' -l net.unraid.docker.icon='https://raw.githubusercontent.com/imagegenius/templates/main/unraid/img/immich.png' -p '8080:8080/tcp' -v '/mnt/user/photos/':'/photos':'rw' -v '/mnt/cache/appdata/immich':'/config':'rw' --device='/dev/dri' 'ghcr.io/imagegenius/immich:latest' ``` ### Your .env content ```Shell n/a ``` ### Reproduction steps 1. Attempt to upload photo from iOS app 2. Upload fails Example file that fails upload: ![Image](https://github.com/user-attachments/assets/fac81f99-581e-4a9e-a5f5-0d6f343557b2) ... ### Relevant log output ```shell ``` ### Additional information _No response_
OVERLORD added the 📱mobile label 2026-02-05 11:20:43 +03:00
Author
Owner

@TheDadNerd commented on GitHub (Feb 5, 2025):

I also have this issue uploading from iOS with about 1,000 photos (other 15k uploaded fine). Interesting for me that most of them are from a GoPro. Not sure if the date/time format from GoPro images are causing an issue.

@TheDadNerd commented on GitHub (Feb 5, 2025): I also have this issue uploading from iOS with about 1,000 photos (other 15k uploaded fine). Interesting for me that most of them are from a GoPro. Not sure if the date/time format from GoPro images are causing an issue.
Author
Owner

@danbush commented on GitHub (Feb 19, 2025):

The same thing happened to me. And similarly it happened with around 1000 photos left after about 15k uploading fine. Of note, this happened to a secondary account on my immich, my primary account added around 15k without issue a week or so ago.

@danbush commented on GitHub (Feb 19, 2025): The same thing happened to me. And similarly it happened with around 1000 photos left after about 15k uploading fine. Of note, this happened to a secondary account on my immich, my primary account added around 15k without issue a week or so ago.
Author
Owner

@pnodseth commented on GitHub (Feb 21, 2025):

Same issue here. First upload from IOS to server with about 14000 images. Around 500 get this error, and Immich tries to upload them every time I open the app, it seems.

@pnodseth commented on GitHub (Feb 21, 2025): Same issue here. First upload from IOS to server with about 14000 images. Around 500 get this error, and Immich tries to upload them every time I open the app, it seems.
Author
Owner

@gardz commented on GitHub (Feb 25, 2025):

Same error here for approximately 9715 assets when trying to upload to Immich via the iOS app. The other 28k images/videos uploaded fine though. The "date/time field value out of range" error repeats below for each of the images and happens each time the Immich iOS app is opened.


[Nest] 17  - 02/25/2025, 4:38:47 PM   ERROR [Api:AssetMediaService~s22e3kvm] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
    at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
    at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
    at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
    at Socket.emit (node:events:524:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
[Nest] 17  - 02/25/2025, 4:38:47 PM   ERROR [Api:ErrorInterceptor~s22e3kvm] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
    at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
    at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
    at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
    at Socket.emit (node:events:524:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
Query failed : {
  durationMs: 1.0748189985752106,
  error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
      at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
      at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
      at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:524:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '22008',
    where: "unnamed portal parameter $8 = '...'",
    file: 'datetime.c',
    line: '3773',
    routine: 'DateTimeParseError'
  },
  sql: 'insert into "assets" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "isArchived", "duration", "isVisible", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) returning *',
  params: [
    '83120ac5-f7db-42c1-9cc5-e9228ed3911e',
    null,
    <Buffer 61 a4 07 cd 83 d0 46 88 47 36 c5 1a ab f3 1a 08 98 ab de 54>,
    'upload/upload/83120ac5-f7db-42c1-9cc5-e9228ed3911e/dd/e0/dde02153-99f7-4ccd-90d1-9ef47b2a1564.JPG',
    '440343F4-9F2E-488D-A6A8-14675D06DC3F/L0/001',
    '8ec37b6e1ecfb6098b7421263583df16d12dfbc7f5596c2a24159350219e1ab6',
    2013-11-30T16:05:41.000Z,
    0000-12-30T00:00:00.000Z,
    2013-11-30T16:05:41.000Z,
    'IMAGE',
    false,
    false,
    '0:00:00.000000',
    true,
    'P1130367.JPG'
  ]

@gardz commented on GitHub (Feb 25, 2025): Same error here for approximately 9715 assets when trying to upload to Immich via the iOS app. The other 28k images/videos uploaded fine though. The "date/time field value out of range" error repeats below for each of the images and happens each time the Immich iOS app is opened. ``` [Nest] 17 - 02/25/2025, 4:38:47 PM ERROR [Api:AssetMediaService~s22e3kvm] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:524:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) [Nest] 17 - 02/25/2025, 4:38:47 PM ERROR [Api:ErrorInterceptor~s22e3kvm] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:524:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) Query failed : { durationMs: 1.0748189985752106, error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:524:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '22008', where: "unnamed portal parameter $8 = '...'", file: 'datetime.c', line: '3773', routine: 'DateTimeParseError' }, sql: 'insert into "assets" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "isArchived", "duration", "isVisible", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) returning *', params: [ '83120ac5-f7db-42c1-9cc5-e9228ed3911e', null, <Buffer 61 a4 07 cd 83 d0 46 88 47 36 c5 1a ab f3 1a 08 98 ab de 54>, 'upload/upload/83120ac5-f7db-42c1-9cc5-e9228ed3911e/dd/e0/dde02153-99f7-4ccd-90d1-9ef47b2a1564.JPG', '440343F4-9F2E-488D-A6A8-14675D06DC3F/L0/001', '8ec37b6e1ecfb6098b7421263583df16d12dfbc7f5596c2a24159350219e1ab6', 2013-11-30T16:05:41.000Z, 0000-12-30T00:00:00.000Z, 2013-11-30T16:05:41.000Z, 'IMAGE', false, false, '0:00:00.000000', true, 'P1130367.JPG' ] ```
Author
Owner

@ghost commented on GitHub (Feb 28, 2025):

Same as the above, I'm attempting my first upload from iOS. Unsure if this is related but in the backup section of the app, the backup count is higher than the total. The remainder is at 0 assets yet it still tries to upload files. I've been unable to get the Immich app so say it's completed, it's forever in an uploading state.

immich-server            | [Nest] 17  - 02/28/2025, 1:52:24 PM   ERROR [Api:ErrorInterceptor~anpf3jvz] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
immich-server            | PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
immich-server            |     at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
immich-server            |     at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
immich-server            |     at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
immich-server            |     at Socket.emit (node:events:524:28)
immich-server            |     at addChunk (node:internal/streams/readable:561:12)
immich-server            |     at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
immich-server            |     at Readable.push (node:internal/streams/readable:392:5)
immich-server            |     at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
immich-server            |     at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
immich-server            | Query failed : {
immich-server            |   durationMs: 0.7964829999982612,
immich-server            |   error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
immich-server            |       at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26)
immich-server            |       at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6)
immich-server            |       at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9)
immich-server            |       at Socket.emit (node:events:524:28)
immich-server            |       at addChunk (node:internal/streams/readable:561:12)
immich-server            |       at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
immich-server            |       at Readable.push (node:internal/streams/readable:392:5)
immich-server            |       at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
immich-server            |       at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
immich-server            |     severity_local: 'ERROR',
immich-server            |     severity: 'ERROR',
immich-server            |     code: '22008',
immich-server            |     where: "unnamed portal parameter $8 = '...'",
immich-server            |     file: 'datetime.c',
immich-server            |     line: '3773',
immich-server            |     routine: 'DateTimeParseError'
immich-server            |   },
immich-server            |   sql: 'insert into "assets" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "isArchived", "duration", "isVisible", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) returning *',
immich-server            |   params: [
immich-server            |     '639758d7-9468-473b-b0a6-1cc20579bc86',
immich-server            |     null,
immich-server            |     <Buffer c9 50 e4 9e 50 83 56 e5 98 27 b9 1d 3b d8 a5 d3 59 02 89 25>,
immich-server            |     'upload/upload/639758d7-9468-473b-b0a6-1cc20579bc86/fc/93/fc93a1cf-5e8d-4937-a378-f484e36ee7ce.JPG',
immich-server            |     'BD58E19D-E2F5-4532-8F8F-A74FF66E263F/L0/001',
immich-server            |     'b96c2aaa3b5233b3fd59879b85a39b8e66926ed834c8a98a2462d98df754f2f9',
immich-server            |     2010-07-12T17:12:34.000Z,
immich-server            |     0000-12-30T00:00:00.000Z,
immich-server            |     2010-07-12T17:12:34.000Z,
immich-server            |     'IMAGE',
immich-server            |     false,
immich-server            |     false,
immich-server            |     '0:00:00.000000',
immich-server            |     true,
immich-server            |     'IMG_0466.JPG'
immich-server            |   ]
immich-server            | }

Image

@ghost commented on GitHub (Feb 28, 2025): Same as the above, I'm attempting my first upload from iOS. Unsure if this is related but in the backup section of the app, the backup count is higher than the total. The remainder is at 0 assets yet it still tries to upload files. I've been unable to get the Immich app so say it's completed, it's forever in an uploading state. ``` immich-server | [Nest] 17 - 02/28/2025, 1:52:24 PM ERROR [Api:ErrorInterceptor~anpf3jvz] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" immich-server | PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" immich-server | at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26) immich-server | at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6) immich-server | at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9) immich-server | at Socket.emit (node:events:524:28) immich-server | at addChunk (node:internal/streams/readable:561:12) immich-server | at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) immich-server | at Readable.push (node:internal/streams/readable:392:5) immich-server | at TCP.onStreamRead (node:internal/stream_base_commons:189:23) immich-server | at TCP.callbackTrampoline (node:internal/async_hooks:130:17) immich-server | Query failed : { immich-server | durationMs: 0.7964829999982612, immich-server | error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" immich-server | at ErrorResponse (/usr/src/app/node_modules/postgres/cjs/src/connection.js:788:26) immich-server | at handle (/usr/src/app/node_modules/postgres/cjs/src/connection.js:474:6) immich-server | at Socket.data (/usr/src/app/node_modules/postgres/cjs/src/connection.js:315:9) immich-server | at Socket.emit (node:events:524:28) immich-server | at addChunk (node:internal/streams/readable:561:12) immich-server | at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) immich-server | at Readable.push (node:internal/streams/readable:392:5) immich-server | at TCP.onStreamRead (node:internal/stream_base_commons:189:23) immich-server | at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { immich-server | severity_local: 'ERROR', immich-server | severity: 'ERROR', immich-server | code: '22008', immich-server | where: "unnamed portal parameter $8 = '...'", immich-server | file: 'datetime.c', immich-server | line: '3773', immich-server | routine: 'DateTimeParseError' immich-server | }, immich-server | sql: 'insert into "assets" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "isArchived", "duration", "isVisible", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) returning *', immich-server | params: [ immich-server | '639758d7-9468-473b-b0a6-1cc20579bc86', immich-server | null, immich-server | <Buffer c9 50 e4 9e 50 83 56 e5 98 27 b9 1d 3b d8 a5 d3 59 02 89 25>, immich-server | 'upload/upload/639758d7-9468-473b-b0a6-1cc20579bc86/fc/93/fc93a1cf-5e8d-4937-a378-f484e36ee7ce.JPG', immich-server | 'BD58E19D-E2F5-4532-8F8F-A74FF66E263F/L0/001', immich-server | 'b96c2aaa3b5233b3fd59879b85a39b8e66926ed834c8a98a2462d98df754f2f9', immich-server | 2010-07-12T17:12:34.000Z, immich-server | 0000-12-30T00:00:00.000Z, immich-server | 2010-07-12T17:12:34.000Z, immich-server | 'IMAGE', immich-server | false, immich-server | false, immich-server | '0:00:00.000000', immich-server | true, immich-server | 'IMG_0466.JPG' immich-server | ] immich-server | } ``` ![Image](https://github.com/user-attachments/assets/8bf6f19c-2ec1-4d3a-869b-0e4d9ea123dd)
Author
Owner

@packetloss404 commented on GitHub (Mar 11, 2025):

Same issue happening for me on a fresh install. 22117 total, 17556 uploaded, and 4561 all with the same error as above.

Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"

Server version: v1.129.0

@packetloss404 commented on GitHub (Mar 11, 2025): Same issue happening for me on a fresh install. 22117 total, 17556 uploaded, and 4561 all with the same error as above. Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" Server version: v1.129.0
Author
Owner

@pnodseth commented on GitHub (Mar 11, 2025):

FWIW I "solved" this by manually finding the affected photos in Apple photos (iOS) and adjusting the date there. After that they uploaded as expected.
Yes, it took a while..

@pnodseth commented on GitHub (Mar 11, 2025): FWIW I "solved" this by manually finding the affected photos in Apple photos (iOS) and adjusting the date there. After that they uploaded as expected. Yes, it took a while..
Author
Owner

@packetloss404 commented on GitHub (Mar 11, 2025):

FWIW I "solved" this by manually finding the affected photos in Apple photos (iOS) and adjusting the date there. After that they uploaded as expected. Yes, it took a while..

For sure thought about that but at 4,561 photos to manually find and edit I am kind of discouraged.

@packetloss404 commented on GitHub (Mar 11, 2025): > FWIW I "solved" this by manually finding the affected photos in Apple photos (iOS) and adjusting the date there. After that they uploaded as expected. Yes, it took a while.. For sure thought about that but at 4,561 photos to manually find and edit I am kind of discouraged.
Author
Owner

@devobern commented on GitHub (Mar 17, 2025):

Hi,

I'm experiencing the same issue as described in this thread. When uploading certain images, I get the following error:

PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"

The affected images seem to have an invalid or corrupted fileModifiedAt timestamp, which defaults to this invalid value. I’ve gathered a sample dataset for further investigation:

📂 Attached ZIP Files:

  • error_images.zip → Contains images that trigger the error. --> error_images.zip
  • valid_images.zip → Contains images taken around the same time that upload without issues. --> valid_images.zip

This might help in pinpointing the exact metadata discrepancy that causes the issue. Let me know if you need additional information!

Thanks for your work on Immich! 🚀

@devobern commented on GitHub (Mar 17, 2025): Hi, I'm experiencing the same issue as described in this thread. When uploading certain images, I get the following error: ``` PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" ``` The affected images seem to have an invalid or corrupted `fileModifiedAt` timestamp, which defaults to this invalid value. I’ve gathered a sample dataset for further investigation: 📂 **Attached ZIP Files:** - `error_images.zip` → Contains images that trigger the error. --> [error_images.zip](https://github.com/user-attachments/files/19293475/error_images.zip) - `valid_images.zip` → Contains images taken around the same time that upload without issues. --> [valid_images.zip](https://github.com/user-attachments/files/19293476/valid_images.zip) This might help in pinpointing the exact metadata discrepancy that causes the issue. Let me know if you need additional information! Thanks for your work on Immich! 🚀
Author
Owner

@DonLocke commented on GitHub (Mar 22, 2025):

I'm having the same issue as well, would it be possible to add some sort of error catcher to the uploader and just use created at timestamp for the modified timestamp if its invalid?

@DonLocke commented on GitHub (Mar 22, 2025): I'm having the same issue as well, would it be possible to add some sort of error catcher to the uploader and just use created at timestamp for the modified timestamp if its invalid?
Author
Owner

@offbyone commented on GitHub (Mar 30, 2025):

I've got 80 images in this state as well; if there's any debugging or troubleshooting I can offer, including running a beta of the iOS app or the server, please don't hesitate to ask me.

@offbyone commented on GitHub (Mar 30, 2025): I've got 80 images in this state as well; if there's any debugging or troubleshooting I can offer, including running a beta of the iOS app or the server, please don't hesitate to ask me.
Author
Owner

@alextran1502 commented on GitHub (Mar 30, 2025):

Hello @offbyone, do you able to identify the problematic file and see if you can export it and post it here?

@alextran1502 commented on GitHub (Mar 30, 2025): Hello @offbyone, do you able to identify the problematic file and see if you can export it and post it here?
Author
Owner

@dotfortun3-code commented on GitHub (Apr 9, 2025):

Hello @offbyone, do you able to identify the problematic file and see if you can export it and post it here?

Here is one that failed upload for me. It seems like the majority of my failures are screenshots. However, I downloaded it from iCloud and it appears to have set the CreatedDate and ModifiedDate to when I downloaded it. The same thing happens if I download it to my NAS directly from the phone.

I am guessing something must be wrong with the Created or Modified Date properties (perhaps they are not set or something). I don't see a check before it gets entered to the DB. I have never made a PR, but would it make sense to add a check in the uploadAsset function in the AssetMediaService? I guess it could default to the current date?

https://drive.proton.me/urls/1WSS9V0ZJ8#P8tsmU7tANgh

@dotfortun3-code commented on GitHub (Apr 9, 2025): > Hello [@offbyone](https://github.com/offbyone), do you able to identify the problematic file and see if you can export it and post it here? Here is one that failed upload for me. It seems like the majority of my failures are screenshots. However, I downloaded it from iCloud and it appears to have set the CreatedDate and ModifiedDate to when I downloaded it. The same thing happens if I download it to my NAS directly from the phone. I am guessing something must be wrong with the Created or Modified Date properties (perhaps they are not set or something). I don't see a check before it gets entered to the DB. I have never made a PR, but would it make sense to add a check in the uploadAsset function in the AssetMediaService? I guess it could default to the current date? https://drive.proton.me/urls/1WSS9V0ZJ8#P8tsmU7tANgh
Author
Owner

@jkoopmann commented on GitHub (Apr 22, 2025):

Having the same problem:

[Nest] 273 - 04/22/2025, 6:18:37 PM ERROR [Api:AssetMediaService~3ga3hkkl] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:790:26)
at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:476:6)
at Socket.data (/app/immich/server/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:524:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:191:23)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

I can see the file as "Failed". From the logs in immich I can see what file is affected. I went in iCloud on my Mac and deleted it so it should be gone on iCloud and iPhone but no matter what I do the error remains on the iPhone. So I am not sure if the backup is frozen or if it is finished and only this one file is missing.

I believe there are two issues:

why is this producing an error instead of overwriting the date?
why Is this freezing the upload?

@jkoopmann commented on GitHub (Apr 22, 2025): Having the same problem: [Nest] 273 - 04/22/2025, 6:18:37 PM ERROR [Api:AssetMediaService~3ga3hkkl] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:790:26) at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:476:6) at Socket.data (/app/immich/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:524:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) I can see the file as "Failed". From the logs in immich I can see what file is affected. I went in iCloud on my Mac and deleted it so it should be gone on iCloud and iPhone but no matter what I do the error remains on the iPhone. So I am not sure if the backup is frozen or if it is finished and only this one file is missing. I believe there are two issues: why is this producing an error instead of overwriting the date? why Is this freezing the upload?
Author
Owner

@jkoopmann commented on GitHub (Apr 22, 2025):

I was able to find the image on my iPhone (so it was not synced as deleted probably because the battery on my Mac was low and the sync was stopped...). I deleted it. Now:

Image

So it saved 19146 out of 19049 images (how is that possible?).

And iCloud Download is at 1%...

If I look at Photos on Mac I see a total of 19323 objects... Now what is happening? Is everything synced? If not, why is it stuck at 1%? iOS log says:

Syncing complete. Changes: true FROM AlbumService...

@jkoopmann commented on GitHub (Apr 22, 2025): I was able to find the image on my iPhone (so it was not synced as deleted probably because the battery on my Mac was low and the sync was stopped...). I deleted it. Now: ![Image](https://github.com/user-attachments/assets/b6a40c38-d627-46b3-bbe7-6fbc0c23cca4) So it saved 19146 out of 19049 images (how is that possible?). And iCloud Download is at 1%... If I look at Photos on Mac I see a total of 19323 objects... Now what is happening? Is everything synced? If not, why is it stuck at 1%? iOS log says: Syncing complete. Changes: true FROM AlbumService...
Author
Owner

@DHernan commented on GitHub (May 3, 2025):

Another here with 114 failed photos. The error mentions a date in the past but it seems the error message in the logs says date/time out of range so doesn't make much sense to me. I'm unable to find the images myself to fix so hopefully a fix soon

@DHernan commented on GitHub (May 3, 2025): Another here with 114 failed photos. The error mentions a date in the past but it seems the error message in the logs says date/time out of range so doesn't make much sense to me. I'm unable to find the images myself to fix so hopefully a fix soon
Author
Owner

@hellotomtom commented on GitHub (May 22, 2025):

Same issue for me - app says there's 6626 assets left to upload, but they all fail. Because they fail, immich tries to upload them every time I open the app.

I've actually successfully synced my entire library (including these images) before, so they will be duplicates... I deleted the app and reinstalled it recently while troubleshooting a different error, and this has happened consistently since then.

I am not keen on manually updating timestamps for >6k images, so I'm hoping a future update will fix this...

@hellotomtom commented on GitHub (May 22, 2025): Same issue for me - app says there's 6626 assets left to upload, but they all fail. Because they fail, immich tries to upload them every time I open the app. I've actually successfully synced my entire library (including these images) before, so they will be duplicates... I deleted the app and reinstalled it recently while troubleshooting a different error, and this has happened consistently since then. I am not keen on manually updating timestamps for >6k images, so I'm hoping a future update will fix this...
Author
Owner

@StephanRoemer commented on GitHub (May 26, 2025):

100% the same issue here.

@StephanRoemer commented on GitHub (May 26, 2025): 100% the same issue here.
Author
Owner

@DanCue44 commented on GitHub (May 29, 2025):

Same issue for me. About 3K of my 16K files have this issue. They are all images uploaded from my DSLR. Something must have happened to the date. Not sure.

@DanCue44 commented on GitHub (May 29, 2025): Same issue for me. About 3K of my 16K files have this issue. They are all images uploaded from my DSLR. Something must have happened to the date. Not sure.
Author
Owner

@sveininge79 commented on GitHub (Jun 1, 2025):

I have also the same problem, 5519 failed of 24713 opictures

@sveininge79 commented on GitHub (Jun 1, 2025): I have also the same problem, 5519 failed of 24713 opictures
Author
Owner

@DanCue44 commented on GitHub (Jun 1, 2025):

Just wanted to follow up here. My issue was due to invalid dates for files I had imported into iCloud in the past from an old camera or scanned developed photos.

I ended up going to the photos app in iOS and adjusting the date and time for each. It sounds like a huge effort but most of these were grouped pictures from several events so I was able to select many at a time and adjust them. I still spent a few hours but it needed to be cleaned up anyways.

I don’t think this is something immich should be responsible for. They could accept the file with the invalid date, yes, but wouldn’t you want to fix it?

@DanCue44 commented on GitHub (Jun 1, 2025): Just wanted to follow up here. My issue was due to invalid dates for files I had imported into iCloud in the past from an old camera or scanned developed photos. I ended up going to the photos app in iOS and adjusting the date and time for each. It sounds like a huge effort but most of these were grouped pictures from several events so I was able to select many at a time and adjust them. I still spent a few hours but it needed to be cleaned up anyways. I don’t think this is something immich should be responsible for. They could accept the file with the invalid date, yes, but wouldn’t you want to fix it?
Author
Owner

@StephanRoemer commented on GitHub (Jun 1, 2025):

Well, in my case the dates are absolutely correct. So changing them didn’t help at all.
I think it has to do with the fileModifiedAt attribute which was mentioned by @devobern

@StephanRoemer commented on GitHub (Jun 1, 2025): Well, in my case the dates are absolutely correct. So changing them didn’t help at all. I think it has to do with the fileModifiedAt attribute which was mentioned by @devobern
Author
Owner

@DanCue44 commented on GitHub (Jun 1, 2025):

Well, in my case the dates are absolutely correct. So changing them didn’t help at all. I think it has to do with the fileModifiedAt attribute which was mentioned by @devobern

A big majority of the files I didn’t actually have to change the date for. I simply clicked adjust date and then accepted the date that was already there.

Is that what you did with no success?

@DanCue44 commented on GitHub (Jun 1, 2025): > Well, in my case the dates are absolutely correct. So changing them didn’t help at all. I think it has to do with the fileModifiedAt attribute which was mentioned by [@devobern](https://github.com/devobern) A big majority of the files I didn’t actually have to change the date for. I simply clicked adjust date and then accepted the date that was already there. Is that what you did with no success?
Author
Owner

@sveininge79 commented on GitHub (Jun 2, 2025):

did try to change time and date on couple 1000 images and only 2-3 images did upload after that. ios app.

@sveininge79 commented on GitHub (Jun 2, 2025): did try to change time and date on couple 1000 images and only 2-3 images did upload after that. ios app.
Author
Owner

@yabolek commented on GitHub (Jun 4, 2025):

I have the same issue, failed uploads for pictures with
params: [ 0000-12-30T00:00:00.000Z, // fileModifiedAt <<<<<< ]

error:

PostgresError: date/time field value out of range

over 500 uploads already failed, how can we fix this?

@yabolek commented on GitHub (Jun 4, 2025): I have the same issue, failed uploads for pictures with `params: [ 0000-12-30T00:00:00.000Z, // fileModifiedAt <<<<<< ]` error: `PostgresError: date/time field value out of range` over 500 uploads already failed, how can we fix this?
Author
Owner

@putzflorian commented on GitHub (Jun 9, 2025):

quick fix in: /usr/src/app/dist/services/asset-media.service.js

add a function:

function sanitizeDate(dateString) {
  const d = new Date(dateString);

  if (isNaN(d.getTime())) {
    return new Date('1970-01-01T00:00:00Z');
  }

  if (d.getFullYear() < 1970) {
    return new Date('1970-01-01T00:00:00Z');
  }

  return d;
}

and call it on fileCreateAt, fileModifiedAt, localDateTime in create function

async create(ownerId, dto, file, sidecarFile) {

        const asset = await this.assetRepository.create({
            ownerId,
            libraryId: null,
            checksum: file.checksum,
            originalPath: file.originalPath,
            deviceAssetId: dto.deviceAssetId,
            deviceId: dto.deviceId,
            fileCreatedAt: sanitizeDate(dto.fileCreatedAt),
            fileModifiedAt: sanitizeDate(dto.fileModifiedAt),
            localDateTime: sanitizeDate(dto.fileCreatedAt),
            type: mime_types_1.mimeTypes.assetType(file.originalPath),
            isFavorite: dto.isFavorite,
            duration: dto.duration || null,
            visibility: dto.visibility ?? enum_1.AssetVisibility.TIMELINE,
            livePhotoVideoId: dto.livePhotoVideoId,
            originalFileName: file.originalName,
            sidecarPath: sidecarFile?.originalPath,
        });
        if (sidecarFile) {
            await this.storageRepository.utimes(sidecarFile.originalPath, new Date(), new Date(dto.fileModifiedAt));
        }
        await this.storageRepository.utimes(file.originalPath, new Date(), new Date(dto.fileModifiedAt));
        await this.assetRepository.upsertExif({ assetId: asset.id, fileSizeInByte: file.size });
        await this.jobRepository.queue({ name: enum_1.JobName.METADATA_EXTRACTION, data: { id: asset.id, source: 'upload' } });
        return asset;
    }

@putzflorian commented on GitHub (Jun 9, 2025): quick fix in: /usr/src/app/dist/services/asset-media.service.js add a function: ``` function sanitizeDate(dateString) { const d = new Date(dateString); if (isNaN(d.getTime())) { return new Date('1970-01-01T00:00:00Z'); } if (d.getFullYear() < 1970) { return new Date('1970-01-01T00:00:00Z'); } return d; } ``` and call it on fileCreateAt, fileModifiedAt, localDateTime in create function ``` async create(ownerId, dto, file, sidecarFile) { const asset = await this.assetRepository.create({ ownerId, libraryId: null, checksum: file.checksum, originalPath: file.originalPath, deviceAssetId: dto.deviceAssetId, deviceId: dto.deviceId, fileCreatedAt: sanitizeDate(dto.fileCreatedAt), fileModifiedAt: sanitizeDate(dto.fileModifiedAt), localDateTime: sanitizeDate(dto.fileCreatedAt), type: mime_types_1.mimeTypes.assetType(file.originalPath), isFavorite: dto.isFavorite, duration: dto.duration || null, visibility: dto.visibility ?? enum_1.AssetVisibility.TIMELINE, livePhotoVideoId: dto.livePhotoVideoId, originalFileName: file.originalName, sidecarPath: sidecarFile?.originalPath, }); if (sidecarFile) { await this.storageRepository.utimes(sidecarFile.originalPath, new Date(), new Date(dto.fileModifiedAt)); } await this.storageRepository.utimes(file.originalPath, new Date(), new Date(dto.fileModifiedAt)); await this.assetRepository.upsertExif({ assetId: asset.id, fileSizeInByte: file.size }); await this.jobRepository.queue({ name: enum_1.JobName.METADATA_EXTRACTION, data: { id: asset.id, source: 'upload' } }); return asset; } ```
Author
Owner

@dagstuan commented on GitHub (Jun 10, 2025):

I figured out a relatively quick way of fixing this when importing many photos from iOS, without having to manually edit each photo:

  • Select a range of images from the timeline around the dates with the failed images.
  • Add all of them to a temporary album (so they can be re-selected).
  • Go to the album, select all, edit date/time and move the year to some other year.
  • Wait a little while for the change to propagate to all the selected photos.
  • Select all again, edit date/time and move the year back to the original year.
  • Delete the temporary album, and re-import the photos to Immich.

This marks all the images as edited, while keeping the original dates. I did this by marking a few years worth of photos and they all imported afterwards with no issues.

@dagstuan commented on GitHub (Jun 10, 2025): I figured out a relatively quick way of fixing this when importing many photos from iOS, without having to manually edit each photo: * Select a range of images from the timeline around the dates with the failed images. * Add all of them to a temporary album (so they can be re-selected). * Go to the album, select all, edit date/time and move the year to some other year. * Wait a little while for the change to propagate to all the selected photos. * Select all again, edit date/time and move the year back to the original year. * Delete the temporary album, and re-import the photos to Immich. This marks all the images as edited, while keeping the original dates. I did this by marking a few years worth of photos and they all imported afterwards with no issues.
Author
Owner

@yabolek commented on GitHub (Jun 11, 2025):

I have now 6000 pictures with this issue. Do you think such workaround is doable with that many Files @dagstuan ?

@yabolek commented on GitHub (Jun 11, 2025): I have now 6000 pictures with this issue. Do you think such workaround is doable with that many Files @dagstuan ?
Author
Owner

@dagstuan commented on GitHub (Jun 11, 2025):

It did seem to work for me with ~1100 photos at least @yabolek. YMMW and I offer no guarantees 😅

@dagstuan commented on GitHub (Jun 11, 2025): It did seem to work for me with ~1100 photos at least @yabolek. YMMW and I offer no guarantees 😅
Author
Owner

@gelato commented on GitHub (Jun 25, 2025):

Same here. Immich just started showing this error, previously I imported the same gallery without any problems, so this is a recently added bug.

@gelato commented on GitHub (Jun 25, 2025): Same here. Immich just started showing this error, previously I imported the same gallery without any problems, so this is a recently added bug.
Author
Owner

@maazr commented on GitHub (Jun 29, 2025):

quick fix in: /usr/src/app/dist/services/asset-media.service.js

add a function:

function sanitizeDate(dateString) {
  const d = new Date(dateString);

  if (isNaN(d.getTime())) {
    return new Date('1970-01-01T00:00:00Z');
  }

  if (d.getFullYear() < 1970) {
    return new Date('1970-01-01T00:00:00Z');
  }

  return d;
}

and call it on fileCreateAt, fileModifiedAt, localDateTime in create function

async create(ownerId, dto, file, sidecarFile) {

        const asset = await this.assetRepository.create({
            ownerId,
            libraryId: null,
            checksum: file.checksum,
            originalPath: file.originalPath,
            deviceAssetId: dto.deviceAssetId,
            deviceId: dto.deviceId,
            fileCreatedAt: sanitizeDate(dto.fileCreatedAt),
            fileModifiedAt: sanitizeDate(dto.fileModifiedAt),
            localDateTime: sanitizeDate(dto.fileCreatedAt),
            type: mime_types_1.mimeTypes.assetType(file.originalPath),
            isFavorite: dto.isFavorite,
            duration: dto.duration || null,
            visibility: dto.visibility ?? enum_1.AssetVisibility.TIMELINE,
            livePhotoVideoId: dto.livePhotoVideoId,
            originalFileName: file.originalName,
            sidecarPath: sidecarFile?.originalPath,
        });
        if (sidecarFile) {
            await this.storageRepository.utimes(sidecarFile.originalPath, new Date(), new Date(dto.fileModifiedAt));
        }
        await this.storageRepository.utimes(file.originalPath, new Date(), new Date(dto.fileModifiedAt));
        await this.assetRepository.upsertExif({ assetId: asset.id, fileSizeInByte: file.size });
        await this.jobRepository.queue({ name: enum_1.JobName.METADATA_EXTRACTION, data: { id: asset.id, source: 'upload' } });
        return asset;
    }

Could you tell me how call these function and where to put this code. I totally noob. Just followed instructions to install server and uploaded all my 6k+ photos. Plus do you think I should delete all of them and reload?

@maazr commented on GitHub (Jun 29, 2025): > quick fix in: /usr/src/app/dist/services/asset-media.service.js > > add a function: > > ``` > function sanitizeDate(dateString) { > const d = new Date(dateString); > > if (isNaN(d.getTime())) { > return new Date('1970-01-01T00:00:00Z'); > } > > if (d.getFullYear() < 1970) { > return new Date('1970-01-01T00:00:00Z'); > } > > return d; > } > ``` > > and call it on fileCreateAt, fileModifiedAt, localDateTime in create function > > ``` > async create(ownerId, dto, file, sidecarFile) { > > const asset = await this.assetRepository.create({ > ownerId, > libraryId: null, > checksum: file.checksum, > originalPath: file.originalPath, > deviceAssetId: dto.deviceAssetId, > deviceId: dto.deviceId, > fileCreatedAt: sanitizeDate(dto.fileCreatedAt), > fileModifiedAt: sanitizeDate(dto.fileModifiedAt), > localDateTime: sanitizeDate(dto.fileCreatedAt), > type: mime_types_1.mimeTypes.assetType(file.originalPath), > isFavorite: dto.isFavorite, > duration: dto.duration || null, > visibility: dto.visibility ?? enum_1.AssetVisibility.TIMELINE, > livePhotoVideoId: dto.livePhotoVideoId, > originalFileName: file.originalName, > sidecarPath: sidecarFile?.originalPath, > }); > if (sidecarFile) { > await this.storageRepository.utimes(sidecarFile.originalPath, new Date(), new Date(dto.fileModifiedAt)); > } > await this.storageRepository.utimes(file.originalPath, new Date(), new Date(dto.fileModifiedAt)); > await this.assetRepository.upsertExif({ assetId: asset.id, fileSizeInByte: file.size }); > await this.jobRepository.queue({ name: enum_1.JobName.METADATA_EXTRACTION, data: { id: asset.id, source: 'upload' } }); > return asset; > } > > ``` Could you tell me how call these function and where to put this code. I totally noob. Just followed instructions to install server and uploaded all my 6k+ photos. Plus do you think I should delete all of them and reload?
Author
Owner

@kowoba commented on GitHub (Aug 10, 2025):

I have close to 10k of photos that Immich refuse to accept due to this problem. I use Immich "as a service" and so applying the quickfix is not an option, so is there any hope that there will be a permanent solution for this anytime soon?

@kowoba commented on GitHub (Aug 10, 2025): I have close to 10k of photos that Immich refuse to accept due to this problem. I use Immich "as a service" and so applying the quickfix is not an option, so is there any hope that there will be a permanent solution for this anytime soon?
Author
Owner

@alextran1502 commented on GitHub (Aug 11, 2025):

@kowoba Do you mind enable the beta timeline and try out the new upload mechanism, see if it fixes the issue?

@alextran1502 commented on GitHub (Aug 11, 2025): @kowoba Do you mind enable the beta timeline and try out the new upload mechanism, see if it fixes the issue?
Author
Owner

@kowoba commented on GitHub (Aug 11, 2025):

As I wrote, I use Immich "as a service" (by pikapods), and hence don't really have access to the code. However, it appears I can pass on parameters to the pod, and it appears that IMMICH_VERSION is one... if there's a way to enable the beta timeline using this parameter, I can try that. It's currently running 1.137.3.

@kowoba commented on GitHub (Aug 11, 2025): As I wrote, I use Immich "as a service" (by pikapods), and hence don't really have access to the code. However, it appears I can pass on parameters to the pod, and it appears that IMMICH_VERSION is one... if there's a way to enable the beta timeline using this parameter, I can try that. It's currently running 1.137.3.
Author
Owner

@w4vz commented on GitHub (Aug 13, 2025):

same issue for me; 1000+ photos failed to upload from the IOS client

here is a sample from the logs:

[Nest] 34  - 08/13/2025, 3:43:14 PM   ERROR [Api:AssetMediaService~671rrbv5] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
    at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26)
    at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6)
    at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
[Nest] 34  - 08/13/2025, 3:43:14 PM   ERROR [Api:ErrorInterceptor~671rrbv5] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
    at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26)
    at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6)
    at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
Query failed : {
  durationMs: 0.8743250370025635,
  error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
      at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '22008',
    where: "unnamed portal parameter $8 = '...'",
    file: 'datetime.c',
    line: '3773',
    routine: 'DateTimeParseError'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7ec67c0e-98cb-4ffa-a6a0-c8df35b36ab5',
    null,
    <Buffer 5a 0b 0e 87 13 ad 80 29 0e 03 2a dc 30 20 c3 95 cf c9 fa 3a>,
    '/usr/src/app/upload/upload/7ec67c0e-98bb-4ffa-a6a0-c8df35b36ab5/2a/f2/2af22621-136b-49dc-976b-fd1929077fc2.JPG',
    'DB8C8E4E-D1AC-4BA3-B8N4-9AF724C7F3E9/L0/001',
    '28f6f5e1dca1fb75020446d3fcae22fab8667353dcf1a9d956fd32c0842df4e2',
    2014-03-08T03:56:02.000Z,
    0000-12-30T00:00:00.000Z,
    2014-03-08T03:56:02.000Z,
    'IMAGE',
    false,
    '0:00:00.000000',
    'timeline',
    'IMG_0001.JPG'
  ]
}
@w4vz commented on GitHub (Aug 13, 2025): same issue for me; 1000+ photos failed to upload from the IOS client here is a sample from the logs: ``` [Nest] 34 - 08/13/2025, 3:43:14 PM ERROR [Api:AssetMediaService~671rrbv5] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) [Nest] 34 - 08/13/2025, 3:43:14 PM ERROR [Api:ErrorInterceptor~671rrbv5] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) Query failed : { durationMs: 0.8743250370025635, error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '22008', where: "unnamed portal parameter $8 = '...'", file: 'datetime.c', line: '3773', routine: 'DateTimeParseError' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '7ec67c0e-98cb-4ffa-a6a0-c8df35b36ab5', null, <Buffer 5a 0b 0e 87 13 ad 80 29 0e 03 2a dc 30 20 c3 95 cf c9 fa 3a>, '/usr/src/app/upload/upload/7ec67c0e-98bb-4ffa-a6a0-c8df35b36ab5/2a/f2/2af22621-136b-49dc-976b-fd1929077fc2.JPG', 'DB8C8E4E-D1AC-4BA3-B8N4-9AF724C7F3E9/L0/001', '28f6f5e1dca1fb75020446d3fcae22fab8667353dcf1a9d956fd32c0842df4e2', 2014-03-08T03:56:02.000Z, 0000-12-30T00:00:00.000Z, 2014-03-08T03:56:02.000Z, 'IMAGE', false, '0:00:00.000000', 'timeline', 'IMG_0001.JPG' ] } ```
Author
Owner

@jordanlambrecht commented on GitHub (Aug 30, 2025):

Also experiencing this error. Uploading from iOS/Apple Photos.

[Nest] 18  - 08/29/2025, 5:33:01 PM   DEBUG [Api:LoggingInterceptor~ibs0kb1l] POST /api/assets 201 11.33ms 172.19.0.1
[Nest] 18  - 08/29/2025, 5:33:01 PM VERBOSE [Api:LoggingInterceptor~ibs0kb1l] {"deviceAssetId":"7AF6E3C2-7066-490F-9A68-DF157C0679DA/L0/001","deviceId":"5a4f344ce4f1cb7de6b9dc770950511cba53f101ca1674559a6f6134ebf9d307","fileCreatedAt":"2015-06-13T06:30:02.000Z","fileModifiedAt":"0000-12-30T00:00:00.000Z","isFavorite":"false","duration":"0:00:00.000000"}
[Nest] 18  - 08/29/2025, 5:33:01 PM   DEBUG [Api:GlobalExceptionFilter~ibs0kb1l] HttpException(500): {"message":"Failed to upload asset","error":"Internal Server Error","statusCode":500}

Query failed : {
  durationMs: 1.3999579999945126,
  error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '22008',
    where: "unnamed portal parameter $8 = '...'",
    file: 'datetime.c',
    line: '3773',
    routine: 'DateTimeParseError'
  },

  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',

  params: [
    '1e50eade-0f3f-4c93-9c4f-ce59db313bcb',
    null,
    <Buffer 19 99 2c bf 36 75 bd d9 98 41 ef d0 52 57 cb 87 21 90 d0 b4>,
    '/usr/src/app/upload/upload/1e50eade-0f3f-4c93-9c4f-ce59db313bcb/b7/02/b7022feb-f17b-48b1-8ef4-61e504e58294.PNG',
    'B853EC29-EE8F-4C48-8901-059644176A06/L0/001',
    '5a4f344ce4f1cb7de6b9dc770950511cba53f101ca1674559a6f6134ebf9d307',
    2015-06-09T21:57:14.000Z,
    0000-12-30T00:00:00.000Z,
    2015-06-09T21:57:14.000Z,
    'IMAGE',
    false,
    '0:00:00.000000',
    'timeline',
    'IMG_3553.PNG'
  ]
}

[Nest] 18  - 08/29/2025, 5:33:05 PM   ERROR [Api:AssetMediaService~hw3fceqc] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"

PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
    at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
    at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
    at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
[Nest] 18  - 08/29/2025, 5:33:05 PM   ERROR [Api:ErrorInterceptor~hw3fceqc] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
    at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
    at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
    at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
    at Socket.emit (node:events:518:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
@jordanlambrecht commented on GitHub (Aug 30, 2025): Also experiencing this error. Uploading from iOS/Apple Photos. ``` [Nest] 18 - 08/29/2025, 5:33:01 PM DEBUG [Api:LoggingInterceptor~ibs0kb1l] POST /api/assets 201 11.33ms 172.19.0.1 [Nest] 18 - 08/29/2025, 5:33:01 PM VERBOSE [Api:LoggingInterceptor~ibs0kb1l] {"deviceAssetId":"7AF6E3C2-7066-490F-9A68-DF157C0679DA/L0/001","deviceId":"5a4f344ce4f1cb7de6b9dc770950511cba53f101ca1674559a6f6134ebf9d307","fileCreatedAt":"2015-06-13T06:30:02.000Z","fileModifiedAt":"0000-12-30T00:00:00.000Z","isFavorite":"false","duration":"0:00:00.000000"} [Nest] 18 - 08/29/2025, 5:33:01 PM DEBUG [Api:GlobalExceptionFilter~ibs0kb1l] HttpException(500): {"message":"Failed to upload asset","error":"Internal Server Error","statusCode":500} Query failed : { durationMs: 1.3999579999945126, error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '22008', where: "unnamed portal parameter $8 = '...'", file: 'datetime.c', line: '3773', routine: 'DateTimeParseError' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '1e50eade-0f3f-4c93-9c4f-ce59db313bcb', null, <Buffer 19 99 2c bf 36 75 bd d9 98 41 ef d0 52 57 cb 87 21 90 d0 b4>, '/usr/src/app/upload/upload/1e50eade-0f3f-4c93-9c4f-ce59db313bcb/b7/02/b7022feb-f17b-48b1-8ef4-61e504e58294.PNG', 'B853EC29-EE8F-4C48-8901-059644176A06/L0/001', '5a4f344ce4f1cb7de6b9dc770950511cba53f101ca1674559a6f6134ebf9d307', 2015-06-09T21:57:14.000Z, 0000-12-30T00:00:00.000Z, 2015-06-09T21:57:14.000Z, 'IMAGE', false, '0:00:00.000000', 'timeline', 'IMG_3553.PNG' ] } [Nest] 18 - 08/29/2025, 5:33:05 PM ERROR [Api:AssetMediaService~hw3fceqc] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) [Nest] 18 - 08/29/2025, 5:33:05 PM ERROR [Api:ErrorInterceptor~hw3fceqc] Unknown error: PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) ```
Author
Owner

@kowoba commented on GitHub (Aug 30, 2025):

Meanwhile, server is now v1.138.0 and client is latest, and failed uploads are now 468 and no longer 10k-ish, so there's certainly been improvements. I noticed that if I on the iPhone use the built-in gallery/photos app and adjust the timestamp of a photo by just accepting the default, original date/time, and hit "adjust", the photo will be uploaded, but it will show up as "today" rather than the date it was adjusted to. I will wait til 1.40.0 (or beyond) hits my server and see if things have improved even further.

@kowoba commented on GitHub (Aug 30, 2025): Meanwhile, server is now v1.138.0 and client is latest, and failed uploads are now 468 and no longer 10k-ish, so there's certainly been improvements. I noticed that if I on the iPhone use the built-in gallery/photos app and adjust the timestamp of a photo by just accepting the default, original date/time, and hit "adjust", the photo will be uploaded, but it will show up as "today" rather than the date it was adjusted to. I will wait til 1.40.0 (or beyond) hits my server and see if things have improved even further.
Author
Owner

@kowoba commented on GitHub (Sep 2, 2025):

And today, the server was upgraded rto 1.140.1, but there's no difference from 1.138.0 concerning the last few hundred files. The log says (for example):

sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
params: [
'2a564e85-1cd2-4d1e-9e3f-521c7c3a4c89',
null,
<Buffer b5 ee c2 08 00 85 22 5b 2d 55 58 98 99 cc 52 10 aa f2 d7 04>,
'/photos/upload/2a564e85-1cd2-4d1e-9e3f-521c7c3a4c89/61/99/619901cb-f443-4eb7-91fa-26e107d63173.JPG',
'E9846814-B1F5-4B7B-895C-B8B41D8EE6C5/L0/001',
'3c0c3069da1054a5c8f672800fd20f23f5653e1efc9415b3ece326ab5c6c68f7',
2012-03-19T18:08:24.000Z,
0000-12-30T00:00:00.000Z,
2012-03-19T18:08:24.000Z,
'IMAGE',
false,
'0:00:00.000000',
'timeline',
'IMG_0307.JPG'
]
}
[Nest] 179  - 09/02/2025, 1:48:36 PM   ERROR [Api:AssetMediaService~hxf7mw32] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z"
[Nest] 179  - 09/02/2025, 1:49:03 PM     LOG [Api:EventRepository] Websocket Connect:    LHi0KRxV6F6KFOT-AAAH

Would it not be possible to compare all the timestamps, throw away the ones that are invalid somehow, and then use earliest date that is valid? It's a little ironic that it fails like this, as in the list over "Failed Backup (506)" it shows a timestamp just fine (!)

@kowoba commented on GitHub (Sep 2, 2025): And today, the server was upgraded rto 1.140.1, but there's no difference from 1.138.0 concerning the last few hundred files. The log says (for example): ``` sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '2a564e85-1cd2-4d1e-9e3f-521c7c3a4c89', null, <Buffer b5 ee c2 08 00 85 22 5b 2d 55 58 98 99 cc 52 10 aa f2 d7 04>, '/photos/upload/2a564e85-1cd2-4d1e-9e3f-521c7c3a4c89/61/99/619901cb-f443-4eb7-91fa-26e107d63173.JPG', 'E9846814-B1F5-4B7B-895C-B8B41D8EE6C5/L0/001', '3c0c3069da1054a5c8f672800fd20f23f5653e1efc9415b3ece326ab5c6c68f7', 2012-03-19T18:08:24.000Z, 0000-12-30T00:00:00.000Z, 2012-03-19T18:08:24.000Z, 'IMAGE', false, '0:00:00.000000', 'timeline', 'IMG_0307.JPG' ] } [Nest] 179 - 09/02/2025, 1:48:36 PM ERROR [Api:AssetMediaService~hxf7mw32] Error uploading file PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" PostgresError: date/time field value out of range: "0000-12-30T00:00:00.000Z" [Nest] 179 - 09/02/2025, 1:49:03 PM LOG [Api:EventRepository] Websocket Connect: LHi0KRxV6F6KFOT-AAAH ``` Would it not be possible to compare all the timestamps, throw away the ones that are invalid somehow, and then use earliest date that is valid? It's a little ironic that it fails like this, as in the list over "Failed Backup (506)" it shows a timestamp just fine (!)
Author
Owner

@kowoba commented on GitHub (Sep 2, 2025):

Or at least let fileCreatedAt replace fileModifiedAt when fileModifiedAt is invalid (or vice versa).

@kowoba commented on GitHub (Sep 2, 2025): Or at least let fileCreatedAt replace fileModifiedAt when fileModifiedAt is invalid (or vice versa).
Author
Owner

@jkoopmann commented on GitHub (Sep 2, 2025):

If you download the file and run exiftool against it, what metadata does the file show? And can you identify it in Photos app on the phone?

I had a similar issue today with @alextran1502 and maybe there is a way to use the (correct?) date from photos/iCloud in case there is no date (or no valid date) in the files metadata. This case might be different in the way that there are dates in it (in my particular case today there was no date at all in the metadata for whatever reason) and the dates in it are not valid. Still the fix might be very similar. If there is no date or just silly ones while there is a reasonable date in iCloud (and assuming immich can fetch it which in my case today it was able to), use the iCloud date as a last resort.

@jkoopmann commented on GitHub (Sep 2, 2025): If you download the file and run exiftool against it, what metadata does the file show? And can you identify it in Photos app on the phone? I had a similar issue today with @alextran1502 and maybe there is a way to use the (correct?) date from photos/iCloud in case there is no date (or no valid date) in the files metadata. This case might be different in the way that there are dates in it (in my particular case today there was no date at all in the metadata for whatever reason) and the dates in it are not valid. Still the fix might be very similar. If there is no date or just silly ones while there is a reasonable date in iCloud (and assuming immich can fetch it which in my case today it was able to), use the iCloud date as a last resort.
Author
Owner

@kowoba commented on GitHub (Sep 22, 2025):

Can confirm that my problem is now fixed,all 33794 objects have been uploaded. Thanks!

@kowoba commented on GitHub (Sep 22, 2025): Can confirm that my problem is now fixed,all 33794 objects have been uploaded. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5329