immich icon indicating copy to clipboard operation
immich copied to clipboard

New install mobile app only showing photos in albums from timeline, all album-less photos missing, web view shows everything.

Open ignitionnight opened this issue 9 months ago • 19 comments
trafficstars

The bug

On February 6th I upgraded mine and my wife's phones to S25+. When I reinstalled immich to our phones I noticed that most pictures were missing (thousands) on the mobile app. I did not notice anything missing before I wiped the old phones as I double checked everything was backed up before switching, I assume the timeline was already cached. I checked the webview and all photos and videos were present. I uninstalled, reinstalled and issue persisted. I even uninstalled, and wiped phone's cache partition in recovery mode just in case, issue persisted.

The log file shows an error related to date, main error info is "[Nest] 260 - 02/11/2025, 9:06:33 PM ERROR [Api:ErrorInterceptor~jxz1f61i] Unknown error: PostgresError: date field value out of range: 0-02-11" full error log posted below.

I was on release v1.125.7 before the phone upgrade, but I waited for the next update in case it resolved, but the issue was still present on v1.126.1 after update.

I searched the issues here, and went to discord. Found a similar issue, however his logs were different. I added my logs and info and was asked to create an issue here and include a picture missing from mobile timeline.

When gathering logs and images to share, I realized the only pictures I was seeing were in albums. I very rarely use albums and most albums were created by google photos memories before my import. Additionally, I have a second account with the same app in my secure folder I use for nsfw photos 🤣. These were never uploaded to google, and were never added to any album. This account shows every photo.

Short Story - When albums exist android app shows ONLY photos in albums. When there are no albums, android app shows all photos. Web view always shows all photos.

Immich Log.txt

Mobile Error while getting remote assets.txt

Showing in mobile app Image

Not showing in mobile app Image

The OS that Immich Server is running on

Unraid 7.0

Version of Immich Server

v1.126.1

Version of Immich Mobile App

v1.126.1

Platform with the issue

  • [ ] Server
  • [ ] Web
  • [x] Mobile

Your docker-compose.yml content

<?xml version="1.0"?>
<Container version="2">
  <Name>immich</Name>
  <Repository>ghcr.io/imagegenius/immich</Repository>
  <Registry>https://github.com/orgs/imagegenius/packages/container/package/immich</Registry>
  <Network>bridge</Network>
  <MyIP/>
  <Shell>bash</Shell>
  <Privileged>false</Privileged>
  <Support>https://github.com/imagegenius/docker-immich/issues/new/choose</Support>
  <Project>https://immich.app/</Project>
  <Overview>Immich is a high performance self-hosted photo and video backup solution.</Overview>
  <Category>Backup: Cloud: MediaApp:Photos spotlight:</Category>
  <WebUI>http://[IP]:[PORT:8080]</WebUI>
  <TemplateURL>https://raw.githubusercontent.com/imagegenius/templates/master/unraid/immich.xml</TemplateURL>
  <Icon>https://raw.githubusercontent.com/imagegenius/templates/main/unraid/img/immich.png</Icon>
  <ExtraParams/>
  <PostArgs/>
  <CPUset/>
  <DateInstalled>1736070795</DateInstalled>
  <DonateText/>
  <DonateLink/>
  <Requires>brPostgreSQL 14/15/16 with (https://github.com/tensorchord/pgvecto.rs), RedisbrThis container requires an external application to be run separately.brYou can also use a docker mods to start redis within the container,brSet `DOCKER_MODS=imagegenius/mods:universal-redis`, and `REDIS_HOSTNAME` to `localhost`.br&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;</Requires>
  <Config Name="WebUI" Target="8080" Default="8080" Mode="tcp" Description="WebUI Port" Type="Port" Display="always" Required="true" Mask="false">8080</Config>
  <Config Name="Path: /photos" Target="/photos" Default="" Mode="rw" Description="Contains all the photos uploaded to Immich" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/data/media/photos/</Config>
  <Config Name="Path: /libraries" Target="/libraries" Default="" Mode="rw" Description="External libraries to track assets stored outside of Immich" Type="Path" Display="always" Required="false" Mask="false"/>
  <Config Name="DB_HOSTNAME" Target="DB_HOSTNAME" Default="192.168.1.x" Mode="{3}" Description="PostgreSQL Host" Type="Variable" Display="always" Required="true" Mask="false">10.0.0.5</Config>
  <Config Name="DB_USERNAME" Target="DB_USERNAME" Default="postgres" Mode="{3}" Description="PostgreSQL Username" Type="Variable" Display="always" Required="true" Mask="false">postgres</Config>
  <Config Name="DB_PASSWORD" Target="DB_PASSWORD" Default="postgres" Mode="{3}" Description="PostgreSQL Password" Type="Variable" Display="always" Required="true" Mask="true">postgres</Config>
  <Config Name="DB_DATABASE_NAME" Target="DB_DATABASE_NAME" Default="immich" Mode="{3}" Description="PostgreSQL Database Name" Type="Variable" Display="always" Required="true" Mask="false">immich</Config>
  <Config Name="REDIS_HOSTNAME" Target="REDIS_HOSTNAME" Default="192.168.1.x" Mode="{3}" Description="Redis Hostname" Type="Variable" Display="always" Required="true" Mask="false">localhost</Config>
  <Config Name="DB_PORT" Target="DB_PORT" Default="5432" Mode="{3}" Description="PostgreSQL Port" Type="Variable" Display="always" Required="false" Mask="false">5433</Config>
  <Config Name="REDIS_PORT" Target="REDIS_PORT" Default="6379" Mode="{3}" Description="Redis Port" Type="Variable" Display="always" Required="false" Mask="false">6379</Config>
  <Config Name="REDIS_PASSWORD" Target="REDIS_PASSWORD" Default="" Mode="{3}" Description="Redis password" Type="Variable" Display="always" Required="false" Mask="true"/>
  <Config Name="MACHINE_LEARNING_HOST" Target="MACHINE_LEARNING_HOST" Default="0.0.0.0" Mode="{3}" Description="Immich machine-learning host" Type="Variable" Display="always" Required="false" Mask="false">0.0.0.0</Config>
  <Config Name="MACHINE_LEARNING_PORT" Target="MACHINE_LEARNING_PORT" Default="3003" Mode="{3}" Description="Immich machine-learning port" Type="Variable" Display="always" Required="false" Mask="false">3003</Config>
  <Config Name="MACHINE_LEARNING_WORKERS" Target="MACHINE_LEARNING_WORKERS" Default="1" Mode="{3}" Description="Machine learning workers" Type="Variable" Display="always" Required="false" Mask="false">1</Config>
  <Config Name="MACHINE_LEARNING_WORKER_TIMEOUT" Target="MACHINE_LEARNING_WORKER_TIMEOUT" Default="120" Mode="{3}" Description="Machine learning worker timeout" Type="Variable" Display="always" Required="false" Mask="false">120</Config>
  <Config Name="Redis" Target="DOCKER_MODS" Default="" Mode="" Description="" Type="Variable" Display="always" Required="false" Mask="false">imagegenius/mods:universal-redis</Config>
  <Config Name="Appdata" Target="/config" Default="/mnt/user/appdata/immich" Mode="rw" Description="Contains machine learning models (~1.5GB with default models)" Type="Path" Display="advanced" Required="true" Mask="false">/mnt/user/appdata/immich</Config>
  <Config Name="PUID" Target="PUID" Default="99" Mode="{3}" Description="UID for permissions. Do not change unless you know what you're doing." Type="Variable" Display="advanced-hide" Required="true" Mask="false">99</Config>
  <Config Name="PGID" Target="PGID" Default="100" Mode="{3}" Description="GID for permissions. Do not change unless you know what you're doing." Type="Variable" Display="advanced-hide" Required="true" Mask="false">100</Config>
  <Config Name="UMASK" Target="UMASK" Default="022" Mode="{3}" Description="UMASK for newly created files. Do not change unless you know what you're doing." Type="Variable" Display="advanced-hide" Required="false" Mask="false">022</Config>
  <TailscaleStateDir/>
</Container>

Your .env content

N/A

Reproduction steps

  1. New install on new phone

Relevant log output

########## Immich Docker Log ##########

[Nest] 260  - 02/11/2025, 9:06:33 PM   ERROR [Api:ErrorInterceptor~jxz1f61i] Unknown error: PostgresError: date field value out of range: 0-02-11
PostgresError: date field value out of range: 0-02-11
    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)
Query failed : {
  durationMs: 2.8514900002628565,
  error: PostgresError: date field value out of range: 0-02-11
      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) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '22008',
    file: 'date.c',
    line: '265',
    routine: 'make_date'
  },
  sql: `with "res" as (with "today" as (select make_date(year::int, $1::int, $2::int) as "date" from generate_series((select date_part('year', min(("localDateTime" at time zone 'UTC')::date))::int from assets), date_part('year', current_date)::int - 1) as "year") select "a".*, to_json("exif") as "exifInfo" from "today" inner join lateral (select "assets".* from "assets" inner join "asset_job_status" on "assets"."id" = "asset_job_status"."assetId" where "asset_job_status"."previewAt" is not null and (assets."localDateTime" at time zone 'UTC')::date = today.date and "assets"."ownerId" = any($3::uuid[]) and "assets"."isVisible" = $4 and "assets"."isArchived" = $5 and exists (select from "asset_files" where "assetId" = "assets"."id" and "asset_files"."type" = $6) and "assets"."deletedAt" is null order by (assets."localDateTime" at time zone 'UTC')::date desc limit $7) as "a" on true inner join "exif" on "a"."id" = "exif"."assetId") select ((now() at time zone 'UTC')::date - ("localDateTime" at time zone 'UTC')::date) / 365 as "yearsAgo", json_agg("res") as "assets" from "res" group by ("localDateTime" at time zone 'UTC')::date order by ("localDateTime" at time zone 'UTC')::date desc limit $8`,
  params: [
    2,
    11,
    '{d59da640-433a-4e03-9149-5c80a0247945}',
    true,
    false,
    'preview',
    20,
    10
  ]
}

########## Mobile App Error Log ##########
Message - Error while getting remote asset
Details - Null check operator used on a null value
From - Assert Service

Stack Trace
#0      AssetResponseDto.fromJson (package:openapi/model/asset_response_dto.dart:292)
#1      ApiClient.fromJson (package:openapi/api_client.dart:260)
#2      ApiClient.fromJson.<anonymous closure> (package:openapi/api_client.dart:657)
#3      MappedIterable.elementAt (dart:_internal/iterable.dart:385)
#4      ListIterator.moveNext (dart:_internal/iterable.dart:354)
#5      new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:163)
#6      new _List.of (dart:core-patch/array.dart:128)
#7      new List.of (dart:core-patch/array_patch.dart:39)
#8      ListIterable.toList (dart:_internal/iterable.dart:224)
#9      ApiClient.fromJson (package:openapi/api_client.dart:658)
#10     ApiClient.deserialize (package:openapi/api_client.dart:158)
<asynchronous suspension>
#11     SyncApi.getFullSyncForUser (package:openapi/api/sync_api.dart:108)
<asynchronous suspension>
#12     AssetService._getRemoteAssets (package:immich_mobile/services/asset.service.dart:145)
<asynchronous suspension>
#13     SyncService._syncRemoteAssetsForUser (package:immich_mobile/services/sync.service.dart:267)
<asynchronous suspension>
#14     SyncService._syncRemoteAssetsFull (package:immich_mobile/services/sync.service.dart:257)
<asynchronous suspension>
#15     SyncService.syncRemoteAssetsToDb.<anonymous closure> (package:immich_mobile/services/sync.service.dart:92)
<asynchronous suspension>
#16     AsyncMutex.run.<anonymous closure> (package:immich_mobile/utils/async_mutex.dart:15)
<asynchronous suspension>

Additional information

No response

ignitionnight avatar Feb 12 '25 05:02 ignitionnight

Can you go into the account settings > features > disable memory feature and see if everything show up?

alextran1502 avatar Feb 12 '25 05:02 alextran1502

Does not appear to have any effect.

Can you go into the account settings > features > disable memory feature and see if everything show up?

ignitionnight avatar Feb 12 '25 05:02 ignitionnight

I have the same issue: the PostGresError for date out of range on the server and the Error while getting remote asset on Mobile. I started having the problem just today. I'm not sure if that was before or after upgrading to v1.126.1; I was also on v1.125.7 before.

tahmidul612 avatar Feb 13 '25 08:02 tahmidul612

This is the issue with bad date information getting into the database pre-kysely. So now, when we query them, the date return as invalid date.

Can you guys check in the database, in the assets table, sort by columns fileCreatedAt and fileModifiedAt and see if you can spot weird-looking dates?

The two commands are

docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a."fileCreatedAt" from assets a order by a."fileCreatedAt" limit 10;'
docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a."fileModifiedAt" from assets a order by a."fileModifiedAt" limit 10;'

alextran1502 avatar Feb 13 '25 21:02 alextran1502

I get this with either command

      fileModifiedAt       
---------------------------
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
 0001-12-31 23:58:56+00 BC 
(10 rows)                  

tahmidul612 avatar Feb 15 '25 10:02 tahmidul612

I get this with either command

  fileModifiedAt       

0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC 0001-12-31 23:58:56+00 BC (10 rows)

Checking originalFileName for these entries, I see that those are all the video part of a live/motion photo. Also, when I opened the photo in immich, the motion/video does not play.

tahmidul612 avatar Feb 15 '25 13:02 tahmidul612

          fileCreatedAt          
---------------------------------
 0001-12-31 16:58:12-06:59:56 BC
 2003-12-29 11:16:59-07
 2003-12-29 15:57:58-07
 2004-01-01 00:00:11-07
 2004-01-01 00:19:46-07
 2004-02-28 18:31:32-07
 2004-07-19 18:55:08-06
 2004-07-19 18:56:09-06
 2004-07-19 18:58:20-06
 2004-07-19 18:59:34-06
(10 rows)
         fileModifiedAt          
---------------------------------
 0001-12-31 16:59:08-06:59:56 BC
 0001-12-31 16:59:08-06:59:56 BC
 0001-12-31 16:59:08-06:59:56 BC
 0001-12-31 16:59:08-06:59:56 BC
 0001-12-31 16:59:08-06:59:56 BC
 2003-12-29 11:16:59-07
 2003-12-29 15:57:58-07
 2004-01-01 00:00:11-07
 2004-01-01 00:19:46-07
 2004-02-28 18:31:32-07
(10 rows)

ignitionnight avatar Feb 15 '25 23:02 ignitionnight

I too face similar issue, these are the output from my query with date and file names. Only 4 bad files with invalid file creation date.

          fileCreatedAt          |          originalFileName           
---------------------------------+-------------------------------------
 0001-12-31 18:08:12-05:50:36 BC | download_20190529_220733-edited.jpg
 0001-12-31 18:08:12-05:50:36 BC | 201711022233281000-edited.jpg
 0001-12-31 18:08:12-05:50:36 BC | download_20190529_220749-edited.jpg
 0001-12-31 18:08:12-05:50:36 BC | IMG_20171203_130610-edited.jpg

more bad modified date

         fileModifiedAt          |          originalFileName           
---------------------------------+-------------------------------------
 0001-12-31 18:08:48-05:50:36 BC | IMG_6200-edited.JPG
 0001-12-31 18:08:48-05:50:36 BC | IMG_20190121_121603(1).jpg
 0001-12-31 18:08:48-05:50:36 BC | IMG_20161214_214813-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | IMG_20161111_184932-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | IMG_20170823_083137-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | download_20190529_220749-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | download_20190529_220733-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | 201711022233281000-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | IMG_20161004_175938-edited.jpg
 0001-12-31 18:08:48-05:50:36 BC | IMG_20180414_135148-edited.jpg
(10 rows)

Alpha2Bingo avatar Feb 19 '25 18:02 Alpha2Bingo

@tahmidul612, @ignitionnight, @Alpha2Bingo To fix this issue, can you remove those erroneous data records from the database. You can run the following query

delete
from assets a
where a."fileModifiedAt" < '1000-01-01 00:00:00'
or a."fileCreatedAt" < '1000-01-01 00:00:00';

alextran1502 avatar Feb 19 '25 18:02 alextran1502

@alextran1502 Will I lose the photos/videos from immich? I'm running through unraid and my terminal did not output original file names like alpha2bingo's terminal did. If I can find a bad file I'd love to download it to fix the metadata then re-upload it after I purge it from the database. My wife's library files does have a "video" that's less than a second long in folder with the year 0, but I can't find that in her timeline through webview, so I don't know where to delete it from immich.

Sorry I'm super new to all this, trying to be helpful but wouldn't hurt to draw me a picture with crayons so I know what I'm doing haha.

ignitionnight avatar Feb 20 '25 03:02 ignitionnight

@ignitionnight you can try to find the video by scrolling to the bottom of the timeline on the web. Let me know if it is helpful

alextran1502 avatar Feb 20 '25 03:02 alextran1502

@alextran1502 I get a string of unclickable gray boxes with "Invalid Date" as the grouping. And an error at the top saying Failed to Load Assets. At this point, the lost photo is a lost photo, I guess I'm okay if we lose a few.... although I would definitely feel more comfortable if I could find the original files and try to fix them first. Especially concerned because her original Google Takeout was 136 gigs, and her immich account is only showing 96 gigs..... 40 gigs is definitely way too much to lose.

ignitionnight avatar Feb 20 '25 03:02 ignitionnight

@ignitionnight feel free to ping me on Discord, I can help walk you through the database command to find those files

alextran1502 avatar Feb 20 '25 03:02 alextran1502

SOLVED!

Just in case anybody needs it, here are the things Alex helped me with.

Following command helped me identify the affected files, so I could back them up, fix the dates and re-upload.

select a.id, a."fileCreatedAt", a."fileModifiedAt", a."originalPath" from assets a order by a."fileModifiedAt" limit 10;

Then this command deleted the responsible assets and completely fixed my instance.

delete from assets a where a."fileModifiedAt" < '1000-01-01 00:00:00';

Thanks again!

ignitionnight avatar Feb 20 '25 05:02 ignitionnight

I too am happy to report that after deleting the invalid date records, I was able to get the issue fixed. But before deleting records, I did export the list of files that had the invalid date before going with the delete command though. I had around 150 items that had to be purged. Thanks a lot for the suggestion @alextran1502. I still don't know if this is going to creep back up with new uploaded photos because this wasn't an issue before but popped up after recent immich updates. In any case, some solid error handling in the server side would be really useful.

Alpha2Bingo avatar Feb 21 '25 18:02 Alpha2Bingo

@Alpha2Bingo this issue occurs after we migrating to the new database engine to be used with Kysely.

The older database engine insert these invalid date and retrieved different from the new one.

Now, after removing those erroneous records, it shouldn't happen again even if you reupload those files. The insertion and retrieval of records use the same format now

alextran1502 avatar Feb 21 '25 18:02 alextran1502

Excellent! thank you for the explanation, @alextran1502.

Alpha2Bingo avatar Feb 21 '25 23:02 Alpha2Bingo

I have a simliar issue, it behaves the same that only images that are in albums show on the phone, however I don't have any photos or videos with invalid dates since I started with v1.126.1. And the only error I can find in the logs are a few simliar to this [Nest] 8 - 02/24/2025, 12:04:45 AM ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-person-thumbnail): Error: extract_area: bad extract area [Nest] 8 - 02/24/2025, 12:04:45 AM ERROR [Microservices:JobService] Error: extract_area: bad extract area at Sharp.toFile (/usr/src/app/node_modules/sharp/lib/output.js:90:19) at MediaRepository.generateThumbnail (/usr/src/app/dist/repositories/media.repository.js:62:14) at descriptor.value (/usr/src/app/dist/repositories/telemetry.repository.js:144:39) at PersonService.handleGeneratePersonThumbnail (/usr/src/app/dist/services/person.service.js:453:36) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) [Nest] 8 - 02/24/2025, 12:04:45 AM ERROR [Microservices:JobService] Object(1) { id: 'be62dbfc-0d78-4d6f-88c6-6b4569b0b738' }

jorblad avatar Feb 24 '25 08:02 jorblad

@jorblad you don't have similar issue, your issue is different. You can open a new issue and post your setup to get help

alextran1502 avatar Feb 24 '25 12:02 alextran1502

SOLVED!

Just in case anybody needs it, here are the things Alex helped me with.

Following command helped me identify the affected files, so I could back them up, fix the dates and re-upload.

select a.id, a."fileCreatedAt", a."fileModifiedAt", a."originalPath" from assets a order by a."fileModifiedAt" limit 10;

Then this command deleted the responsible assets and completely fixed my instance.

delete from assets a where a."fileModifiedAt" < '1000-01-01 00:00:00';

Thanks again!

I had the same issue as this gray boxes at the bottom with invalid date and app not loading resources. I posted on Reddit and a maintainer pointed me to this thread here on GitHub.

I have ran the commands for docker via SSH on Synology NAS. I ran these to fix the issue:

To find the problem files:

sudo docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a.id, a."fileCreatedAt", a."fileModifiedAt", a."originalPath" from assets a order by a."fileModifiedAt" limit 100;'

To delete the problem files if they all show a modifies date in BC

sudo docker exec immich_postgres psql --dbname=immich --username=postgres -c "delete from assets a where a.\"fileModifiedAt\"::text like '%BC%'"

To verify/confirm that all the BC files are gone

sudo docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a.id, a."fileCreatedAt", a."fileModifiedAt", a."originalPath" from assets a order by a."fileModifiedAt" limit 100;'

buildplan avatar Mar 18 '25 20:03 buildplan

New Immich user here. I recently set up Immich (v1.130.0 - last night updated to v1.130.3) and initiated a scan of my external library three days ago. Last night, I attempted to connect my Android app (Fdroid version 1.129.0.build.187) to the server.

Initially, nothing appeared in the timeline—only a message. After searching through GitHub issues, I found that selecting a folder for backup removed the message, allowing me to see my assets in the app. However, my timeline in the app does not match what I see in the web interface.

Debugging Steps Taken:

  1. Ran queries to check for potential problematic assets. I found 13 assets with creation dates before the year 1000 and attempted to delete them:
    docker exec immich_postgres psql --dbname=immich --username=postgres -c "DELETE FROM assets WHERE \"fileModifiedAt\" < '1000-01-01 00:00:00' OR \"fileCreatedAt\" < '1000-01-01 00:00:00';"
    
  2. Despite deleting these assets, the issue persists.

Query Results:

Query 1 Output:

root@immich:~/immich-app# docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a.id, a."fileCreatedAt", a."fileModifiedAt", a."originalPath" from assets a order by a."fileModifiedAt" limit 10;'
                  id                  |     fileCreatedAt      |     fileModifiedAt     |                originalPath                 
--------------------------------------+------------------------+------------------------+---------------------------------------------
 e317dc45-562b-459f-8968-8ff6faf747fb | 2000-08-09 16:10:26+00 | 2000-08-09 16:10:26+00 | /home/joop/pictures/2000/08/09/PHO00000.JPG
 e17fcec5-4b2f-4a3a-ac00-a1f73bd6d1f2 | 2000-08-09 16:11:18+00 | 2000-08-09 16:11:18+00 | /home/joop/pictures/2000/08/09/PHO00001.JPG
 bc697030-9500-4364-83b4-faf8007ea5f4 | 2000-08-09 16:11:20+00 | 2000-08-09 16:11:20+00 | /home/joop/pictures/2000/08/09/PHO00002.JPG
 99a28a54-d5ef-43ac-afb4-0fd74c3d5ffe | 2000-08-09 16:11:22+00 | 2000-08-09 16:11:22+00 | /home/joop/pictures/2000/08/09/PHO00003.JPG
 53044646-6030-4615-8792-01578d4cd9db | 2000-08-09 16:12:52+00 | 2000-08-09 16:12:52+00 | /home/joop/pictures/2000/08/09/PHO00004.JPG
 6084b7d7-c332-4339-9962-c2701fd28878 | 2000-08-09 16:14:06+00 | 2000-08-09 16:14:06+00 | /home/joop/pictures/2000/08/09/PHO00005.JPG
 6958fb6a-3a2b-4b75-9225-0e138f0def34 | 2000-08-09 16:15:00+00 | 2000-08-09 16:15:00+00 | /home/joop/pictures/2000/08/09/PHO00006.JPG
 7ca87fa5-d5d6-466a-b671-891e112850be | 2000-08-09 16:15:42+00 | 2000-08-09 16:15:42+00 | /home/joop/pictures/2000/08/09/PHO00007.JPG
 10785387-0bda-4d75-abc8-49f34fc35e52 | 2000-08-09 16:15:44+00 | 2000-08-09 16:15:44+00 | /home/joop/pictures/2000/08/09/PHO00008.JPG
 a35d00e6-817d-4ad5-b254-36ca2fbfd2a4 | 2000-08-09 16:16:20+00 | 2000-08-09 16:16:20+00 | /home/joop/pictures/2000/08/09/PHO00009.JPG
(10 rows)

Query 2 Output:

root@immich:~/immich-app# docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a."localDateTime" from assets a order by a."localDateTime" limit 10;'
     localDateTime      
------------------------
 2000-08-09 16:10:26+00
 2000-08-09 16:11:18+00
 2000-08-09 16:11:20+00
 2000-08-09 16:11:22+00
 2000-08-09 16:12:52+00
 2000-08-09 16:14:06+00
 2000-08-09 16:15:00+00
 2000-08-09 16:15:42+00
 2000-08-09 16:15:44+00
 2000-08-09 16:16:20+00
(10 rows)

Environment Details:

Docker Setup:

 cat docker-compose.yml 
#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /mnt/data/pictures:/home/joop/pictures:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '80:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.ml.yml
      service: openvino        
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: >-
      postgres -c shared_preload_libraries=vectors.so -c 'search_path="$$user", public, vectors' -c logging_collector=on -c max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on
    restart: always

volumes:
  model-cache:

Additional Info:

I also reset the Android app and logged in again to gather fresh logs. Here are the logs:

2025-03-29 07:12:10.422050 | info     | BackupNotifier       | _getBackupAlbumsInfo: Found 40 available albums |
2025-03-29 07:12:09.988550 | info     | BackupNotifier       | Found 40 local albums |
2025-03-29 07:09:42.994948 | info     | AlbumService         | Syncing completed. Changes: true |
2025-03-29 07:09:42.994923 | info     | SyncService          | Added a new local album to DB: De dokter |
2025-03-29 07:09:42.991651 | info     | SyncService          | Upserted 1 assets into the DB |
2025-03-29 07:09:42.989192 | info     | SyncService          | 0 assets already existed in DB, to upsert 1 |
2025-03-29 07:09:42.918693 | info     | SyncService          | Syncing a new local album to DB: De dokter |
2025-03-29 07:09:42.917680 | info     | AlbumService         | 'Recents' is not selected, keeping only selected albums |
2025-03-29 07:09:42.917441 | info     | AlbumService         | Found 40 device albums |
2025-03-29 07:09:38.367013 | info     | BackupNotifier       | No assets are selected for back up |
2025-03-29 07:09:38.267 | info     | BackupNotifier       | _getBackupAlbumsInfo: Found 40 available albums |
2025-03-29 07:09:37.848344 | info     | BackupNotifier       | Found 40 local albums |
2025-03-29 07:09:36.330826 | info     | BackupNotifier       | No assets are selected for back up |
2025-03-29 07:09:36.254911 | info     | BackupNotifier       | _getBackupAlbumsInfo: Found 40 available albums |
2025-03-29 07:09:35.822355 | info     | BackupNotifier       | Found 40 local albums |
2025-03-29 07:08:03.290002 | info     | AssetNotifier        | Load assets: 2310ms |
2025-03-29 07:08:03.288732 | info     | AlbumService         | Found 0 device albums |
2025-03-29 07:08:03.164827 | severe   | AssetService         | Error while getting remote assets | Null check operator used on a null value |
#0      AssetResponseDto.fromJson (package:openapi/model/asset_response_dto.dart:291)
#1      ApiClient.fromJson (package:openapi/api_client.dart:264)
#2      ApiClient.fromJson.<anonymous closure> (package:openapi/api_client.dart:677)
#3      MappedIterable.elementAt (dart:_internal/iterable.dart:385)
#4      ListIterator.moveNext (dart:_internal/iterable.dart:354)
#5      new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:163)
#6      new _List.of (dart:core-patch/array.dart:128)
#7      new List.of (dart:core-patch/array_patch.dart:39)
#8      ListIterable.toList (dart:_internal/iterable.dart:224)
#9      ApiClient.fromJson (package:openapi/api_client.dart:678)
#10     ApiClient.deserialize (package:openapi/api_client.dart:158)
<asynchronous suspension>
#11     SyncApi.getFullSyncForUser (package:openapi/api/sync_api.dart:147)
<asynchronous suspension>
#12     AssetService._getRemoteAssets (package:immich_mobile/services/asset.service.dart:150)
<asynchronous suspension>
#13     SyncService._syncRemoteAssetsForUser (package:immich_mobile/services/sync.service.dart:267)
<asynchronous suspension>
#14     SyncService._syncRemoteAssetsFull (package:immich_mobile/services/sync.service.dart:257)
<asynchronous suspension>
#15     SyncService.syncRemoteAssetsToDb.<anonymous closure> (package:immich_mobile/services/sync.service.dart:92)
<asynchronous suspension>
#16     AsyncMutex.run.<anonymous closure> (package:immich_mobile/utils/async_mutex.dart:15)
<asynchronous suspension>

2025-03-29 07:07:07.557462 | severe   | AuthService          | Error logging out | LateInitializationError: Field 'authenticationApi' has not been initialized. |
#0      AuthApiRepository.logout (package:immich_mobile/repositories/auth_api.repository.dart)
#1      AuthService.logout (package:immich_mobile/services/auth.service.dart:99)
#2      AuthNotifier.logout (package:immich_mobile/providers/auth.provider.dart:68)
#3      SplashScreenPageState.resumeSession (package:immich_mobile/pages/common/splash_screen.page.dart:70)
#4      SplashScreenPageState.initState.<anonymous closure> (package:immich_mobile/pages/common/splash_screen.page.dart:29)
#5      _RootZone.run (dart:async/zone.dart:1655)
#6      _FutureListener.handleWhenComplete (dart:async/future_impl.dart:206)
#7      Future._propagateToListeners.handleWhenCompleteCallback (dart:async/future_impl.dart:831)
#8      Future._propagateToListeners (dart:async/future_impl.dart:887)
#9      Future._addListener.<anonymous closure> (dart:async/future_impl.dart:472)
#10     _microtaskLoop (dart:async/schedule_microtask.dart:40)
#11     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

2025-03-29 07:07:07.557356 | severe   | SplashScreenPage     | Unable to login using offline or online methods - Logging out completely |
2025-03-29 07:07:07.557302 | severe   | SplashScreenPage     | Missing authentication, server, or endpoint info from the local store |
```

Has anyone else experienced this issue? Any suggestions on further troubleshooting steps? 

joopdo avatar Mar 29 '25 06:03 joopdo

@joopdo does it help with log out and log back in?

alextran1502 avatar Mar 29 '25 12:03 alextran1502

Thanks for your guidance. I logged out and in, I also tried deleting the storage of the app, and logging in. So far no improvement. Adding logs:

logout-login.log after-remove-storage.log

What could this mean: "Null check operator used on a null value "

joopdo avatar Mar 29 '25 13:03 joopdo

@joopdo Can you help me run the below query?

docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a.id, a."fileCreatedAt"  from assets a where a."fileCreatedAt" is null;'

alextran1502 avatar Mar 29 '25 19:03 alextran1502

@joopdo Can you also help me run the metadata extraction job for "missing" and see if it helps? Then you can run the query above

alextran1502 avatar Mar 30 '25 02:03 alextran1502

Thank you for your continued support. I ran metadata extraction for missing first, but it seemed nothing was found (more on that in final log below). I then proceeded with your query above, it seems there are 23 items with an empty fileCreatedAt date and fileModifiedAt date. Also, they all seem to be videos. Some of them are in a folder with an UNIX epoch date, I'm fine to remove those. The others seem to have valid dates.

root@immich:~/immich-app# docker exec immich_postgres psql --dbname=immich --username=postgres -c 'select a.id, a."fileCreatedAt", a."fileModifiedAt", a."origin
alPath"  from assets a where a."fileCreatedAt" is null';
                  id                  | fileCreatedAt | fileModifiedAt |                                   originalPath                                    
--------------------------------------+---------------+----------------+-----------------------------------------------------------------------------------
 6a0599f2-8db6-4f5b-9a47-5e882e810444 |               |                | /home/joop/pictures/videos/2023.mp4
 ff7046b6-8494-4a7e-bcff-f3e9ee8cd29d |               |                | /home/joop/pictures/2008/2008-10-23 Paragliding/2008_paraglyding.mp4
 69017804-15ee-4f12-b5c3-99a66fbaa09c |               |                | /home/joop/pictures/2010/IMGP5697.AVI
 0a0dcc0a-afbc-4eae-86ae-8f66564d2027 |               |                | /home/joop/pictures/2016/camcorder_videos/2016_sonycamcorder_M2U03340.MPG.mp4.mp4
 300f19dc-d0b7-4c6d-988c-719815dcfed0 |               |                | /home/joop/pictures/2016/camcorder_videos/2016_sonycamcorder_M2U03341.MPG.mp4.mp4
 a5400a45-92d7-4902-8483-e8bc11faa138 |               |                | /home/joop/pictures/2018/01/VID_20180526_232422.mp4
 60b92f7e-a1c7-4cf8-a6b2-024a92e4c861 |               |                | /home/joop/pictures/2018/01/VID_20180526_232436.mp4
 b6563c11-5213-4b9e-9c44-039b106a6345 |               |                | /home/joop/pictures/2018/01/VID_20180801_151613.mp4
 fb47504d-837c-4537-be34-ab7a1a3de1e0 |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180427_180810.mp4
 6b804b8d-c217-4d64-973a-388e8e3cf6c5 |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180427_180847.mp4
 885ef403-41a4-443e-b1f4-57122538971b |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180427_180905.mp4
 46625777-d672-4d00-a9f0-7da29e529b59 |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180428_150314.mp4
 10135991-d8ec-4f9d-8cde-b0eb29323218 |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180430_133013.mp4
 2138ec32-d29f-42b5-94cb-7ef705d332ae |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180501_143206.mp4
 7e63d2a9-558e-410b-89a9-9f0a0ce7d63c |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180514_191901.mp4
 5f539761-32a8-4d0c-9a73-058680ef2b99 |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180514_202506.mp4
 79228011-6e88-4253-9187-3ab84e0c5e38 |               |                | /home/joop/pictures/1970/01/1970-01-01/vid_20180514_202520.mp4
 94d6c566-68a0-457a-8222-477d91e0e5b0 |               |                | /home/joop/pictures/2019/01/07/VID_20190107_193523.mp4
 61829b15-8b3c-4547-a639-1dab06d3e379 |               |                | /home/joop/pictures/2024/06/16/A00C268D-2EB8-40CE-AE90-308EAD5C5FF1.mp4
 c07398b3-953a-4847-ac53-3c97473b761d |               |                | /home/joop/pictures/2018/09/24 tower/VID_20180924_164336.mp4
 2c490ee3-044c-4d3b-a9c5-a52a29c0423f |               |                | /home/joop/pictures/2018/12/07/VID_20181207_161726.mp4
 cb384632-2439-48a7-addf-2412fe301250 |               |                | /home/joop/pictures/2021/12/13/PXL_20211213_fiesten/.mp4
 030427d5-724f-4d39-ab4b-441dcc54efdc |               |                | /home/joop/pictures/2020/12/23/VID_20201223_ katje bell/.mp4

When I stat these files (picked two at random below), they do seem to have this data.

root@immich:/mnt/data/pictures# stat "2018/09/24 tower/VID_20180924_164336.mp4"
  File: 2018/09/24 Chengdu tower/VID_20180924_164336.mp4
  Size: 1022920         Blocks: 2000       IO Block: 4096   regular file
Device: 252,27  Inode: 193725181   Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ UNKNOWN)   Gid: ( 1000/ UNKNOWN)
Access: 2025-03-29 07:03:33.896298537 +0100
Modify: 2018-09-24 10:43:35.854981422 +0200
Change: 2025-03-29 06:01:36.494689657 +0100
 Birth: 2023-01-05 19:25:08.231692767 +0100
root@immich:/mnt/data/pictures# stat "2010/IMGP5697.AVI"
  File: 2010/IMGP5697.AVI
  Size: 8704434         Blocks: 17008      IO Block: 4096   regular file
Device: 252,27  Inode: 189137944   Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ UNKNOWN)   Gid: ( 1000/ UNKNOWN)
Access: 2025-03-29 06:12:50.828746102 +0100
Modify: 2010-02-12 08:52:22.000000000 +0100
Change: 2025-03-29 06:01:32.687740147 +0100
 Birth: 2023-01-05 17:17:17.306878365 +0100
root@immich:/mnt/data/pictures# stat "2018/12/07/VID_20181207_161726.mp4"
  File: 2018/12/07/VID_20181207_161726.mp4
  Size: 485290          Blocks: 952        IO Block: 4096   regular file
Device: 252,27  Inode: 193856617   Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ UNKNOWN)   Gid: ( 1000/ UNKNOWN)
Access: 2025-03-29 07:07:42.758942843 +0100
Modify: 2018-12-07 16:17:25.322544315 +0100
Change: 2025-03-29 06:01:36.676687243 +0100
 Birth: 2023-01-05 19:46:40.211951872 +0100

When I log immich, I see an error, a quick skim showed familiar filenames from above, so I suspect it's for each of these files:

immich_server            | ffprobe version 7.0.2-Jellyfin Copyright (c) 2007-2024 the FFmpeg developers
immich_server            |   built with gcc 12 (Debian 12.2.0-14)
immich_server            |   configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich_server            |   libavutil      59.  8.100 / 59.  8.100
immich_server            |   libavcodec     61.  3.100 / 61.  3.100
immich_server            |   libavformat    61.  1.100 / 61.  1.100
immich_server            |   libavdevice    61.  1.100 / 61.  1.100
immich_server            |   libavfilter    10.  1.100 / 10.  1.100
immich_server            |   libswscale      8.  1.100 /  8.  1.100
immich_server            |   libswresample   5.  1.100 /  5.  1.100
immich_server            |   libpostproc    58.  1.100 / 58.  1.100
immich_server            | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x53daa060180] moov atom not found
immich_server            | /home/joop/pictures/2018/09/24 tower/VID_20180924_164336.mp4: Invalid data found when processing input
immich_server            | 
immich_server            | Error: ffprobe exited with code 1
immich_server            | ffprobe version 7.0.2-Jellyfin Copyright (c) 2007-2024 the FFmpeg developers
immich_server            |   built with gcc 12 (Debian 12.2.0-14)
immich_server            |   configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich_server            |   libavutil      59.  8.100 / 59.  8.100
immich_server            |   libavcodec     61.  3.100 / 61.  3.100
immich_server            |   libavformat    61.  1.100 / 61.  1.100
immich_server            |   libavdevice    61.  1.100 / 61.  1.100
immich_server            |   libavfilter    10.  1.100 / 10.  1.100
immich_server            |   libswscale      8.  1.100 /  8.  1.100
immich_server            |   libswresample   5.  1.100 /  5.  1.100
immich_server            |   libpostproc    58.  1.100 / 58.  1.100
immich_server            | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x53daa060180] moov atom not found
immich_server            | /home/joop/pictures/2018/09/24 tower/VID_20180924_164336.mp4: Invalid data found when processing input
immich_server            | 
immich_server            |     at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22)
immich_server            |     at ChildProcess.emit (node:events:518:28)
immich_server            |     at ChildProcess._handle.onexit (node:internal/child_process:293:12)

joopdo avatar Mar 30 '25 06:03 joopdo

I made a backup of all the files to a third directory, only one video played. They seemed corrupt. Then I tried rebuilding by refreshing metadata and external library, however, the records percieved.

I then decided to backup and delete:

docker exec immich_postgres psql --dbname=immich --username=postgres -c 'DELETE FROM assets WHERE "fileCreatedAt" IS NULL;'

After logging out and in, the timeline became available in the Android app! Problem solved. Thanks again!

joopdo avatar Mar 30 '25 12:03 joopdo

@mertalev @etnoy the issue with nullable records I mentioned is encountered by joopdo as seen above

alextran1502 avatar Mar 30 '25 13:03 alextran1502

Speculation. There are assets for which metadata extraction fails, this can happen especially with broken videos.

With the recent nullable date field changes, metadata extraction is responsible for setting dates to not null.

When this fails, dates are still null.

The first solution is to trace with db calls fail here and add a non null where clause in the repository. The second one is to think about what we do with broken assets

etnoy avatar Mar 30 '25 14:03 etnoy

Is it not possible for the mobile sync to happen after an asset is imported but before metadata extraction has run? The app/sync should handle that case more gracefully.

mertalev avatar Mar 30 '25 14:03 mertalev