[BUG] Cannot open file, path #1121

Closed
opened 2026-02-05 00:32:00 +03:00 by OVERLORD · 15 comments
Owner

Originally created by @Pro100x3mal on GitHub (Jul 17, 2023).

The bug

Permanent bug in iOS app. Occurs very often. The Immich server is running with an nginx reverse proxy (without using the immich-proxy container). Upload directory mounted as nfs share

Message
PathNotFoundException: Cannot open file, path = '/private/var/mobile/Containers/Data/Application/EEC3F688-3507-41A4-AEBE-7BA9099CA519/tmp/.image/1636156303.686423_o_FullSizeRender.jpg' (OS Error: No such file or directory, errno = 2)

From
ImmichErrorLogger

Stack traces
#0 _checkForErrorResponse (dart:io/common.dart:55)
#1 _File.open. (dart:io/file_impl.dart:381)

#2 _FileStream._start.onOpenFile (dart:io/file_impl.dart:153)

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.67.2

Version of Immich Mobile App

v1.67.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Standart

Your .env content

Standart

Reproduction steps

1.Open mobile app
2.Open error log
3.
...

Additional information

No response

Originally created by @Pro100x3mal on GitHub (Jul 17, 2023). ### The bug Permanent bug in iOS app. Occurs very often. The Immich server is running with an nginx reverse proxy (without using the immich-proxy container). Upload directory mounted as nfs share Message PathNotFoundException: Cannot open file, path = '/private/var/mobile/Containers/Data/Application/EEC3F688-3507-41A4-AEBE-7BA9099CA519/tmp/.image/1636156303.686423_o_FullSizeRender.jpg' (OS Error: No such file or directory, errno = 2) From ImmichErrorLogger Stack traces #0 _checkForErrorResponse (dart:io/common.dart:55) #1 _File.open.<anonymous closure> (dart:io/file_impl.dart:381) <asynchronous suspension> #2 _FileStream._start.onOpenFile (dart:io/file_impl.dart:153) <asynchronous suspension> ### The OS that Immich Server is running on Debian ### Version of Immich Server v1.67.2 ### Version of Immich Mobile App v1.67.0 ### Platform with the issue - [X] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML Standart ``` ### Your .env content ```Shell Standart ``` ### Reproduction steps ```bash 1.Open mobile app 2.Open error log 3. ... ``` ### Additional information _No response_
OVERLORD added the 📱mobile label 2026-02-05 00:32:00 +03:00
Author
Owner

@alextran1502 commented on GitHub (Jul 17, 2023):

You are using Shared Album feature on iOS, correct?

@alextran1502 commented on GitHub (Jul 17, 2023): You are using Shared Album feature on iOS, correct?
Author
Owner

@Pro100x3mal commented on GitHub (Jul 17, 2023):

Yes. I have one Shared Album on ios. But the fact is that when I run immich without my nginx config and use the built-in immich-proxy container (on the local network with the setting - port: 10.66.66.1:2283:8080) - then there are no errors in the log.

My Nginx conf:

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

map $http_x_forwarded_proto $forwarded_protocol {
default $scheme;
http http;
https https;
}

upstream server {
server localhost:3001;
keepalive 2;
}

upstream web {
server localhost:3000;
keepalive 2;
}

server {

listen 80;

server_name immich.mydomain.ml www.immich.mydomain.ml;
return 404; # managed by Certbot

if ($host = www.immich.mydomain.ml) {
return 301 https://$host$request_uri;
} # managed by Certbot

if ($host = immich.mydomain.ml) {
return 301 https://$host$request_uri;
} # managed by Certbot

}

server {

listen 443 ssl http2;
server_name immich.mydomain.ml www.immich.mydomain.ml;

ssl_certificate /etc/letsencrypt/live/immich.mydomain.ml/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/immich.mydomain.ml/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

access_log /var/log/nginx/immich.mydomain.ml-access.log;
error_log /var/log/nginx/immich.mydomain.ml-error.log;
client_max_body_size 0;

proxy_buffering off;
proxy_request_buffering off;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
proxy_force_ranges on;

proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $forwarded_protocol;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;

location /api {
rewrite /api/(.*) /$1 break;
proxy_pass http://server;
proxy_ssl_server_name on;
}

location / {
proxy_ssl_server_name on;
proxy_pass http://web;
}

}

@Pro100x3mal commented on GitHub (Jul 17, 2023): Yes. I have one Shared Album on ios. But the fact is that when I run immich without my nginx config and use the built-in immich-proxy container (on the local network with the setting - port: 10.66.66.1:2283:8080) - then there are no errors in the log. My Nginx conf: map $http_upgrade $connection_upgrade { default upgrade; '' close; } map $http_x_forwarded_proto $forwarded_protocol { default $scheme; http http; https https; } upstream server { server localhost:3001; keepalive 2; } upstream web { server localhost:3000; keepalive 2; } server { listen 80; server_name immich.mydomain.ml www.immich.mydomain.ml; return 404; # managed by Certbot if ($host = www.immich.mydomain.ml) { return 301 https://$host$request_uri; } # managed by Certbot if ($host = immich.mydomain.ml) { return 301 https://$host$request_uri; } # managed by Certbot } server { listen 443 ssl http2; server_name immich.mydomain.ml www.immich.mydomain.ml; ssl_certificate /etc/letsencrypt/live/immich.mydomain.ml/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/immich.mydomain.ml/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot access_log /var/log/nginx/immich.mydomain.ml-access.log; error_log /var/log/nginx/immich.mydomain.ml-error.log; client_max_body_size 0; proxy_buffering off; proxy_request_buffering off; proxy_buffer_size 16k; proxy_busy_buffers_size 24k; proxy_buffers 64 4k; proxy_force_ranges on; proxy_http_version 1.1; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $forwarded_protocol; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; location /api { rewrite /api/(.*) /$1 break; proxy_pass http://server; proxy_ssl_server_name on; } location / { proxy_ssl_server_name on; proxy_pass http://web; } }
Author
Owner

@alextran1502 commented on GitHub (Jul 17, 2023):

The reported issue you are seeing is related to Shared Album, which we are not fully supported (yet).

Nginx should not interfere at all with the log message you are seeing on the mobile app

@alextran1502 commented on GitHub (Jul 17, 2023): The reported issue you are seeing is related to Shared Album, which we are not fully supported (yet). Nginx should not interfere at all with the log message you are seeing on the mobile app
Author
Owner

@Pro100x3mal commented on GitHub (Jul 17, 2023):

Understood thanks. I hope you will support shared album on ios soon

@Pro100x3mal commented on GitHub (Jul 17, 2023): Understood thanks. I hope you will support shared album on ios soon
Author
Owner

@Pro100x3mal commented on GitHub (Jul 17, 2023):

I disabled shared albums on ios. I completely uninstalled and reconfigured immich. Ran it on the docker network (192.168.0.182:2283:8080 in docker compose). And still the error sometimes appears (

@Pro100x3mal commented on GitHub (Jul 17, 2023): I disabled shared albums on ios. I completely uninstalled and reconfigured immich. Ran it on the docker network (192.168.0.182:2283:8080 in docker compose). And still the error sometimes appears (
Author
Owner

@kloknibor commented on GitHub (Oct 27, 2023):

I have the same error, my immich is running behind a reverse apache proxy. Immich will not continue to upload pictures and only killing it manually and restarting helps.

@kloknibor commented on GitHub (Oct 27, 2023): I have the same error, my immich is running behind a reverse apache proxy. Immich will not continue to upload pictures and only killing it manually and restarting helps.
Author
Owner

@ViktorBarzin commented on GitHub (Nov 16, 2023):

+1 affected here. Similar setup - behind nginx proxy. No photos being uploaded at all. I am just using the bare minimum, no shared albums as such. v1.79

Edit: Version is 1.86

@ViktorBarzin commented on GitHub (Nov 16, 2023): +1 affected here. Similar setup - behind nginx proxy. No photos being uploaded at all. I am just using the bare minimum, no shared albums as such. v1.79 Edit: Version is 1.86
Author
Owner

@alextran1502 commented on GitHub (Nov 16, 2023):

@ViktorBarzin Can you update to 1.86?

@alextran1502 commented on GitHub (Nov 16, 2023): @ViktorBarzin Can you update to 1.86?
Author
Owner

@ViktorBarzin commented on GitHub (Nov 16, 2023):

My bad, already on 1.86

@ViktorBarzin commented on GitHub (Nov 16, 2023): My bad, already on 1.86
Author
Owner

@alextran1502 commented on GitHub (Nov 16, 2023):

@ViktorBarzin can you check mobile app logs as well as the server log?

@alextran1502 commented on GitHub (Nov 16, 2023): @ViktorBarzin can you check mobile app logs as well as the server log?
Author
Owner

@ViktorBarzin commented on GitHub (Nov 16, 2023):

Nothing suspicious - client logs suggest syncying succeeds with changes: False. However not all images are uploaded. I see some of the images in the immich gallery in the client with the icon saying they are not uploaded. Manually clicking on the upload button doesn't make any difference - nothing shows up neither on client nor server logs (I can see the websocket connections when backup begins).

It's a vanilla installation in k8s behind an nginx ingress. I tried syncing a smaller album before going on the main gallery. I don't know if that makes any difference.

@ViktorBarzin commented on GitHub (Nov 16, 2023): Nothing suspicious - client logs suggest syncying succeeds with `changes: False`. However not all images are uploaded. I see some of the images in the immich gallery in the client with the icon saying they are not uploaded. Manually clicking on the upload button doesn't make any difference - nothing shows up neither on client nor server logs (I can see the websocket connections when backup begins). It's a vanilla installation in k8s behind an nginx ingress. I tried syncing a smaller album before going on the main gallery. I don't know if that makes any difference.
Author
Owner

@alextran1502 commented on GitHub (Nov 16, 2023):

@ViktorBarzin Try access the instance over local IP to remove the proxy variable

@alextran1502 commented on GitHub (Nov 16, 2023): @ViktorBarzin Try access the instance over local IP to remove the proxy variable
Author
Owner

@ViktorBarzin commented on GitHub (Nov 16, 2023):

Yep the proxy was the issue, great catch :) The nginx ingress had the logs:
2023/11/16 15:23:08 [error] 1396#1396: *4700611 client intended to send too large chunked body: 1033951+65536 bytes,
Disabling the proxy was not an option as it's running as a k8s service so the ingress proxies all inbound traffic. Adding the following annotation to the ingress solved the issue:

"nginx.ingress.kubernetes.io/proxy-body-size" : "5000m"

Edit: Perhaps worth handling this in the client in a better way - it was sending the metadata but the actual image/video transfer was failing but this was not accounted for. Perhaps add a post-send check to confirm the existence of the file?

@ViktorBarzin commented on GitHub (Nov 16, 2023): Yep the proxy was the issue, great catch :) The nginx ingress had the logs: `2023/11/16 15:23:08 [error] 1396#1396: *4700611 client intended to send too large chunked body: 1033951+65536 bytes,` Disabling the proxy was not an option as it's running as a k8s service so the ingress proxies all inbound traffic. Adding the following annotation to the ingress solved the issue: `"nginx.ingress.kubernetes.io/proxy-body-size" : "5000m"` Edit: Perhaps worth handling this in the client in a better way - it was sending the metadata but the actual image/video transfer was failing but this was not accounted for. Perhaps add a post-send check to confirm the existence of the file?
Author
Owner

@noppe91 commented on GitHub (Jan 11, 2024):

I have the same error, my immich is running behind a reverse apache proxy. Immich will not continue to upload pictures and only killing it manually and restarting helps.

@kloknibor i tried to set it up behind a reverse proxy, and failed. could you share your config plz?

@noppe91 commented on GitHub (Jan 11, 2024): > I have the same error, my immich is running behind a reverse apache proxy. Immich will not continue to upload pictures and only killing it manually and restarting helps. @kloknibor i tried to set it up behind a reverse proxy, and failed. could you share your config plz?
Author
Owner

@pattisonmichael commented on GitHub (Jan 23, 2024):

I had the same issue and solved it by adding client_max_body_size 5000M; in the http section of nginx.conf.
This was on android app but the client seems to have issues with chunked transfer in general.

@pattisonmichael commented on GitHub (Jan 23, 2024): I had the same issue and solved it by adding `client_max_body_size 5000M;` in the http section of nginx.conf. This was on android app but the client seems to have issues with chunked transfer in general.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1121