immich-app / immich

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

[BUG] IOS - Unable to find album to backup #1838

Closed bart268 closed 1 year ago

bart268 commented 1 year ago

The bug

I did a clean install of the server with docker-compose, pretty straight forward. The webpage seem to be working and I am able to see and upload photo's. Only thing I can't get Immich working on IOS (both iPhone 14 Pro 16.3.1 and iPad AIR 16.3.1).

Am am able to login to the server with the app and can see the photo's which I uploaded using the webpage. Then I go to Back-up albums > select which shows Total unique items: 0 Albums on phone (0) The "loader" just keeps spinning and no albums ever show up.

When checking logs in the app I see this: [_resumeBackup] Start backup Found 65 local albums Load assets: 99ms state is already up-to-date Load assets: 70ms state is already up-to-date

I did the most easy install to rule out reverse proxy stuff etc for now.

  1. wget https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
  2. Didn't change anything in the docker-compose.yml file
  3. wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env
  4. edit .env file and only changed "UPLOAD_LOCATION=/home/######/docker/media/photos"
  5. docker compose up -d
  6. Connect to the web interface on ip http://x.x.x.x:2283 and created an admin account
  7. Installed the app and logged in using the url http://x.x.x.x:2283/api

No clue where to start next...

The OS that Immich Server is running on

Debian 11 64bit

Version of Immich Server

1.48.1

Version of Immich Mobile App

1.48.0 build.87

