Skip to content
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

[BUG] Cannot open file, path #3313

Closed
2 of 3 tasks
Pro100x3mal opened this issue Jul 17, 2023 · 15 comments
Closed
2 of 3 tasks

[BUG] Cannot open file, path #3313

Pro100x3mal opened this issue Jul 17, 2023 · 15 comments

Comments

@Pro100x3mal
Copy link

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

@alextran1502
Copy link
Contributor

You are using Shared Album feature on iOS, correct?

@Pro100x3mal
Copy link
Author

Pro100x3mal commented 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;
}

}

@alextran1502
Copy link
Contributor

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

@Pro100x3mal
Copy link
Author

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

@Pro100x3mal
Copy link
Author

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 (

@kloknibor
Copy link

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.

@ViktorBarzin
Copy link

ViktorBarzin commented 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

@alextran1502
Copy link
Contributor

@ViktorBarzin Can you update to 1.86?

@ViktorBarzin
Copy link

My bad, already on 1.86

@alextran1502
Copy link
Contributor

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

@ViktorBarzin
Copy link

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.

@alextran1502
Copy link
Contributor

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

@ViktorBarzin
Copy link

ViktorBarzin commented 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?

@noppe91
Copy link

noppe91 commented Jan 10, 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?

@pattisonmichael
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants