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] Background upload doesn't work even with Automatic Foreground Backup and Automatic background backup service enabled. #5994

Open
1 of 3 tasks
gumpdy opened this issue Dec 26, 2023 · 24 comments

Comments

@gumpdy
Copy link

gumpdy commented Dec 26, 2023

The bug

Background upload doesn't work even with Automatic Foreground Backup and Automatic background backup service enabled. Android app battery management is set to Unrestricted.

The OS that Immich Server is running on

Android

Version of Immich Server

1.91.4

Version of Immich Mobile App

1.91.4 build.116

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

I don't know how to see that using the unRAID GUI, but the problem seems exclusive to the Android app functionality anyway

Your .env content

I don't know how to see that using the unRAID GUI, but the problem seems exclusive to the Android app functionality anyway

Reproduction steps

1.Open app, click on backup icon, see it begin uploading the video file. wait for a few percent to progress
2. take app away from foreground OR close it entirely
3. open app again, click on backup icon, see it start all over again.

Additional information

I also occasionaly see the percentage counter flicker between higher and lower percentage values, almost like it's showing the percentage values for duplicate asynchronous upload streams

@gumpdy gumpdy added the bug label Dec 26, 2023
@gdamx
Copy link

gdamx commented Dec 27, 2023

Same issue for me however it forgets the albums that are selected and it disables the foreground and background backup

@gumpdy
Copy link
Author

gumpdy commented Dec 27, 2023

Same issue for me however it forgets the albums that are selected and it disables the foreground and background backup

Make sure your app-specific battery optimization is aet to unrestricted on stock android. If you have a manufacturer's bloatware, refer to this guide: https://dontkillmyapp.com/

I have the same issue with the selected backup directories being forgotten but I think if you refresh or wait a minute, it'll come up

@gdamx
Copy link

gdamx commented Dec 27, 2023

I've done already still same issue. Photos seem to backup but videos don't . And by the time I check the app it forgets the backup location

@gdamx
Copy link

gdamx commented Dec 27, 2023

Screenshot_20231226_224310

Literally just left screen on to backup a video , nothing backed up assets remaining is the same

@aisbergde
Copy link

I also have seen lost selected folders to upload. Not sure, if they have been really lost, or if they just didn't display. But I added them again. I will see, if they will be forgotten again.

@gdamx
Copy link

gdamx commented Dec 28, 2023

They keep forgetting for me

@eagerto-learn
Copy link

I have the same issue. It forgets the albums selected and disables the foreground and background backup. After I reselect the albums and leave the upload screen on, it tries to upload some videos that I already uploaded from a couple months before. After each "try" is finished the remaining video number stays the same and it tries another video from even an earlier time.

Already set the battery to unrestricted, still same issue everytime I open the app.

@gumpdy
Copy link
Author

gumpdy commented Dec 28, 2023

For myself, when I first open the app, no albums are shown as selected but seemingly after some initialization, appear as expected. I suggest one of you open another bug issue, as I can't detail those quirks.

@nkgiovannivl
Copy link

I have same issue, but if I starts the app enter to cloud icon nothing it's show, press back an again enter to cloud icon, all info appers.

But, it's seems something strange with the videos, beacuse sync deamon/service sync all videos again and again until I allow Notifications for the app on my phone

@kic68
Copy link

kic68 commented Mar 9, 2024

Definitely the same issue for me, the (Android) app forgets which albums to upload when I actively close it. It does not save the albums to upload - so the foreground and background engines are correct when they stop to upload as they think nothing is supposed to get uploaded.
Update: I was just looking at the app status page (albums to be done on top, then total elements, already uploaded elements, remaining elements). While I was just looking at that, the albums to be done vanished and it looked as if I never selected an album. While the app was open, in the foreground, me looking at it.

@Jebula999
Copy link

Jebula999 commented Apr 25, 2024

Any update on this?
Facing the same issue.

500+ images and video's all sitting in a never ending queue because the app has to be in the foreground and open in that specific menu in order for it to upload.

@alextran1502
Copy link
Contributor

@Jebula999 Are you using reverse proxy/dns/cloudflare? Do you mind try access your instance over local ip?

@Jebula999
Copy link

@Jebula999 Are you using reverse proxy/dns/cloudflare? Do you mind try access your instance over local ip?

I am currently on the same local network as my server running Immich.

I am connected directly via the server local IP address

@alextran1502
Copy link
Contributor

So it uploads fine when you open the app, just not working well on the background? Which phone model do you have?

@Jebula999
Copy link

Correct.

It's a Samsung S24 Ultra.

Note the file amount difference in the 2 images attached.

All I did was minimise Immich and open my browser to respond to this message

Unfortunately my clock it not in the image, but they were taken 8min apart.
As soon as I tabbed back to Immich it started uploading again.
Screenshot_20240425_230312
Screenshot_20240425_231119

@alextran1502
Copy link
Contributor

@Jebula999 what you are seeing is normal operations. Background and foreground upload are two different mechanism. One doesn't continue when the state changes. Background upload is meant to use for everyday backup, not initial bulk backup. For initial backup, I suggest using foreground upload. And Samsung is notorious for killing background tasks so you will have to disable all of the battery saving mechanisms on your Samsung phone

@Jebula999
Copy link

@alextran1502 Ok, then that makes more sense.
Thank you for the insight, have a good weekend :)

@kic68
Copy link

kic68 commented Apr 26, 2024

Good morning!
We should not mix up two issues here. One is the "normal" Android energy optimizing killing app issue. This can and should be fixed in the widely spread Android settings.

The other issue is Immich related - as the App does NOT SAVE ITS CONFIGUATION before it is killed or closed. This seems to happen to some people including myself.

Steps to reproduce:

  • Configue Immich App
  • Let it start uploading
  • Do other things for a while or close the app
  • Open the app again
  • There's no configuration anymore, i.e. it does not know the server to sync with anymore.

In that case it will only ever start uploading again if you configure the settings again. Which doesn't help for long. It is definitely NOT related to energy settings, at least not more than these kills can trigger the deletion of Immich's configuration.

Also on a Samsung Galaxy S24 Ultra.

@alextran1502
Copy link
Contributor

@kic68 I saw this reported sometimes, it is quite strange that it happens for some users but not all. Do you access the instance locally? How many assets do you have on your device?

@kic68
Copy link

kic68 commented Apr 26, 2024

Please don't laugh, about 60k photos and videos. Stopping uploading after a few hundred. So this would be a big pain to always reconfigure.

@alextran1502
Copy link
Contributor

alextran1502 commented Apr 26, 2024

@kic68 With that amount of assets, I think it might have taken sometimes for the album to be read/sort/filter with already uploaded assets, so it is not necessarily forgotten.

Maybe worth a try to select an album, then put the app into the background or kill it, then bring it back, enter the backup screen and let it sit there for a few minuets

@jrasm91 jrasm91 removed the bug label Aug 12, 2024
@szmarczak
Copy link

This is a bug. I can reproduce this by trying to upload 1.6G video file on a 40Mbps upload speed. Even if I wait enough time in the background, it still fails to upload.

@meminens
Copy link

Same for me. Background upload doesn't work.

@simone7121
Copy link
Contributor

Hello everyone,

I encountered a similar issue while using Immich. After some troubleshooting, I realized that bypassing the Cloudflare proxy resolved the problem (for me), and everything started working as expected.

It seems that the proxy was causing some kind of interference, potentially blocking certain requests or adding unwanted latency. For anyone else experiencing this, temporarily bypassing Cloudflare might help isolate whether the proxy is the source of the issue.

Additionally, I have a NAT 2 Italian internet connection, and after performing a traceroute, I noticed that my Fritz!Box router was redirecting me directly to my local address. (Even if i'm behind a reerse proxy) This might also be related to the issue, as it could interfere with how traffic is routed through Cloudflare.

It might be worth investigating if there are specific configurations needed for Immich to work smoothly with Cloudflare in proxied mode, or if certain headers are being stripped or blocked, or if the TTL is limited—I'm not sure.

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