immich-app / immich

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

[BUG] iOS app stuck on upload for same jpg #1349

Closed marleyjaffe closed 4 months ago

marleyjaffe commented 1 year ago

Describe the bug The iOS app has been stuck uploading the same image. I can tell it is the same image based on its FileName and ID. Canceling the backup, quitting the app, Logging out/in to the app, switching from LAN IP to WAN URL, with & without foreground backup selected, and rebooting my phone all generate the same result; the list of remainder items temporarily increases, then the uploading file quickly goes through multiple images and stops at this image with the remaining item count returning to 8783. I have attempted to let it sit on this same image for +10hrs along with other sessions of various length but the issue remains.

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

To Reproduce Steps to reproduce the behavior:

  1. Open App
  2. Go to backup
  3. Click Start Backup
  4. Watch items backup and then stop on the same ID with the same Remaining item count as before.

Expected behavior Expect the app to successfully upload this image and move on to remaining photos. If item has an issue, expect it to list it as failed.

Screenshots Screenrecording of issue

System

Additional context

DOCKER COMPOSE

version: "3.7"

networks:
  t2_proxy:
    external:
      name: t2_proxy
  immich:
  socket_proxy:
    external:
      name: socket_proxy

services:
  immich-server:
    container_name: immich_server
    image: altran1502/immich-server:release
    entrypoint: ["/bin/sh", "./start-server.sh"]
    networks:
      - t2_proxy
      - immich
      - socket_proxy
    labels:
      traefik.enable: "true"
      ## HTTP Routers
      traefik.http.routers.immich-api-rtr.entrypoints: "https"
      traefik.http.routers.immich-api-rtr.rule: "Host(`immich.HOSTNAME`) && Pathprefix(`/api`)"
      traefik.http.routers.immich-api-rtr.middlewares: service-immich-api-strip
      ## Middlewares
      traefik.http.middlewares.service-immich-api-strip.stripprefix.prefixes: "/api"
      ## HTTP Services
      traefik.http.routers.immich-api-rtr.service: immich-api-svc
      traefik.http.services.immich-api-svc.loadbalancer.server.port: "3001"
    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"]
    networks:
      - immich
      - socket_proxy
    dns:
      - '1.1.1.1'
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  #MachineLearning container not working
  immich-machine-learning:
    container_name: immich_machine_learning
    # image: altran1502/immich-machine-learning:release
    image: bertmelis1/immich-machine-learning-noavx:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    networks:
      - immich
      - socket_proxy
    dns:
      - "1.1.1.1"
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    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
    networks:
      - t2_proxy
      - immich
      - socket_proxy
    environment:
      # Rename these values for svelte public interface
      - PUBLIC_IMMICH_SERVER_URL=${IMMICH_SERVER_URL}
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.immich-web-rtr.entrypoints=https"
      - "traefik.http.routers.immich-web-rtr.rule=Host(`immich.HOSTNAME`)"
      # - "traefik.http.routers.immich-web-rtr.tls=true"
      ## Middlewares
      - "traefik.http.routers.immich-web-rtr.middlewares=chain-authelia@file"
      ## HTTP Services
      - "traefik.http.routers.immich-web-rtr.service=immich-web-svc"
      - "traefik.http.services.immich-web-svc.loadbalancer.server.port=3000"
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    networks:
      - immich
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    networks:
      - immich
    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

# Only using for local connections
  immich-proxy:
    container_name: immich_proxy
    image: altran1502/immich-proxy:release
    env_file:
      - .env
    networks:
      - immich
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - $IMMICH_WEBPORT_PORT:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

volumes:
  pgdata:

.env

###################################################################################
# Database
###################################################################################

DB_HOSTNAME=REPLACED
DB_USERNAME=REPLACED
DB_PASSWORD=REPLACED
DB_DATABASE_NAME=REPLACED

# 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=REPLACED

###################################################################################
# JWT SECRET
#
# This JWT_SECRET is used to sign the authentication keys for user login
# You should set it to a long randomly generated value
# You can use this command to generate one: openssl rand -base64 128
###################################################################################

JWT_SECRET=REPLACED

###################################################################################
# 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=1

####################################################################################
# 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

# Prevent port conflict with other docker containers. Only used for LAN connections
IMMICH_WEBPORT_PORT=REPLACED

Relevant traefik compose file

networks:
  t2_proxy:
    external:
      name: t2_proxy
  default:
    driver: bridge
  socket_proxy:
    external:
      name: socket_proxy
traefik:
    container_name: traefik
    image: traefik:chevrotin # the chevrotin tag refers to v2.2.x
    restart: unless-stopped
    command: # CLI arguments
      - --global.checkNewVersion=true
      - --global.sendAnonymousUsage=true
      - --entryPoints.http.address=:80
      - --entryPoints.https.address=:443
      # Allow these IPs to set the X-Forwarded-* headers - Cloudflare IPs: https://www.cloudflare.com/ips/
      - --entrypoints.https.forwardedHeaders.trustedIPs=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/12,172.64.0.0/13,131.0.72.0/22
      - --entryPoints.traefik.address=:8080
      - --api=true
      # - --api.insecure=true
      - --serversTransport.insecureSkipVerify=true
      - --log=true
      - --log.level=WARN # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
      - --accessLog=true
      - --accessLog.filePath=/traefik.log
      - --accessLog.bufferingSize=100 # Configuring a buffer of 100 lines
      - --accessLog.filters.statusCodes=400-499
      - --providers.docker=true
      # - --providers.docker.endpoint=unix:///var/run/docker.sock # Use Docker Socket Proxy instead for improved security
      - --providers.docker.endpoint=tcp://socket-proxy:2375
      # - --providers.docker.defaultrule=HostHeader(`{{ index .Labels "com.docker.compose.service" }}.$DOMAINNAME`)
      - --providers.docker.exposedByDefault=false
      # - --entrypoints.https.http.middlewares=chain-authelia@file
      # Add dns-cloudflare as default certresolver for all services. Also enables TLS and no need to specify on individual services
      - --entrypoints.https.http.tls.certresolver=dns-cloudflare
      - --entrypoints.https.http.tls.domains[0].main=$DOMAINNAME
      - --entrypoints.https.http.tls.domains[0].sans=*.$DOMAINNAME
      # - --entrypoints.https.http.tls.domains[1].main=$DOMAIN # Pulls main cert for second domain
      # - --entrypoints.https.http.tls.domains[1].sans=*.$DOMAIN # Pulls wildcard cert for second domain
      - --providers.docker.network=t2_proxy
      - --providers.docker.swarmMode=false
      - --providers.file.directory=/rules # Load dynamic configuration from one or more .toml or .yml files in a directory
      # - --providers.file.filename=/path/to/file # Load dynamic configuration from a file
      - --providers.file.watch=true # Only works on top level files in the rules folder
#      - --certificatesResolvers.dns-cloudflare.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory # LetsEncrypt Staging Server - uncomment when testing
      - --certificatesResolvers.dns-cloudflare.acme.email=$CLOUDFLARE_EMAIL
      - --certificatesResolvers.dns-cloudflare.acme.storage=/acme.json
      - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.provider=cloudflare
      - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53
      - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.delayBeforeCheck=90 # To delay DNS check and reduce LE hitrate
    networks:
      t2_proxy:
        ipv4_address: REPLACED # You can specify a static IP
      # networks:
      #   - t2_proxy
      socket_proxy:
    depends_on:
      - socket-proxy
    security_opt:
      - no-new-privileges:true
    ports:
      # https://www.reddit.com/r/docker/comments/c1wrep/traefik_reverse_proxy_question_docker_overlay/
      - target: 80
        published: 80
        protocol: tcp
        mode: host
      - target: 443
        published: 443
        protocol: tcp
        mode: host
      # - target: 8080
      #   published: 8080
      #   protocol: tcp
      #   mode: host
    volumes:
      - $DOCKERDIR/traefik2/rules:/rules # file provider directory
      # - /var/run/docker.sock:/var/run/docker.sock:ro # Use Docker Socket Proxy instead for improved security
      - $DOCKERDIR/traefik2/acme/acme.json:/acme.json # cert location - you must touch this file and change permissions to 600
      - $DOCKERDIR/traefik2/traefik.log:/traefik.log # for fail2ban - make sure to touch file before starting container
      - $DOCKERDIR/shared:/shared
    environment:
      - CF_API_EMAIL_FILE=/run/secrets/cloudflare_email
      - CF_API_KEY_FILE=/run/secrets/cloudflare_api_key
    secrets:
      - cloudflare_email
      - cloudflare_api_key
    labels:
      - "traefik.enable=true"
      # HTTP-to-HTTPS Redirect
      - "traefik.http.routers.http-catchall.entrypoints=http"
      - "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
      # HTTP Routers
      - "traefik.http.routers.traefik-rtr.entrypoints=https"
      - "traefik.http.routers.traefik-rtr.rule=HostHeader(`traefik.$DOMAINNAME`)"
      - "traefik.http.routers.traefik-rtr.tls=true"
      # Remove after root cert created
#      - "traefik.http.routers.traefik-rtr.tls.certresolver=dns-cloudflare" # Comment out this line after first run of traefik to force the use of wildcard certs
      - "traefik.http.routers.traefik-rtr.tls.domains[0].main=$DOMAINNAME"
      - "traefik.http.routers.traefik-rtr.tls.domains[0].sans=*.$DOMAINNAME"
#      - "traefik.http.routers.traefik-rtr.tls.domains[1].main=$SECONDDOMAINNAME" # Pulls main cert for second domain
#      - "traefik.http.routers.traefik-rtr.tls.domains[1].sans=*.$SECONDDOMAINNAME" # Pulls wildcard cert for second domain

      ## Services - API
      - "traefik.http.routers.traefik-rtr.service=api@internal"
      ## Middlewares
      - "traefik.http.routers.traefik-rtr.middlewares=chain-authelia@file" 

  # Traefik - Custom Error Pages
  traefik-error-pages:
    container_name: traefik-error-pages
    image: guillaumebriday/traefik-custom-error-pages
    restart: unless-stopped
    networks:
      - t2_proxy
    labels:
      - "traefik.enable=true"
      # HTTP Routers
      - "traefik.http.routers.traefik-error-pages-rtr.entrypoints=https"
      - "traefik.http.routers.traefik-error-pages-rtr.rule=HostRegexp(`{host:.+}`)"
      - "traefik.http.routers.traefik-error-pages-rtr.priority=1"
      # Middlewares
      - "traefik.http.routers.traefik-error-pages-rtr.middlewares=traefik-error-pages"
      - "traefik.http.middlewares.traefik-error-pages.errors.service=traefik-error-pages-svc"
      - "traefik.http.middlewares.traefik-error-pages.errors.status=401,403,404,429,500,502,503"
      - "traefik.http.middlewares.traefik-error-pages.errors.query=/{status}.html"
      # HTTP Services
      - "traefik.http.routers.traefik-error-pages-rtr.service=traefik-error-pages-svc"
      - "traefik.http.services.traefik-error-pages-svc.loadbalancer.server.port=80"

  # Docker Socket Proxy - Security Enchanced Proxy for Docker Socket
  socket-proxy:
    container_name: socket-proxy
    image: fluencelabs/docker-socket-proxy
    restart: always
    networks:
      # t2_proxy:
      socket_proxy:
        ipv4_address: 192.168.20.254 # You can specify a static IP
    privileged: true
    ports:
      - "2375:2375"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - LOG_LEVEL=info # debug,info,notice,warning,err,crit,alert,emerg
      ## Variables match the URL prefix (i.e. AUTH blocks access to /auth/* parts of the API, etc.).
      # 0 to revoke access.
      # 1 to grant access.
      ## Granted by Default
      - EVENTS=1
      - PING=1
      - VERSION=1
      ## Revoked by Default
      # Security critical
      - AUTH=0
      - SECRETS=0
      - POST=1 # Watchtower
      - DELETE=1 # Watchtower
        # GET Optons
      - BUILD=0
      - COMMIT=0
      - CONFIGS=0
      - CONTAINERS=1 # Traefik, portainer, etc.
      - DISTRIBUTION=0
      - EXEC=0
      - IMAGES=1 # Portainer, Watchtower
      - INFO=1 # Portainer
      - NETWORKS=1 # Portainer, Watchtower
      - NODES=0
      - PLUGINS=0
      - SERVICES=1 # Portainer
      - SESSION=0
      - SWARM=0
      - SYSTEM=0
      - TASKS=1 # Portaienr
      - VOLUMES=1 # Portainer
      # POST Options
      - CONTAINERS_CREATE=1 # WatchTower
      - CONTAINERS_START=1 # WatchTower
      - CONTAINERS_UPDATE=1 # WatchTower
      # DELETE Options
      - CONTAINERS_DELETE=1 # WatchTower
      - IMAGES_DELETE=1 # WatchTower
marleyjaffe commented 1 year ago

Screenshot of iOS logs as export functionality to CSV not working as expected. image

alextran1502 commented 1 year ago

Can you help track down the image? looks like it is created on July 3rd, 2021. It could be a corrupted image that causes problems.

marleyjaffe commented 1 year ago

I do not see this image in my photos app or in the Immich app. The the file name indicates that this photo came from another device and was not taken directly on my phone (a following photo is a group photo). What else can I do to help troubleshoot?

alextran1502 commented 1 year ago

Would it be possible you have those photos/videos on iCloud and not on your local device. Immich only support backup photos and videos that is existed on the device

marleyjaffe commented 1 year ago

I do not pay for iCloud, I just checked my iCloud settings and Sync this iPhone is turned off. I do have iCloud photos enabled for My Photo Stream and Shared Albums however it is reporting as only 20MB of Photo & Videos.

This is a new iPhone relative to the issue photo. My photos were imported via a backup/restore, however I did not utilize the iCloud Photo function on the previous device either. Perhaps there was a backup/restore corruption issue?

alextran1502 commented 1 year ago

I would say so. Do you know how many assets you have physically on the device?

marleyjaffe commented 1 year ago

According to my iOS settings, I have a combined 23,887 photos/videos. This number is less than the 24,701 assets Immich has uploaded...

marleyjaffe commented 1 year ago

Curiously, I see that most all images older than this errored photo have been uploaded, but a few random new photos taken in the last few days are still not uploaded. Scrolling through my Immich library, I have found other random images and videos that the Immich app can display/play that have not been uploaded. They are scattered and I have not found a grouping yet.

suntribe commented 1 year ago

I'm also facing the exact same behavior on my wife's phone - upload regularly stops at the same file, non-uploaded files are scattered without any order so i can't figure out what might be causing it, etc. Where can I see the screen with logs? I can't seem to find it anywhere (i have the testflight version installed)... Also, I've looked throughout the docker containers' logs but nothing too helpful there...

alextran1502 commented 1 year ago

Yeah usually if the file isn't uploaded, it means it is on iCloud or in a shared album. I will take a look at this issue at a later time.

kaytwo commented 1 year ago

I believe I'm having a similar / the same issue (with local photos, icloud turned off) - I was able to get the app built locally and tested with a local (docker desktop) dev server, but then there's a lot of inconsistency - the mobile app is very out of sync with the web view, many images are missing, and everything shown on the mobile app has the "unsynced" badge.

If there's any additional debugging tasks I can do to help let me know, the interesting looking errors I'm seeing in the flutter logs are:

2023-02-07 14:49:26.533359-0600 Runner[6099:2394790] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: 'package:openapi/model/asset_response_dto.dart': Failed assertion: line 199 pos 18: 'json.containsKey(key)': Required key "AssetResponseDto[updatedAt]" is missing from JSON.
stack trace: ``` #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) #2 AssetResponseDto.fromJson.. (package:openapi/model/asset_response_dto.dart:199:18) #3 SetMixin.forEach (dart:collection/set.dart:142:30) #4 AssetResponseDto.fromJson. (package:openapi/model/asset_response_dto.dart:198:22) #5 AssetResponseDto.fromJson (package:openapi/model/asset_response_dto.dart:203:8) #6 WebsocketNotifier._handleOnUploadSuccess (package:immich_mobile/shared/providers/websocket.provider.dart:124:34) #7 EventEmitter.emit. (package:socket_io_common/src/util/event_emitter.dart:61:14) #8 List.forEach (dart:core-patch/growable_array.dart:416:8) #9 EventEmitter.emit (package:socket_io_common/src/util/event_emitter.dart:60:11) #10 Function._apply (dart:core-patch/function_patch.dart:11:73) #11 Function.apply (dart:core-patch/function_patch.dart:34:12) #12 Socket.onevent (package:socket_io_client/src/socket.dart:308:18) #13 Socket.onpacket (package:socket_io_client/src/socket.dart:264:9) #14 EventEmitter.emit. (package:socket_io_common/src/util/event_emitter.dart:61:14) #15 List.forEach (dart:core-patch/growable_array.dart:416:8) #16 EventEmitter.emit (package:socket_io_common/src/util/event_emitter.dart:60:11) #17 Manager.ondecoded (package:socket_io_client/src/manager.dart:253:5) #18 EventEmitter.emit. (package:socket_io_common/src/util/event_emitter.dart:61:14) #19 List.forEach (dart:core-patch/growable_array.dart:416:8) #20 EventEmitter.emit (package:socket_io_common/src/util/event_emitter.dart:60:11) #21 Decoder.add (package:socket_io_common/src/parser/parser.dart:160:14) #22 Manager.ondata (package:socket_io_client/src/manager.dart:244:13) #23 EventEmitter.emit. (package:socket_io_common/src/util/event_emitter.dart:61:14) #24 List.forEach (dart:core-patch/growable_array.dart:416:8) #25 EventEmitter.emit (package:socket_io_common/src/util/event_emitter.dart:60:11) #26 Socket.onPacket (package:socket_io_client/src/engine/socket.dart:463:11) #27 Socket.setTransport. (package:socket_io_client/src/engine/socket.dart:287:34) #28 EventEmitter.emit. (package:socket_io_common/src/util/event_emitter.dart:61:14) #29 List.forEach (dart:core-patch/growable_array.dart:416:8) #30 EventEmitter.emit (package:socket_io_common/src/util/event_emitter.dart:60:11) #31 Transport.onPacket (package:socket_io_client/src/engine/transport/transport.dart:127:5) #32 Transport.onData (package:socket_io_client/src/engine/transport/transport.dart:121:5) #33 IOWebSocketTransport.addEventListeners. (package:socket_io_client/src/engine/transport/io_websocket_transport.dart:67:7) #34 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10) #35 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) #36 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7) #37 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19) #38 _StreamController._add (dart:async/stream_controller.dart:648:7) #39 _StreamController.add (dart:async/stream_controller.dart:596:5) #40 new _WebSocketImpl._fromSocket. (dart:_http/websocket_impl.dart:1144:21) #41 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10) #42 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) #43 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7) #44 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11) #45 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11) #46 _WebSocketProtocolTransformer._messageFrameEnd (dart:_http/websocket_impl.dart:332:23) #47 _WebSocketProtocolTransformer.add (dart:_http/websocket_impl.dart:226:46) #48 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24) #49 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10) #50 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) #51 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7) #52 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19) #53 _StreamController._add (dart:async/stream_controller.dart:648:7) #54 _StreamController.add (dart:async/stream_controller.dart:596:5) #55 _Socket._onData (dart:io-patch/socket_patch.dart:2324:41) #56 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10) #57 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) #58 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7) #59 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19) #60 _StreamController._add (dart:async/stream_controller.dart:648:7) #61 _StreamController.add (dart:async/stream_controller.dart:596:5) #62 new _RawSocket. (dart:io-patch/socket_patch.dart:1849:33) #63 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14) #64 _microtaskLoop (dart:async/schedule_microtask.dart:40:21) #65 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5) ```

as well as:

2023-02-07 14:49:04.445493-0600 Runner[6099:2394790] flutter: Error [getServerInfo] Null check operator used on a null value

repeated several times shortly before a backup completed. In this testing environment, everything is showing up with the "not synced" badge,

got this error during login:


2023-02-07 14:59:47.857067-0600 Runner[6099:2394790] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Tried to use BackupNotifier after `dispose` was called.

Consider checking `mounted`.

#0      StateNotifier._debugIsMounted.<anonymous closure> (package:state_notifier/state_notifier.dart:175:9)
#1      StateNotifier._debugIsMounted (package:state_notifier/state_notifier.dart:182:6)
#2      StateNotifier.state (package:state_notifier/state_notifier.dart:196:12)
#3      BackupNotifier._getBackupAlbumsInfo (package:immich_mobile/modules/backup/providers/backup.provider.dart:223:13)
<asynchronous suspension>
#4      BackupNotifier.getBackupInfo (package:immich_mobile/modules/backup/providers/backup.provider.dart:396:7)
<asynchronous suspension>

and also:

2023-02-07 15:06:30.698718-0600 Runner[6099:2394790] flutter: Established Websocket Connection
2023-02-07 15:06:30.775105-0600 Runner[6099:2394790] flutter: [SEVERE] [2023-02-07 15:06:30.774968] Error while getting remote assets
2023-02-07 15:06:30.815777-0600 Runner[6099:2394790] flutter: [INFO] [2023-02-07 15:06:30.815646] Load assets: 133ms
2023-02-07 15:06:30.853853-0600 Runner[6099:2394790] flutter: [INFO] [2023-02-07 15:06:30.853743] Combining assets: 37ms
2023-02-07 15:06:31.688750-0600 Runner[6099:2394790] flutter: _getBackupAlbumsInfo takes 1075ms
alextran1502 commented 1 year ago

@kaytwo

For 2023-02-07 14:49:26.533359-0600 Runner[6099:2394790] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: 'package:openapi/model/asset_response_dto.dart': Failed assertion: line 199 pos 18: 'json.containsKey(key)': Required key "AssetResponseDto[updatedAt]" is missing from JSON. - go in openapi/model/asset_response_dto.dart and commented out the line below:

image

Then you can run.

If you see any errors different than the error above, please let me know. The errors messages you reported are normal and can be ignored.

Please start the upload process and see if any errors come up.

Additionally, you can now check the thumbnail of the file being uploaded by clicking on the icon below.

https://user-images.githubusercontent.com/27055614/217374571-4b22c302-156d-4c5c-a9d6-5b174bdd26e8.mov

kaytwo commented 1 year ago

I didn't end up finding much but I believe I found the underlying issue - I was using a free tier cloudflare tunnel, and uploads larger than 100mb fail without creative upload chunking/resuming. Because this appears to be a somewhat common use case it might be worth mentioning in the docs.

suntribe commented 1 year ago

i agree about cf and their upload limit to 100mb but for me that isn’t the case as i route all my local traffic (when connected to my local wifi) directly to the host itself (even putting the local ip and port) so can’t say i’m affected by cf… something else seems to be the issue just haven’t found anything in the logs that might point me in the right direction…

is there any option to turn on some heavy debug logs?

LordVaderXIII commented 1 year ago

I didn't end up finding much but I believe I found the underlying issue - I was using a free tier cloudflare tunnel, and uploads larger than 100mb fail without creative upload chunking/resuming. Because this appears to be a somewhat common use case it might be worth mentioning in the docs.

@kaytwo Did you upgrade your tunnel to a paid version or did you find another way around it? If you did, which version did you go to? I might be having the same issue.

wynsto commented 10 months ago

same issue

duguying commented 8 months ago

maybe you should check you server, check the http status code 413, 403, etc...

Zk2u commented 8 months ago

Experiencing this with two large video files

alextran1502 commented 8 months ago

@617a7a Are you using reverse proxy? Can you try on local IP to see if it can upload successfully?

Zk2u commented 8 months ago

Yeah that sounds like a dumb mistake I've made. I am using reverse proxy. Maybe need to adjust the settings on it?

diggles commented 6 months ago

@alextran1502 thanks for the reminder, can't believe I didn't think of that for anyone else using nginx reverse proxy the default max request size is 1mb which explains the random looking successful uploads; images under 1mb get uploaded fine.

For future reference just drop a client_max_body_size 2048M; (or set an appropriate limit, I set mine to 2gb as some video files get close to that) in your conf file for the server handling immich.

nginx returns a 413 error when an upload exceeds the limit, be useful to see that in the app log (if it's not already there, I didn't see it with "Fine" log level)