Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Immich iOS app cannot upload, stuck #5445

Closed
1 of 3 tasks
handonam opened this issue Dec 2, 2023 · 40 comments
Closed
1 of 3 tasks

[BUG] Immich iOS app cannot upload, stuck #5445

handonam opened this issue Dec 2, 2023 · 40 comments

Comments

@handonam
Copy link

handonam commented Dec 2, 2023

EDIT: March 7th, 2024 - SOLVED, I ran out of disk space.

The bug

I took a bit of a break since around November 5th through November 17th, in which I didn't have immich running. So, I started immich again on Nov 17th, updating to 1.87.0. I forgot what I was on when it was November 5th and prior.

But, fact is, iOS hasn't been uploading images since 1.87.0. And checking the app, the server storage says "0 of 0 used"
IMG_5214

In the backup screen, none of the numbers in "Backup" and "Remainder" have moved:
IMG_5215

Most notably, this "Uploading file info" section does not move at all. Even if you click "Cancel" followed by "Start Backup"
IMG_5216

Singularly uploading images do not change anything as well.

Attempted to check iOS app for any logs (including Troubleshooting mode on with finest log settings), but nothing came up. Logs are fairly blind to this issue.

The OS that Immich Server is running on

docker-compose via Unraid

Version of Immich Server

1.89.0 and 1.88.2

Version of Immich Mobile App

1.89.0 build.129

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  portainer_agent:
    ports:
      - '9001:9001'
    container_name: portainer_agent
    restart: always
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
      - '/var/lib/docker/volumes:/var/lib/docker/volumes'
    image: 'portainer/agent:2.19.1'
  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
    ports:
      - 2283:3001
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.yml # this is in /boot/config/plugins/compose.manager/projects/immich/hwaccel.yml
      service: hwaccel
    command: ["start.sh", "microservices"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    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:
      - .env
    ports:
      - 3003:3003
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - tsdata:/data
    restart: always

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

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - .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:
  tsdata:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/user/Documents/immich

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=<REDACTED>
DB_PASSWORD=<REDACTED>


# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

See screenshots.

Additional information

No response

@steve5355
Copy link

I am having the same problem. Every time i check the status, it shows the same number of pending uploads. I manually start and it shows all the images uploading.... but the counter is not counting down to zero, it stuck at the same number. I then check my SMB share for the uploads folder and i dont see any new files actually uploading there. I tried background upload, manual upload, its stuck pretending to upload but not actually doing anything it seems.

I can do further testing and troubleshooting if needed.

@charleslcso
Copy link

charleslcso commented Dec 3, 2023

I have similar issue.

Fresh, first time install of immich. At 1.89.

iOS. Debian.

All my 355 albums show up in ios app. Selected them all and start to backup.

It ran in burst twice. First time to about 100 photos, and then stopped.

Then goes to about 115 photos, and then stopped.

Kinda like you, stuck.

Left it over night as I have about 75000 photos.

Came to check ios app 1 hr later, and all the backup is back to 0, as if nothing has been selected. The 15x odd photos uploaded cannot be found in web nor in ios app.

I can provide logs if needed.

Unfortunately, I can't use immich, yet.

EDIT: after reading thru reddit, discord, GitHub issues, I guess the problem comes down to this:

  • my iPhone is only 64GB, and most photos on my device is thumbnails only.
  • when attempting to backup via Immich, all sort of "iOS photos and lack-of-disk-space magic" happens in the background.

= Immich is not handling this scenario properly yet.

@notflip
Copy link

notflip commented Dec 5, 2023

Same here! Everytime my screens (ios) turns off, the upload restarts with the same picture, It also says 2 background processes queued, And then fetch ran 12/3/2023, which is 2 days ago.

@steve5355
Copy link

I can't use the app until there is a fix. I'm not sure its worth it to reinstall, I will just wait for the next release.

@alextran1502
Copy link
Contributor

@steve5355 if you are using iCloud with optimized storage turned on, this is expected behavior because the app hasn't handled this use case properly yet

@steve5355
Copy link

@alextran1502 Yes, this is the issue... you're right, I'm not sure how i missed this. It wasn't obvious to me and now i feel dumb.

For anyone else using iCloud: The iphone puts the image in the cloud and removes the original from the device, so immich can't grab the source file, even though you can see the thumbnails and previews on device. I have been using the manually selected photos option for testing, not ready to "allow all" to my camera roll, so few days ago, i selected photos from a few months ago on my camera roll and those must not be on my device.

So what are folks doing to work around this issue for now (until there is solution)?

@alextran1502
Copy link
Contributor

@steve5355 I am experimenting with a solution for this. I will try to include it in the next release #5508

@KertzmannPerry
Copy link

The same issue has occurred with Android version 1.89.0, unable to synchronize, and the remaining backup quantity has not changed

@joestump
Copy link

joestump commented Dec 7, 2023

I don't know if this is entirely related, but I'm running into a situation where Immich will not fully complete the backup and no longer allows me to even select albums for backup. I'm on the latest version, fresh install (1.89).

I've ran into multiple issues:

  • Syncs will just stop. At first I would hit Cancel and then Start Backup to get it to start again. Eventually this stopped working and I had to kill the app and restart it. This too has ended up failing as a workaround.
  • Very large video files are not completing uploads. I've had videos as small as 1GB fail, though the common failure size seems to be around 4GB. I'm on an iPhone 16 Pro Max (8GB of RAM) uploading to Intel NUCs (16GB of RAM) so I'm unsure why these continue to fail.
  • I'm now at the point where Immich logs shows it sees local albums, but the sync UI shows 0 albums on device. This has persisted despite me logging out/back in and deleting/reinstalling the app. Immich simply fails to see any local albums.

I'm now left in a state where I can't even kick off a manual backup nor can I turn on background syncing. Immich managed to upload about 29,000 of my 32,000 photos before becoming unusable.

Here are the workarounds I've attempted – all have failed:

  • Log out and back in.
  • Delete app and reinstall.
  • Remove videos it was struggling with from Photos on the desktop.
  • Clip raw b-roll videos down to be smaller.

Logs show nothing on these video failures. Progress bar gets to 70-80%, then "completes", only for the next backup to start over again at the large failed video file. Nothing in the server logs either.

Ironically, the logs on the device do show Immich finding my local albums. The UI just doesn't reflect that fact.

A few things that would really help those of us with large libraries/sync issues would be:

  1. Keep track of the number of times Immich has attempted to upload a file. If you've tried to upload a file 5 times and it's still not backed up, mark it as failed.
  2. Show file size in the upload/sync UI.
  3. Add a "skip" button so problematic files can be manually skipped over.
  4. Either change the algorithm to prioritize images/smaller files or add a setting that allows the user to do so.

See attached screen shot – logs show it found 90 local albums and then 11 seconds later "Not found albums":

Screenshot 2023-12-07 at 06 09 39

@alextran1502
Copy link
Contributor

@joestump just for information, are you using iCloud, with Optimized Storage turned on and Share Albums feature of iCloud?

@joestump
Copy link

joestump commented Dec 7, 2023

@alextran1502 I am not. I disabled that setting per this thread, which did not help. I actually had it on and had zero issues uploading ~15,000 photos when I ran into the issues I described. I turned it off, but it's had no effect on my issue.

I recently tried to get it going again and did see this error in the logs - but Immich still does not see my albums nor can I re-initiate my backups any longer:

Screenshot 2023-12-07 at 07 58 17

@joestump
Copy link

joestump commented Dec 7, 2023

Turning the logs up you can see the following timeline:

  • Immich finds 90 albums.
  • Immich receives a "ping" that is null.
  • Immich reports finding no albums or assets to back up.

Screenshot 2023-12-07 at 08 09 59

@handonam
Copy link
Author

@steve5355 I am experimenting with a solution for this. I will try to include it in the next release #5508

Checking in, after more updates (including this one above), still not able to upload. I don't use icloud for photos fyi

@alextran1502
Copy link
Contributor

@handonam Do you use reverse proxy to access your instance on the mobile app? Does the proxy set the body size allowance large enough for the file to be accepted?

@steve5355
Copy link

update:

  1. turning off icloud storage fixed for me, luckily i had enough room on my phone to store all of the photos on device. so that fixes that issue.

  2. my next issue was proxy was using default values which blocked large files from transferring. updated proxy config and that fixed it.

  3. now the only issue with "files not uploading" from my iphone camera roll, is that, no matter what options i select in background refresh, the phone will stop / stall uploading once the phone screen turns off or i switch to another app.

Therefore, there must still be an issue on the background uploading, logic. the only way the images are uploaded from my iphone is if i keep the screen on by touching it every few minutes. This also kills the battery while uploading, the phone gets hot, but it is uploading very fast on my local wifi. I believe this is a known issue so I can wait for a fix in a future release. At least its working for me after doing items 1 and 2 above.

@alextran1502
Copy link
Contributor

@steve5355 we solved a few issues in the next release. Let's see how it goes

@handonam
Copy link
Author

@handonam Do you use reverse proxy to access your instance on the mobile app? Does the proxy set the body size allowance large enough for the file to be accepted?

I don’t have Reverse Proxy set up. should I be?

@notflip
Copy link

notflip commented Dec 15, 2023

@steve5355 we solved a few issues in the next release. Let's see how it goes

What issues did you solve? Just so I know which steps to take, will disabling iCloud still be required for the uploads to work? Thanks!

@alextran1502
Copy link
Contributor

@notflip We solved the issue of uploading files from iCloud that causes the process to be hung. And potentially solving an issue of the album selection for backup doesn't load the albums

@iamLazyCode
Copy link

iamLazyCode commented Dec 16, 2023

@notflip We solved the issue of uploading files from iCloud that causes the process to be hung. And potentially solving an issue of the album selection for backup doesn't load the albums

hi sir on android device when screen gets locked or switch to another app uploads pause is there any way to fix this too

@alextran1502
Copy link
Contributor

@PitchAbyss you can enable background backup, backup process will then run periodically

@iamLazyCode
Copy link

@PitchAbyss you can enable background backup, backup process will then run periodically

Sir when i activate it has error

Screenshot_20231217_022105.jpg

Screenshot_20231217_022119.jpg

@alextran1502
Copy link
Contributor

@PitchAbyss
image

@iamLazyCode
Copy link

@PitchAbyss image

my appologise i just check it working, thankyou sir , i hope there could be a folder view in app in future

@iamLazyCode
Copy link

@PitchAbyss
image

I just set albums to upload then it got stuck at 1 video i exit the app and now it shows empty

Screenshot_20231217_023112.jpg

@handonam
Copy link
Author

on 1.91.4, still reporting with this being stuck.

@bloodyburger
Copy link

same here, proxy body size set enough to handle big uploads, but my uploads keeps restarting, using immich behind SWAG.

@markwien
Copy link

Same here bigger videos don't upload (longer than 2 minutes)

Service is behind a reverse proxy.

Log file:

Failed to get file for asset FCEBA96B-2B92-4E11-A9F4-60DC70CD34AC/L0/001, skipping

All iCloud foto data is downloaded to the iPhone.

@alextran1502
Copy link
Contributor

@markwien Your reverse proxy probably doesn't set up to accept large files. Try local IP to confirm the issue

@markwien
Copy link

@markwien Your reverse proxy probably doesn't set up to accept large files. Try local IP to confirm the issue

omg u right I was thinking i did - I changed client max body size to 16G now it works.

Thank you !

@bennesp
Copy link

bennesp commented Jan 27, 2024

I have:

  • iCloud optimization turned off
  • Immich deployed behind traefik (which does not have a max body size by default)
  • 2000 (over a total of 2700) photos and videos already backed up
  • the backup stuck
  • plenty of disk space on the server

I managed to find the incriminated video: a 2m34s video in a shared album. I am not the owner of the shared album. File size is reported to be "Zero kB" by Photo on MacOS (with cmd+i) while I can't find a way of showing file size on iOS.

@handonam
Copy link
Author

handonam commented Mar 8, 2024

@alextran1502

So my dum self realized my storage was full. I had to check the docker logs to find out that it was the case. I could have sworn i tried to look at docker before, and never seeing this error. But digging into the logs recently, it was very clear: insufficient space.

the mobile app doesn't really describe that as a failure to upload, it just hangs. Not quite ideal (as i spent months churning on why).

In my case, I wouldn't mind if we close this issue. But, I would say: a more verbose failure message for mobile app (either in the UI, or even the logs) would be valuable for triaging faster, and to separate some of these issues people are having into different threads.

edit: cc @jrasm91

@bennesp
Copy link

bennesp commented Mar 19, 2024

Has this somehow been solved? I am still having this problem unfortunately

@notflip
Copy link

notflip commented Mar 19, 2024

Same for me, issue is still there on Ios

@handonam
Copy link
Author

Has this somehow been solved? I am still having this problem unfortunately

i would suggest to open a new issue if it's not related to the free storage issue i had. that way, the devs can triage it better

@napisani
Copy link

napisani commented Apr 6, 2024

@handonam Do you use reverse proxy to access your instance on the mobile app? Does the proxy set the body size allowance large enough for the file to be accepted?

this saved me, thank you

for anyone using nginx-ingress on their k8s cluster, this annotation fixed the issue for me

        'nginx.ingress.kubernetes.io/proxy-body-size': '999m',

@Whamp
Copy link

Whamp commented Jun 5, 2024

I'm having the same issue but not using a reverse proxy, instead i'm using cloudflare tunnel. Are there similar file size constraints that people are aware of there? I never can seem to get a reverse proxy working on my unraid config.

@alextran1502
Copy link
Contributor

@Whamp yes CF limit to 100MB file, we don't have chunk upload implemented yet so the request is rejected by CF

@onstring
Copy link

onstring commented Jun 9, 2024

I got the same issue, which seems due to the unsupport file type. And the upload stuck with repeated logs as following:

[Nest] 8  - 06/09/2024, 1:39:52 PM   ERROR [ImmichServer] [AssetService] Unsupported file type 29583.pic
[Nest] 8  - 06/09/2024, 1:40:14 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: qVBCnJEgmxCmxGOyAAAz
[Nest] 8  - 06/09/2024, 1:40:44 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    1TOKP-FZM7SCaeXnAAA1
[Nest] 8  - 06/09/2024, 1:40:46 PM   ERROR [ImmichServer] [AssetService] Unsupported file type 29554.pic
[Nest] 8  - 06/09/2024, 1:40:59 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: 1TOKP-FZM7SCaeXnAAA1
[Nest] 8  - 06/09/2024, 1:41:22 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    3PlQvgY1IMQkUFmvAAA3

The upload only started again after I deleted the files immich complainted.
Maybe it is needed some improvement on this?

@telpalbrox
Copy link

telpalbrox commented Jul 30, 2024

This happened to me as well. In my case it seems that the error was that I have photos synced via macOS and they do not have a name.

These were the logs I was getting in the client:

flutter: Error(400) uploading BA9AC325-DC3D-480D-98C0-874FBBC58F7E/L0/001 |  | Created on 2021-12-31 17:28:00.000 | Bad Request
flutter: Error(400) uploading 127E1410-7322-436C-AF13-79B9B148D62D/L0/001 |  | Created on 2021-12-31 16:25:28.000 | Bad Request
flutter: Error(400) uploading livePhoto for assetId | .000000_o_(null) | Bad Request

And in the server:

[Nest] 30  - 07/30/2024, 3:33:36 PM   ERROR [Api:AssetMediaService] Unsupported file type .000000_o_(null)
[Nest] 30  - 07/30/2024, 3:33:57 PM   ERROR [Api:AssetMediaService~wn3qnwjt] Unsupported file type .000000_o_(null)
[Nest] 30  - 07/30/2024, 3:34:11 PM   ERROR [Api:AssetMediaService] Unsupported file type .000000_o_(null)
[Nest] 30  - 07/30/2024, 3:34:19 PM   ERROR [Api:AssetMediaService] Unsupported file type .000000_o_(null)

I think the root cause is that the client is doing an invalid request to the server and it is not recovering correctly.
I hacked my way around the code to get it to work. Here you can see how I managed to fix it telpalbrox@7de3659 .

This is just a hack, and I do not think it can be merged. Probably a more elegant solution has to be found.
If I can be of any help to fix it let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests