immich icon indicating copy to clipboard operation
immich copied to clipboard

[BUG] Background upload doesn't work even with Automatic Foreground Backup and Automatic background backup service enabled.

Open gumpdy opened this issue 1 year ago • 24 comments

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
  • [X] 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 avatar Dec 26 '23 23:12 gumpdy

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

gdamx avatar Dec 27 '23 02:12 gdamx

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

gumpdy avatar Dec 27 '23 03:12 gumpdy

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 avatar Dec 27 '23 03:12 gdamx

Screenshot_20231226_224310

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

gdamx avatar Dec 27 '23 03:12 gdamx

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.

aisbergde avatar Dec 28 '23 00:12 aisbergde

They keep forgetting for me

gdamx avatar Dec 28 '23 00:12 gdamx

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.

eagerto-learn avatar Dec 28 '23 13:12 eagerto-learn

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.

gumpdy avatar Dec 28 '23 14:12 gumpdy

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

nkgiovannivl avatar Jan 12 '24 01:01 nkgiovannivl

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.

kic68 avatar Mar 09 '24 15:03 kic68

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.

Jebula999 avatar Apr 25 '24 20:04 Jebula999

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

alextran1502 avatar Apr 25 '24 20:04 alextran1502

@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

Jebula999 avatar Apr 25 '24 21:04 Jebula999

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

alextran1502 avatar Apr 25 '24 21:04 alextran1502

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

Jebula999 avatar Apr 25 '24 21:04 Jebula999

@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

alextran1502 avatar Apr 25 '24 21:04 alextran1502

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

Jebula999 avatar Apr 26 '24 05:04 Jebula999

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.

kic68 avatar Apr 26 '24 06:04 kic68

@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?

alextran1502 avatar Apr 26 '24 06:04 alextran1502

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.

kic68 avatar Apr 26 '24 07:04 kic68

@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

alextran1502 avatar Apr 26 '24 07:04 alextran1502