Platform with the issue

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: altran1502/immich-server:release
    entrypoint: [ "/bin/sh", "./start-server.sh" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: altran1502/immich-server:release
    entrypoint: [ "/bin/sh", "./start-microservices.sh" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: altran1502/immich-machine-learning:release
    command: [ "python", "src/main.py" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - model-cache:/cache
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - database
    restart: always

  immich-web:
    container_name: immich_web
    image: altran1502/immich-web:release
    entrypoint: [ "/bin/sh", "./entrypoint.sh" ]
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: altran1502/immich-proxy:release
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: altran1502/immich-server:release
    entrypoint: [ "/bin/sh", "./start-server.sh" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: altran1502/immich-server:release
    entrypoint: [ "/bin/sh", "./start-microservices.sh" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: altran1502/immich-machine-learning:release
    command: [ "python", "src/main.py" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - model-cache:/cache
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - database
    restart: always

  immich-web:
    container_name: immich_web
    image: altran1502/immich-web:release
    entrypoint: [ "/bin/sh", "./entrypoint.sh" ]
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
###################################################################################
# Database
###################################################################################

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=5432

###################################################################################
# Redis
###################################################################################

REDIS_HOSTNAME=immich_redis

# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Upload File Location
#
# This is the location where uploaded files are stored.
###################################################################################

UPLOAD_LOCATION=/home/######/docker/media/photos

###################################################################################
# Reverse Geocoding
#
# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM
####################################################################################

# DISABLE_REVERSE_GEOCODING=false
# REVERSE_GEOCODING_PRECISION=3

####################################################################################
# WEB - Optional
#
# Custom message on the login page, should be written in HTML form.
# For example:
# PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>"
####################################################################################

PUBLIC_LOGIN_PAGE_MESSAGE=

####################################################################################
# Alternative Service Addresses - Optional
#
# This is an advanced feature for users who may be running their immich services on different hosts.
# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers.
# Note: immich-microservices is bound to 3002, but no references are made
####################################################################################

IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

####################################################################################
# Alternative API's External Address - Optional
#
# This is an advanced feature used to control the public server endpoint returned to clients during Well-known discovery.
# You should only use this if you want mobile apps to access the immich API over a custom URL. Do not include trailing slash.
# NOTE: At this time, the web app will not be affected by this setting and will continue to use the relative path: /api
# Examples: http://localhost:3001, http://immich-api.example.com, etc
####################################################################################

#IMMICH_API_URL_EXTERNAL=http://localhost:3001

    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: altran1502/immich-proxy:release
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

volumes:
  pgdata:
  model-cache:

Reproduction steps

I did the most easy install to rule out reverse proxy stuff etc for now.
1. wget https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
2. Didn't change anything in the docker-compose.yml file
3. wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env
4. edit .env file and only changed "UPLOAD_LOCATION=/home/######/docker/media/photos"
5. docker compose up -d
6. Connect to the web interface on ip http://x.x.x.x:2283 and created an admin account
7. Installed the app and logged in using the url http://x.x.x.x:2283/api

Additional information

No response

gcarrarom commented 1 year ago

Same issue here running on Kubernetes. v1.48.1 running on the server and v1.48.0 mobile on iOS 16.4.

alextran1502 commented 1 year ago

Do you guys have Optimized Storage enable and your photos are on iCloud?

bart268 commented 1 year ago

I tested with both icloud on and off. When it's enabled it says "Found 65 local albums" in IOS logging, when disabled is says "Found 35 local albums".

Just to be sure I reinstalled the app between switching icloud settings but unfortunately didn't change the behaviour.

gcarrarom commented 1 year ago

I had the optimized storage option and iCloud on. Turned both off and still have the same issue as well.

alextran1502 commented 1 year ago

Turning them off won't necessarily have the files on your local device, if you use iCloud, the files are probably on the Apple cloud server. Immich will need those photos/videos on your local device to be able to see and backup. I might implement a mechanism to download from iCloud and then upload to Immich at some point.

bart268 commented 1 year ago

I did make sure to have a file and album locally on the device.

bart268 commented 1 year ago

You got me thinking there Alex, it must be something with the previous icloud setting (probably the optimize storage settings). I completely erased all photo's from my phone (made sure to have icloud sync turned of).

After this I was able to select the only remaining album "recent" and sync the photo which was in it. Well it's a start but I guess this will affect more users. Now let's see what happens if I sync icloud back to the phone...

bart268 commented 1 year ago

Unfortunately not getting better, well a little bit.

New photo's will now however show up in the app but won't upload to the server. I guess this has to do with the thing it's still trying to find the albums?

Edit: I see the phone is still downloading the original photo's. Will let it run overnight and see how it goes tomorrow.

jkoetsier996 commented 1 year ago

I have the same problem, but on the Android app. Fresh install with docker compose on rpi4. I only changed the upload location, and disabled machine learning. The timeline builds in the app, but when selecting an album, I get the same spinning wheel, typing doesnt do anything.

bart268 commented 1 year ago

It took some hours to sync my icloud photo’s back however the issue returns with it. It’s working when I delete all photo’s from the phone but as soon I try to use it with all my photo’s it stops working.

alextran1502 commented 1 year ago

I might have found the bug on Android, but I am not sure how it is related to iOS. The fix will be available in the next release. Please follow #1841

bart268 commented 1 year ago

I got a little bit further. The app asks me to give permissions to access photo's, if I limit this to a few photo's (I tested with like 100 photo's) the app seems to access photo's. Could it be there is some kind of limitation for max photo's? I got like 7500 photo's on the phone.

alextran1502 commented 1 year ago

The new update is out for 1.49. Please let me know if it helped with fixing the issue.

bart268 commented 1 year ago

Unfortunately this didn't fix the issue.

gcarrarom commented 1 year ago

Tried selecting only 500 pictures to see if I could progress as well. It's now always opening immich's settings page when trying to open the app. Selecting all photos on 49 still has the same issue. Web uploads and everything else works fine.

Top-right corner icon shows always 0 photos and it's always spinning it's progress. Total, backup and remainder shows only "..." assets.

alextran1502 commented 1 year ago

I believe the app must have access to all photos to work correctly

gcarrarom commented 1 year ago

I believe the app must have access to all photos to work correctly

That could be quite complicated for me, I have a large library that couldn't fit on my phone. I'll try turning off completely icloud and removing the connection on photos. Then migrating manually from iCloud to immich the older photos. I'll do another backup on my NAS for the older photos and remove from iCloud. This should give me a baseline to check if it's the missing photos from the phone storage but linked to iCloud.

gcarrarom commented 1 year ago

Hey! Just tested on my SO's phone and it is finding the albums just fine. We're using the Shared Library and we have the same number of photos. Maybe it's the number of albums? @KJASHgdaljdfdsa, do you also have a bunch of shared albums and albums? I'll do some more testing this evening

gcarrarom commented 1 year ago

So... Not sure what happened. I stepped out for a few hours and it's now uploading on the background. It's only 91 photos out of 40k, but it's something. I still can't select the albums and I can only assume it's checking the "recents". I'll report back if I find anything out.

bart268 commented 1 year ago

@gcarrarom I got the same experience except I don't have shared albums active atm. Seems to be uploading in the backupground but very slowely and still unable to select any albums.

bart268 commented 1 year ago

For now I got it kind of working. Went to backup settings in the app and disabled the running backup job (red button at the bottom) and disabled the backup option when de app is active. To let it sync I only have background backup on. It seems to backup now slow but steady in the background 🙂

Still unable to select any albums but it's a start.

gcarrarom commented 1 year ago

App is now working properly for me... Looks like it was just a slow start until it recognized all the photos. It's now uploading on the foreground and showed a couple of albums on the selection page. Maybe it's going to work out now? I'll leave the phone running here for a while and see how that's going to go.

As I was writing this my phone overheated and shut down... I guess I'll have to put it on the fridge for the foreground upload lol

bart268 commented 1 year ago

I finally got it to work. It looked like my issue had to do with albums and folders. After moving the albums to the root folder I am able to select the albums. My structure was: root --folder1 ----album1 ----album2 --folder2 ----album3 etc

Only thing I have now is the photo's are synced however albums created (yes I can select the albums and photo's in it are synced). Is this expected?

alextran1502 commented 1 year ago

@KJASHgdaljdfdsa What do you mean by it is synced however the albums are created?

bart268 commented 1 year ago

Sorry, I mean the albums are not created. Only the photo's are synced but are not part of an album in Immich like they are in icloud.

alextran1502 commented 1 year ago

@KJASHgdaljdfdsa Correct, that is the expected behavior. We don't have mechanism to upload into Immich album from the mobile app yet

bart268 commented 1 year ago

Glad I got it working now. Love the speed of the app and website, will keep an eye out for future updates.

gcarrarom commented 1 year ago

Interesting! I do have folders of albums as well! I'll convert to flat as well and report back. My app stopped after uploading 2k images.

alextran1502 commented 1 year ago

I am closing this issue since the initial problem has been resolved.

mlapida commented 10 months ago

I understand this was closed - was the solution to remove all album folders? I can't seem to get the iOS app working, as it doesn't load the albums from the backup selection window.