immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
49.63k stars 2.62k forks source link

Immich Not Uploading Photos #11894

Closed DovarFalcone closed 2 months ago

DovarFalcone commented 2 months ago

The bug

Immich is not uploading some photos to the server. I am using the mobile app on a Google Pixel 8 and have selected the Recent album to backup photos from to my server. Immich will upload some photos taken but not all of them. I have tried uninstalling the app and reinstalling, signing out and back in, as well as clearing the duplicates and re running the backup. After re running the backup i saw the same results.

My initial thought is that Immich is thinking some of the photos are duplicates incorrectly and ignoring them. I have copied on of the duplicate photo logs below. The photos appear to have the same checksum but are different photos.

Photos In Immich

image

Backup Settings

Screenshot_20240818-193134

Screenshot_20240818-193141

Photos In Recent

The last 7 photos are not being uploaded, as well as some random ones further down. image

The OS that Immich Server is running on

Debian 12 in Docker

Version of Immich Server

v1.112.1

Version of Immich Mobile App

v1.112.1 build.154

Platform with the issue

Your docker-compose.yml content

version: "4"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    ports:  # Added in v.1.88.1
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  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: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

UPLOAD_LOCATION=/root/immich
IMMICH_VERSION=release
TYPESENSE_API_KEY=some-random-text
DB_PASSWORD=postgres
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Take photos using the stock camera app
2. Open Immich to see if they all backed up
3. Observe only about 70% of them backed up
4. Verify the expected photos are in the Recents location
5. Verify they are not observed in Immich app
...

Relevant log output

Ignoring duplicate assets on device:
{
  "id": "N/A",
  "remoteId": "N/A",
  "localId": "1000000820",
  "checksum": "zquGkR7LVGbhwosiGKXRvk+CAIE=",
  "ownerId": 5975437934543291489,
  "livePhotoVideoId": "N/A",
  "stackCount": "0",
  "stackParentId": "N/A",
  "fileCreatedAt": "2021-08-28 11:56:21.000",
  "fileModifiedAt": "2021-08-28 11:56:23.000",
  "updatedAt": "2021-08-28 11:56:23.000",
  "durationInSeconds": 0,
  "type": "AssetType.image",
  "fileName": "PXL_20210828_155621495.jpg",
  "isFavorite": false,
  "isRemote": false,
  "storage": "AssetState.local",
  "width": 4032,
  "height": 3024,
  "isArchived": false,
  "isTrashed": false,
  "isOffline": false,
}
{
  "id": "N/A",
  "remoteId": "N/A",
  "localId": "1000001708",
  "checksum": "zquGkR7LVGbhwosiGKXRvk+CAIE=",
  "ownerId": 5975437934543291489,
  "livePhotoVideoId": "N/A",
  "stackCount": "0",
  "stackParentId": "N/A",
  "fileCreatedAt": "2022-10-30 12:50:50.000",
  "fileModifiedAt": "2022-10-30 12:50:54.000",
  "updatedAt": "2022-10-30 12:50:54.000",
  "durationInSeconds": 0,
  "type": "AssetType.image",
  "fileName": "PXL_20221030_165050962.jpg",
  "isFavorite": false,
  "isRemote": false,
  "storage": "AssetState.local",
  "width": 3840,
  "height": 2880,
  "isArchived": false,
  "isTrashed": false,
  "isOffline": false,
}

Additional information

One time during the last update i was able to see all my photos on my app. I was able to do it simply by logging out and back in, but then after about an hour the issue returned and I cannot get these missing photos to upload.

alextran1502 commented 2 months ago

Can you help track down to the two photos with the same checksum and with different name? What do they look like visually?

Can you also go to the grid view settings and disable dynamic layout and choose group by month and see if it makes any difference

DovarFalcone commented 2 months ago

Both photos are visibly different. I turned off Dynamic Layout and switched the Group by from Automatic to month and the issue still persists

PXL_20221030_165050962.jpg

image

PXL_20210828_155621495.jpg

image

alextran1502 commented 2 months ago

@fyfrey I feel like you help answer this question before, what could be the potential causes for this issue?

fyfrey commented 2 months ago

The upload mechanism is not yet using checksums afaik. The syncing mechanism does, however. In any case: try to clean app data. Maybe Google is restoring it from a backup etc. leading to a garbage state (wrong checksum for local asset id).

DovarFalcone commented 2 months ago

I cleared my Google Photos Cache/App Data which initially did not appear to have any affect. I then went and cleared immich's cache and storage from the devcice. I then restarted my Immich docker-compose stack.

After taking these actions, I observed the device's local photos that were not being uploaded in immich with a cloud icon without a check in immich UI, which was exciting because they were not appearing yesterday. Then I went to the backup section and started a new backup. Immich identified about 120 images which it backed up, and these included the missing photos. I am seeing the uploaded images in the web browser and library/admin folder, so it appears to be working correctly.

mmomjian commented 2 months ago

Resolved, thanks fyfrey