immich-app / immich

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

[BUG] Backup gets stuck on Video #190

Closed Klutronic closed 2 years ago

Klutronic commented 2 years ago

Describe the bug When backing up my pictures and videos, it almost finishes and gets stuck. I have seen this on multiple videos. Length doesn't seem to matter. They are all from an iPhone 12 Pro Max, 4K, 3840x2160, Dolby Vision, 60 FPS.

Task List [x] I have read thoroughly the README setup and installation instructions. [x] If my setup is different, I have included my docker-compose file. [x] I have included my redacted .env file.

###################################################################################

Database

###################################################################################

DB_USERNAME=immich DB_PASSWORD= DB_DATABASE_NAME=

###################################################################################

Upload File Config

###################################################################################

UPLOAD_LOCATION=/mnt/immich

###################################################################################

JWT SECRET

###################################################################################

JWT_SECRET=

###################################################################################

MAPBOX

####################################################################################

ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY

ENABLE_MAPBOX=false MAPBOX_KEY=

###################################################################################

WEB

###################################################################################

This is the URL of your vm/server where you host Immich, so that the web frontend

know where can it make the request to.

For example: If your server IP address is 10.1.11.50, the environment variable will

be VITE_SERVER_ENDPOINT=http://10.1.11.50:2283

VITE_SERVER_ENDPOINT=http://192.168.0.215:2283

[x] I have included information on my machine, and environment.

Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1

4GB RAM 2 vCPUs

To Reproduce Steps to reproduce the behavior:

  1. Open Immich
  2. Tap backup icon
  3. Start Backup
  4. Gets stuck on the first video it tries to upload

Expected behavior All photos and videos get backed up

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context I have removed the files that get stuck a few times to make sure it wasn't certain videos, but all of them end up stuck.

alextran1502 commented 2 years ago

@Klutronic Can you help Me take a screenshot of the video setting Setting > Camera > Video? I realized that I've never recorded the video in 4K 60fps so there was no test on that. I will dig into this

Klutronic commented 2 years ago

Hey @alextran1502, sure thing:

2022-05-28 11-26-12-0

alextran1502 commented 2 years ago

@Klutronic I haven't been able to reproduce this issue on my end (iPhone 12 Pro). I used the same setting and record a 4K Dolby Vision 60fps footage and was able to upload the file.

Is there any short footage from your phone that you can share so I can put it on my phone to try uploading?

boffnoff commented 2 years ago

@Klutronic if you checked the other open bugs you’d notice this is a duplicate of #54 Could we close/merge these issues for simplicity?

@alextran1502 I know you struggled to load my 7Gb video but I have the same iOS video settings applied

alextran1502 commented 2 years ago

@boffnoff @Klutronic Do you guys use the Nginx setting in the repo or do you have your own Nginx setting?

Do you have the ability to get the log file from Xcode when uploading the video for me?

Edit: wording

Klutronic commented 2 years ago

@alextran1502 I use whatever is in the repo. If you tell me how to get the Xcode logs Ill grab whatever you need.

Edit: I think I have the logs. Is there anything specific I should be looking for for you?

alextran1502 commented 2 years ago

@Klutronic Can you paste the log to the text file and post it here, I will scan through it. Try to grab it before/during/after the upload process of the video.

Klutronic commented 2 years ago

I have gotten the videos to upload successfully. I wasn't connecting locally (I used Nginx Proxy Manager so I can could access/backup my immich instance from outside my network), but as soon as I used the local IP address of my server it uploaded just fine. So I guess for now I can only backup on my local network. Let me know if you want to test outside the local network at some point!

alextran1502 commented 2 years ago

I have gotten the videos to upload successfully. I wasn't connecting locally (I used Nginx Proxy Manager so I can could access/backup my immich instance from outside my network), but as soon as I used the local IP address of my server it uploaded just fine. So I guess for now I can only backup on my local network. Let me know if you want to test outside the local network at some point!

@Klutronic Thank you, this is an infrastructure issue, let's open a new one to focus on that.

@boffnoff Did you also use the same setup as the comment above when backing up the video?

boffnoff commented 2 years ago

@alextran1502 I used the default Nginx included with your docker-compose. I dont have a mac so can't grab Xcode logs sorry😞

I've tried uploading the file I previously sent you whilst I'm on the local network and remotely (via portforwarding) and the app crashes regardless EDIT: spelling

alextran1502 commented 2 years ago

@boffnoff I will try to record a video with the same length and upload it to see if this is an issue with a large video file.

Klutronic commented 2 years ago

@boffnoff You can actually grab logs from your iPhone if you connect to a Windows machine through USB and use a took called iTools. The trial worked just fine for me to grab the logs.

boffnoff commented 2 years ago

Thanks @Klutronic for the headsup, the log file is pretty long and couldn't see a way to filter out all the background rubbish... @alextran1502 checkout the log here: immich iTools log.txt

Klutronic commented 2 years ago

@Klutronic Thank you, this is an infrastructure issue, let's open a new one to focus on that.

Are you ready to work on the "through a reverse proxy off the network" issue or is that something you want to wait on? I can create the issue if you want me to.

alextran1502 commented 2 years ago

Some update on this issue, this is probably a memory error when the app tries to read a large file into RAM. I will update once I've come up with a solution