-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"fileCreatedAt" overwritten after library reimport #15640
Comments
@C-Otto Here is my output for the last demo-image from #14424 docker exec -it immich_postgres psql -U postgres immich -c "select \"fileCreatedAt\",\"fileModifiedAt\",\"localDateTime\", \"createdAt\",\"updatedAt\",\"dateTimeOriginal\",asset_job_status.\"metadataExtractedAt\" from assets left join exif on (assets.id = exif.\"assetId\") left join asset_job_status on (assets.id = asset_job_status.\"assetId\") where assets.id = '7d740296-aa9c-4995-bc73-d2a2364233bd'"
fileCreatedAt | fileModifiedAt | localDateTime | createdAt | updatedAt | dateTimeOriginal | metadataExtractedAt
----------------------------+----------------------------+----------------------------+-------------------------------+-------------------------------+----------------------------+----------------------------
2023-07-25 20:09:57.333+00 | 2023-07-25 20:09:57.333+00 | 2020-12-27 13:04:13.081+00 | 2024-07-20 14:43:58.885894+00 | 2025-01-01 19:52:45.430179+00 | 2020-12-27 12:04:13.081+00 | 2024-12-26 17:12:22.554+00
(1 row)
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Based on that I see:
|
The |
@C-Otto from what I remember, I ran a manual metadata extraction job for all assets from the job page. I updated on v 1.123.0 and hoped, this update might have fixed my issue. After manually updating metadata, the SQL query returns the following: docker exec -it immich_postgres psql -U postgres immich -c "select \"fileCreatedAt\",\"fileModifiedAt\",\"localDateTime\", \"createdAt\",\"updatedAt\",\"dateTimeOriginal\",asset_job_status.\"metadataExtractedAt\" from assets left join exif on (assets.id = exif.\"assetId\") left join asset_job_status on (assets.id = asset_job_status.\"assetId\") where assets.id = '7d740296-aa9c-4995-bc73-d2a2364233bd'"
fileCreatedAt | fileModifiedAt | localDateTime | createdAt | updatedAt | dateTimeOriginal | metadataExtractedAt
----------------------------+----------------------------+----------------------------+-------------------------------+-------------------------------+----------------------------+----------------------------
2020-12-27 12:04:13.081+00 | 2023-07-25 20:09:57.333+00 | 2020-12-27 13:04:13.081+00 | 2024-07-20 14:43:58.885894+00 | 2025-01-25 12:16:18.871912+00 | 2020-12-27 12:04:13.081+00 | 2025-01-25 12:16:18.861+00
(1 row) And also the album view looks as it should like (compared to the screenshot in #14424 ): |
So the metadata extraction job had an issue in v1.123.0, but it is fixed now (if you run metadata extraction again)? |
@maxbraun91 is this stored on an external library? Did you provide the "true" date manually (using a XMP sidecar file)? |
@C-Otto Not sure if there was an issue in v1.123.0 - i hoped that v1.123.0 fixed my issue from #14424 (which was reported on v1.121.0 but persisted already for a longer time). Yes - stored on external library. No, I do not use sidecar files. I just load the images into immich via external library as they are. Do you think another "full" metadata extraction run should fix the issue for the other assets as well? I could trigger the job, if that's helpful. |
Yes, please run a full metadata extraction job. I don't understand why the job in v1.123.0 didn't work, though. |
@maxbraun91 do you know if the issue was fixed after you ran the job on 2024-12-26 and before you did something on 2025-01-01? If so, the 2025-01-01 change might be very relevant. |
No, sorry... On 2025-01-01 I moved the file to a new NAS but this should not have made any difference as I copied with rsync in archive mode. |
@C-Otto regading what you asked me in #15189
|
The 2016 date is the date the image was taken. The fileCreatedAt value is incorrect, it should also be the 2016 date. It seems the metadata extraction job you ran on 2024-09-27 did not update the value. Do you know if it was OK between 2024-09-27 and 2024-11-26? Do you know what kind of change you did on 2024-11-26? |
I saw that I performed an update on November 20th. After that, I know I lost my photos (automatic trash of external lib of immich) at some point due to my failed NFS mount after a power outage. I restarted an indexing, but I can't tell if it was on the 26th. |
OK, so both @maxbraun91 and @davidXire did some library magic (reimport?) after the last metadata extraction run. That's interesting. |
I was able to reproduce this. If a file is marked as offline and then online again (after an outage of the external library), the |
@C-Otto I confirmed it was fix! |
When marking an offline asset as online again, do not reset the fileCreatedAt value. This value contains the "true" date, copied from exif.dateTimeOriginal. If we overwrite this value, we'd need to run the metadata extraction job again. Instead, we just leave the old (and correct) value in place. fixes #15640
When marking an offline asset as online again, do not reset the fileCreatedAt value. This value contains the "true" date, copied from exif.dateTimeOriginal. If we overwrite this value, we'd need to run the metadata extraction job again. Instead, we just leave the old (and correct) value in place. fixes #15640
When marking an offline asset as online again, do not reset the fileCreatedAt value. This value contains the "true" date, copied from exif.dateTimeOriginal. If we overwrite this value, we'd need to run the metadata extraction job again. Instead, we just leave the old (and correct) value in place. fixes #15640
When marking an offline asset as online again, do not reset the fileCreatedAt value. This value contains the "true" date, copied from exif.dateTimeOriginal. If we overwrite this value, we'd need to run the metadata extraction job again. Instead, we just leave the old (and correct) value in place. fixes #15640
When marking an offline asset as online again, do not reset the fileCreatedAt value. This value contains the "true" date, copied from exif.dateTimeOriginal. If we overwrite this value, we'd need to run the metadata extraction job again. Instead, we just leave the old (and correct) value in place. fixes #15640
When marking an offline asset as online again, do not reset the fileCreatedAt value. This value contains the "true" date, copied from exif.dateTimeOriginal. If we overwrite this value, we'd need to run the metadata extraction job again. Instead, we just leave the old (and correct) value in place. fixes #15640
EDIT: This is now understood and fixed, see #15650
Immich uses the
fileCreatedAt
asset property in various places and assumes this date represents the time the asset has been taken. This is similar to thelocalDateTime
property, which is used in other places.The
fileCreatedAt
property should be updated as part of the metadata extraction process and should be set toexif.dateTimeOriginal
(which serves the same purpose and which is shown in the asset detail pane). It seems thatfileCreatedAt
is not correctly updated in some situations, especially when the file has been modified and is stored in an external library.This issue is used to track the root cause of several issues that result out of that, which could manifest themselves in various ways.
How can you help?
If possible, try to run the following SQL query for an image that doesn't show up in the right place (or which contributes to some kind of bug in any other way). Replace
XXX
by the asset ID (this is shown in the URL if you view the asset full screen). Take care not to delete the trailing'
, the query ends with'"
.Related issues:
takenBefore
andtakenAfter
via the searchRandom api endpoint returns results out of that date range. #15358The text was updated successfully, but these errors were encountered: