[BUG] iOS Background Upload Not Running #1968

Closed
opened 2026-02-05 04:38:23 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @uninvitedguest on GitHub (Jan 9, 2024).

The bug

I am finding that the background sync on my partner's iPhone is not working/triggering at all, despite foreground sync working flawlessly.

The OS that Immich Server is running on

Proxmox 8.0.4 -> Turnkey Core 17.1 / Debian 11

Version of Immich Server

1.9.3

Version of Immich Mobile App

1.9.3

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: unless-stopped
    networks:
      - immich-internal

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    environment:
      - TZ=TZ
    depends_on:
      - redis
      - database
    restart: unless-stopped
    networks:
      - immich-internal

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - /model-cache:/cache
    env_file:
      - stack.env
    restart: unless-stopped
    networks:
      - immich-internal

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: unless-stopped
    networks:
      - immich-internal
    labels:
      com.centurylinklabs.watchtower.enable: "false"

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      #PG_DATA: /var/lib/postgresql/data
    volumes:
      - /database:/var/lib/postgresql/data
    restart: unless-stopped
    networks:
      - immich-internal
    labels:
      com.centurylinklabs.watchtower.enable: "false"

volumes:
  pgdata:
  model-cache:

networks:
  immich-internal:
    external: true

Your .env content

DB_HOSTNAME=hostname
DB_USERNAME=username
DB_PASSWORD=password
DB_DATABASE_NAME=database
REDIS_HOSTNAME=redis
UPLOAD_LOCATION=upload
TZ=TZ
IMMICH_VERSION=release

Reproduction steps

1. Configure iOS application to enable foreground and background uploads (no charging restriction)
2. While open, Immich app uploads without issue in the foreground
3. While closed, Immich app does not upload images in the background (e.g. last uploaded images were from Dec 7th while keeping the app open for a foreground upload).
4. 2 Background processes are listed as queued. Dec 8th, 12:37 is the last time the application was opened. As of 16:15 pm logs do not indicate anything uploaded

Additional information

  1. iPhone 13
  2. iOS 17.1.2
  3. iCloud optimized images is turned on.
  4. In iOS general settings, every background refresh service is disabled except Immich.
Originally created by @uninvitedguest on GitHub (Jan 9, 2024). ### The bug I am finding that the background sync on my partner's iPhone is not working/triggering at all, despite foreground sync working flawlessly. ### The OS that Immich Server is running on Proxmox 8.0.4 -> Turnkey Core 17.1 / Debian 11 ### Version of Immich Server 1.9.3 ### Version of Immich Mobile App 1.9.3 ### Platform with the issue - [ ] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - stack.env ports: - 2283:3001 depends_on: - redis - database restart: unless-stopped networks: - immich-internal immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - stack.env environment: - TZ=TZ depends_on: - redis - database restart: unless-stopped networks: - immich-internal immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - /model-cache:/cache env_file: - stack.env restart: unless-stopped networks: - immich-internal redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: unless-stopped networks: - immich-internal labels: com.centurylinklabs.watchtower.enable: "false" database: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.1.11 env_file: - stack.env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} #PG_DATA: /var/lib/postgresql/data volumes: - /database:/var/lib/postgresql/data restart: unless-stopped networks: - immich-internal labels: com.centurylinklabs.watchtower.enable: "false" volumes: pgdata: model-cache: networks: immich-internal: external: true ``` ### Your .env content ```Shell DB_HOSTNAME=hostname DB_USERNAME=username DB_PASSWORD=password DB_DATABASE_NAME=database REDIS_HOSTNAME=redis UPLOAD_LOCATION=upload TZ=TZ IMMICH_VERSION=release ``` ### Reproduction steps ```bash 1. Configure iOS application to enable foreground and background uploads (no charging restriction) 2. While open, Immich app uploads without issue in the foreground 3. While closed, Immich app does not upload images in the background (e.g. last uploaded images were from Dec 7th while keeping the app open for a foreground upload). 4. 2 Background processes are listed as queued. Dec 8th, 12:37 is the last time the application was opened. As of 16:15 pm logs do not indicate anything uploaded ``` ### Additional information 1. iPhone 13 2. iOS 17.1.2 3. iCloud optimized images is turned on. 4. In iOS general settings, every background refresh service is disabled except Immich.
Author
Owner

@alextran1502 commented on GitHub (Jan 9, 2024):

I don't think we handled background upload with optimized storage turned on. Since it will need to be downloaded from iCloud and then reupload to Immich.

@alextran1502 commented on GitHub (Jan 9, 2024): I don't think we handled background upload with optimized storage turned on. Since it will need to be downloaded from iCloud and then reupload to Immich.
Author
Owner

@uninvitedguest commented on GitHub (Jan 9, 2024):

Oh, I see. Going through the upload of 70,000 assets is going to be a pain without background uploads as this is her main device.

Can this be turned in to a feature request?

@uninvitedguest commented on GitHub (Jan 9, 2024): Oh, I see. Going through the upload of 70,000 assets is going to be a pain without background uploads as this is her main device. Can this be turned in to a feature request?
Author
Owner

@alextran1502 commented on GitHub (Jan 9, 2024):

@uninvitedguest background upload doesn't mean to work for the initial bulk upload. I recommend using foreground upload or download your library from iCloud and use the CLI to upload.

@alextran1502 commented on GitHub (Jan 9, 2024): @uninvitedguest background upload doesn't mean to work for the initial bulk upload. I recommend using foreground upload or download your library from iCloud and use the CLI to upload.
Author
Owner

@hjspencer commented on GitHub (Jan 10, 2024):

@alextran1502 you still need to allow your phone to upload all images though which Immich will then discard as a duplicate.
I have 30k images/videos and this took an age (though I was doing it before icloud was properly supported.

Would still be useful to have this feature.

@hjspencer commented on GitHub (Jan 10, 2024): @alextran1502 you still need to allow your phone to upload all images though which Immich will then discard as a duplicate. I have 30k images/videos and this took an age (though I was doing it before icloud was properly supported. Would still be useful to have this feature.
Author
Owner

@alextran1502 commented on GitHub (Jan 10, 2024):

@hjspencer yes

@alextran1502 commented on GitHub (Jan 10, 2024): @hjspencer yes
Author
Owner

@undaunt commented on GitHub (Apr 12, 2024):

@alextran1502 I've gone through and done my initial bulk upload with foreground upload. How often does background upload execute and should I expect that if I enable it now, it will keep pace with all new photos/videos taken before they are removed from my device due to optimized iCloud photo storage on my phone?

@undaunt commented on GitHub (Apr 12, 2024): @alextran1502 I've gone through and done my initial bulk upload with foreground upload. How often does background upload execute and should I expect that if I enable it now, it will keep pace with all new photos/videos taken before they are removed from my device due to optimized iCloud photo storage on my phone?
Author
Owner

@LoadingZhang commented on GitHub (Jul 21, 2024):

@uninvitedguest background upload doesn't mean to work for the initial bulk upload. I recommend using foreground upload or download your library from iCloud and use the CLI to upload.

@alextran1502 there is another problem, app will not ignore the photos have uploaded by cli now when backup, even the picture show "synced" on photos page

@LoadingZhang commented on GitHub (Jul 21, 2024): > @uninvitedguest background upload doesn't mean to work for the initial bulk upload. I recommend using foreground upload or download your library from iCloud and use the CLI to upload. @alextran1502 there is another problem, app will not ignore the photos have uploaded by cli now when backup, even the picture show "synced" on photos page
Author
Owner

@alextran1502 commented on GitHub (Jul 21, 2024):

@LoadingZhang it is expected behavior, for now. The server rejects the duplicated files and it will be put into a black list to not get uploaded again

@alextran1502 commented on GitHub (Jul 21, 2024): @LoadingZhang it is expected behavior, for now. The server rejects the duplicated files and it will be put into a black list to not get uploaded again
Author
Owner

@LoadingZhang commented on GitHub (Jul 21, 2024):

@LoadingZhang it is expected behavior, for now. The server rejects the duplicated files and it will be put into a black list to not get uploaded again

@alextran1502 This takes a long time to re-upload tens of thousands of photos and videos. It would be better if app could ignore synced photo

@LoadingZhang commented on GitHub (Jul 21, 2024): > @LoadingZhang it is expected behavior, for now. The server rejects the duplicated files and it will be put into a black list to not get uploaded again @alextran1502 This takes a long time to re-upload tens of thousands of photos and videos. It would be better if app could ignore synced photo
Author
Owner

@alextran1502 commented on GitHub (Jul 21, 2024):

@LoadingZhang Yes, agree, we plan to add that mechanism in

@alextran1502 commented on GitHub (Jul 21, 2024): @LoadingZhang Yes, agree, we plan to add that mechanism in
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1968