Pictures recently added to external library cannot be dowloaded form the app #2622

Closed
opened 2026-02-05 06:21:52 +03:00 by OVERLORD · 20 comments
Owner

Originally created by @panoskpv on GitHub (Mar 19, 2024).

The bug

when I try to download a recently added picture in external library it fails. This is not the case for previously added picutres. After some investigation I realised that the ones I recently added are included in the server without file extension in their name while the ones that can be downloaded have it.
Screenshot from 2024-03-19 00-35-40

Screenshot from 2024-03-19 00-38-33

However, when i click to i symbol path looks ok and filename is presented with extension.

The OS that Immich Server is running on

Ubuntu 22.04 using docker

Version of Immich Server

1.98.2

Version of Immich Mobile App

1.98.2

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

not relevant

Your .env content

not relevant

Reproduction steps

as above

Additional information

No response

Originally created by @panoskpv on GitHub (Mar 19, 2024). ### The bug when I try to download a recently added picture in external library it fails. This is not the case for previously added picutres. After some investigation I realised that the ones I recently added are included in the server without file extension in their name while the ones that can be downloaded have it. ![Screenshot from 2024-03-19 00-35-40](https://github.com/immich-app/immich/assets/84382461/6f6bfe4b-8d09-4d47-b3e8-50a2e31c97eb) ![Screenshot from 2024-03-19 00-38-33](https://github.com/immich-app/immich/assets/84382461/3ab2fd1b-9b69-44f8-99e8-d6596a60903e) However, when i click to i symbol path looks ok and filename is presented with extension. ### The OS that Immich Server is running on Ubuntu 22.04 using docker ### Version of Immich Server 1.98.2 ### Version of Immich Mobile App 1.98.2 ### Platform with the issue - [X] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML not relevant ``` ### Your .env content ```Shell not relevant ``` ### Reproduction steps ```bash as above ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Mar 19, 2024):

Can you share the photos that cannot be downloaded, so that we can troubleshoot?

@alextran1502 commented on GitHub (Mar 19, 2024): Can you share the photos that cannot be downloaded, so that we can troubleshoot?
Author
Owner

@panoskpv commented on GitHub (Mar 19, 2024):

I do not think it is related to the photos because this happened with photos taken from two different phones at the same period. Older photos taken with same phones and previously uploaded have no issues.

@panoskpv commented on GitHub (Mar 19, 2024): I do not think it is related to the photos because this happened with photos taken from two different phones at the same period. Older photos taken with same phones and previously uploaded have no issues.
Author
Owner

@alextran1502 commented on GitHub (Mar 19, 2024):

Hello, just to aid in troubleshooting, having the trouble asset will help us a lot better

@alextran1502 commented on GitHub (Mar 19, 2024): Hello, just to aid in troubleshooting, having the trouble asset will help us a lot better
Author
Owner

@panoskpv commented on GitHub (Mar 19, 2024):

IMG_20240317_104543
This is an example of photo with this issue. Also when i try to share these photos through the app the file name in the app selection pop up does notinclude extension.

@panoskpv commented on GitHub (Mar 19, 2024): ![IMG_20240317_104543](https://github.com/immich-app/immich/assets/84382461/ac62e193-100f-4acd-859b-4d30f7b7c368) This is an example of photo with this issue. Also when i try to share these photos through the app the file name in the app selection pop up does notinclude extension.
Author
Owner

@alextran1502 commented on GitHub (Mar 19, 2024):

Can you help zip the file up? When I tried to open the image, GitHub doesn't let me

@alextran1502 commented on GitHub (Mar 19, 2024): Can you help zip the file up? When I tried to open the image, GitHub doesn't let me
Author
Owner

@tiltshiftfocus commented on GitHub (Mar 19, 2024):

I would like to add that I am having this issue as well on both iOS and Android.
On iOS, sharing a photo results in no extension while on Android, I get a .deploy extension.

An analysis from mine on the database shows that in the assets table, data in originalFileName column are missing the extensions and this seems to happen from version 1.98 onwards.

@tiltshiftfocus commented on GitHub (Mar 19, 2024): I would like to add that I am having this issue as well on both iOS and Android. On iOS, sharing a photo results in no extension while on Android, I get a `.deploy` extension. An analysis from mine on the database shows that in the `assets` table, data in `originalFileName` column are missing the extensions and this seems to happen from version 1.98 onwards.
Author
Owner

@alextran1502 commented on GitHub (Mar 19, 2024):

@tiltshiftfocus Thank you for the data point. So the file itself doesn't have an extension, and they are in the immich's database?

@alextran1502 commented on GitHub (Mar 19, 2024): @tiltshiftfocus Thank you for the data point. So the file itself doesn't have an extension, and they are in the immich's database?
Author
Owner

@tiltshiftfocus commented on GitHub (Mar 19, 2024):

@alextran1502 The file itself has extension as updated from external library. They include JPG, HEIC, MOV, etc as seen below under originalPath:
image

But the extensions are missing in the originalFileName column:
image

I have checked on older entries before 9 March, and the extensions are there:
image

This issue should have some relation to #7781 .

@tiltshiftfocus commented on GitHub (Mar 19, 2024): @alextran1502 The file itself has extension as updated from external library. They include JPG, HEIC, MOV, etc as seen below under `originalPath`: <img width="527" alt="image" src="https://github.com/immich-app/immich/assets/3158046/bd419622-4c15-4c85-853a-7c2e2cb9b290"> But the extensions are missing in the `originalFileName` column: <img width="311" alt="image" src="https://github.com/immich-app/immich/assets/3158046/0a3bab79-b7bd-4e36-b3d6-1cbeb3db314c"> I have checked on older entries before 9 March, and the extensions are there: <img width="615" alt="image" src="https://github.com/immich-app/immich/assets/3158046/aa6bc9f4-0032-4b2c-b84e-388c92d6250c"> This issue should have some relation to #7781 .
Author
Owner

@alextran1502 commented on GitHub (Mar 19, 2024):

Hmm, so only files from the external library won't have the extension. Let me check

@alextran1502 commented on GitHub (Mar 19, 2024): Hmm, so only files from the external library won't have the extension. Let me check
Author
Owner

@alytidae commented on GitHub (Mar 20, 2024):

Hi! I just started using immich today as an application to view my photos. I followed this guide (https://immich.app/docs/features/libraries /) to connect external libraries. But I have the same problem as you. If I upload a photo via the immich web version, then everything works fine for me and the photo is displayed correctly, but if I connect an external library, I can see the files, but they are all gray (there is no image on them). I can see the information about the file and all files from the external library do not have an extension. I think that's why immich can't display them.

@alytidae commented on GitHub (Mar 20, 2024): Hi! I just started using immich today as an application to view my photos. I followed this guide (https://immich.app/docs/features/libraries /) to connect external libraries. But I have the same problem as you. If I upload a photo via the immich web version, then everything works fine for me and the photo is displayed correctly, but if I connect an external library, I can see the files, but they are all gray (there is no image on them). I can see the information about the file and all files from the external library do not have an extension. I think that's why immich can't display them.
Author
Owner

@etnoy commented on GitHub (Mar 20, 2024):

I have pushed a fix. Those who are affected, please run a refresh all files job after the fix is merged

@etnoy commented on GitHub (Mar 20, 2024): I have pushed a fix. Those who are affected, please run a refresh all files job after the fix is merged
Author
Owner

@tiltshiftfocus commented on GitHub (Mar 21, 2024):

I have pushed a fix. Those who are affected, please run a refresh all files job after the fix is merged

I just tried in the newest version with this fix. Performing refresh all files didn't fix the extensions. Did I miss anything?

@tiltshiftfocus commented on GitHub (Mar 21, 2024): > I have pushed a fix. Those who are affected, please run a refresh all files job after the fix is merged I just tried in the newest version with this fix. Performing refresh all files didn't fix the extensions. Did I miss anything?
Author
Owner

@tiltshiftfocus commented on GitHub (Mar 21, 2024):

For those experienced with database queries, if you are still encountering issues with the latest update even after refreshing the files, you can use this query to update the assets table with the required file extension:

UPDATE assets SET "originalFileName" = CONCAT("originalFileName",SUBSTRING("originalPath" FROM '\..*')) WHERE "originalFileName" NOT LIKE '%.%';

Please make a backup to assets table before doing the above query.
After the query, pull to refresh twice on the mobile app for the timeline to rebuild to see the changes.

@tiltshiftfocus commented on GitHub (Mar 21, 2024): For those experienced with database queries, if you are still encountering issues with the latest update even after refreshing the files, you can use this query to update the `assets` table with the required file extension: `UPDATE assets SET "originalFileName" = CONCAT("originalFileName",SUBSTRING("originalPath" FROM '\..*')) WHERE "originalFileName" NOT LIKE '%.%';` Please make a backup to `assets` table before doing the above query. After the query, pull to refresh twice on the mobile app for the timeline to rebuild to see the changes.
Author
Owner

@panoskpv commented on GitHub (Mar 21, 2024):

I still have the same problem after refreshing. I run all stack using docker. When i connect to the database and run above command i get "relation assets does not exist". Any ideas?

@panoskpv commented on GitHub (Mar 21, 2024): I still have the same problem after refreshing. I run all stack using docker. When i connect to the database and run above command i get "relation assets does not exist". Any ideas?
Author
Owner

@etnoy commented on GitHub (Mar 21, 2024):

My bad, even a force refresh does not re-read the filename, only timestamps.

@etnoy commented on GitHub (Mar 21, 2024): My bad, even a force refresh does not re-read the filename, only timestamps.
Author
Owner

@panoskpv commented on GitHub (Mar 21, 2024):

I still have the same problem after refreshing. I run all stack using docker. When i connect to the database and run above command i get "relation assets does not exist". Any ideas?

After connecting to the database it worked. I am noob in databases. Thank you for the solution.

@panoskpv commented on GitHub (Mar 21, 2024): > I still have the same problem after refreshing. I run all stack using docker. When i connect to the database and run above command i get "relation assets does not exist". Any ideas? After connecting to the database it worked. I am noob in databases. Thank you for the solution.
Author
Owner

@tiltshiftfocus commented on GitHub (Mar 21, 2024):

My bad, even a force refresh does not re-read the filename, only timestamps.

In the very least, future assets are now updated correctly 👍🏻.

@tiltshiftfocus commented on GitHub (Mar 21, 2024): > My bad, even a force refresh does not re-read the filename, only timestamps. In the very least, future assets are now updated correctly 👍🏻.
Author
Owner

@susovit commented on GitHub (Mar 25, 2024):

I did Install the latest version and did force refresh all external library. However the new photos are still showing up without extension and also cannot download via mobile app. We can see the downloaded file from the web app is ok. But mobile app still fails to download. Also info shows no file extension.
Screenshot_20240325-084818
Download From web is ok.

Screenshot_20240325-084709
Download error occurs from app.

Screenshot_20240325-084728
File info (no extension)

Screenshot_20240325-084717
File name while sharing from app.

@susovit commented on GitHub (Mar 25, 2024): I did Install the latest version and did force refresh all external library. However the new photos are still showing up without extension and also cannot download via mobile app. We can see the downloaded file from the web app is ok. But mobile app still fails to download. Also info shows no file extension. ![Screenshot_20240325-084818](https://github.com/immich-app/immich/assets/9989380/917d32bc-035d-4d4a-b4fc-559cfb66a59a) Download From web is ok. ![Screenshot_20240325-084709](https://github.com/immich-app/immich/assets/9989380/f9e8488a-eff7-4492-a5f8-feb5e3316214) Download error occurs from app. ![Screenshot_20240325-084728](https://github.com/immich-app/immich/assets/9989380/378f9eb6-5828-4b00-8169-4cfc53d5ac9c) File info (no extension) ![Screenshot_20240325-084717](https://github.com/immich-app/immich/assets/9989380/5d7bd794-b3d9-4b53-8574-d95d92c476e3) File name while sharing from app.
Author
Owner

@etnoy commented on GitHub (Mar 26, 2024):

Yes, it appears that the file extension is not reloaded even on force refresh. Sorry! I'll reopen it until we've fixed it.

@etnoy commented on GitHub (Mar 26, 2024): Yes, it appears that the file extension is not reloaded even on force refresh. Sorry! I'll reopen it until we've fixed it.
Author
Owner

@etnoy commented on GitHub (Apr 5, 2024):

This is now solved in the latest version. Rescan the library and the file name will be automatically be corrected.

Please verify that this works for you, I'll close this bug in the meantime

@etnoy commented on GitHub (Apr 5, 2024): This is now solved in the latest version. Rescan the library and the file name will be automatically be corrected. Please verify that this works for you, I'll close this bug in the meantime
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2622