Skip to content

[Beta] Unable to upload HEIC photos over cellular #21325

@larsmew

Description

@larsmew

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

I have a strange issue happening around version 1.139.3 (maybe earlier) on the Beta Timeline where photos (tested HEIC and PNG) will not upload over cellular connection on iOS but live photos and movies upload just fine. Everything also works as expected when connected to any Wi-Fi network (whether local or remote).

New photos will also upload just fine using the non-beta timeline over cellular.

I have tested using two iPhones (2 different accounts) and an iPad. All with same result.

I have also tested using tailscale and the local ip:port but the same issue persist which leads me to think it's not an issue with any reverse proxy setup.

Toggling backup options for "Videos upload over cellular" works as expected.
Toggling backup options for "Photos upload over cellular" only changes whether live photos are uploaded or not.

The OS that Immich Server is running on

Raspbian (Raspberry Pi 4)

Version of Immich Server

v1.139.4

Version of Immich Mobile App

v1.139.3

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

iPhone 15 Pro Max, iPhone 15, iPad Air M1

Your docker-compose.yml content

#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/data
      - ${THUMB_LOCATION}:/data/thumbs
      - ${ENCODED_VIDEO_LOCATION}:/data/encoded-video
      - ${PROFILE_LOCATION}:/data/profile
      - ${BACKUP_LOCATION}:/data/backups
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - stack.env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
      # DB_STORAGE_TYPE: 'HDD'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/media/external/immich
DB_DATA_LOCATION=/home/pi/immich/pgdata
IMMICH_VERSION=release
DB_PASSWORD=redacted
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
THUMB_LOCATION=/home/pi/immich/thumbs
ENCODED_VIDEO_LOCATION=/media/external/immich/encoded-video
PROFILE_LOCATION=/home/pi/immich/profile
BACKUP_LOCATION=/media/external/immich/backups

Reproduction steps

  1. Ensure only cellular connection
  2. Enable Beta Timeline
  3. Take Photo
  4. Open Immich and wait for upload...

Relevant log output

Query failed : {
  durationMs: 152.38826700020581,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(7d06fd62-9f7b-414d-9a94-c5071a8d8ff2, \\x1e64f653ad4131d6a779bf06c7a71939830d2120) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7d06fd62-9f7b-414d-9a94-c5071a8d8ff2',
    null,
    <Buffer 1e 64 f6 53 ad 41 31 d6 a7 79 bf 06 c7 a7 19 39 83 0d 21 20>,
    '/data/upload/7d06fd62-9f7b-414d-9a94-c5071a8d8ff2/ba/dc/badc808c-6473-44c7-83ca-bdff35096ac0.MOV',
    '86295D2B-2524-4310-8734-25D3AC6F7863/L0/001',
    '1ddff55b5ffc56d5f7e59943130c49a21dc72e773cef4072dd83b792c03ef887',
    2025-08-26T21:42:14.533Z,
    2025-08-26T21:28:27.561Z,
    2025-08-26T21:42:14.533Z,
    'VIDEO',
    false,
    '0',
    'timeline',
    'IMG_0340.MOV'
  ]
}

Additional information

Only getting the "duplicate key value" error for the live photo when restarting immich to try to re-upload

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions