Fail to upload files according cli #4827

Closed
opened 2026-02-20 03:10:55 -05:00 by deekerman · 2 comments
Owner

Originally created by @hanamichigogogo on GitHub (Feb 1, 2025).

The bug

Hi developer,
Failed with following error message hen try to use cli upload jpg according cli.
d:\Pictures>npm -i -g @immich/cli
Unknown command: "@immich/cli"

To see a list of supported npm commands, run:
npm help

d:\Pictures>npm i -g @immich/cli

changed 20 packages in 23s

3 packages are looking for funding
run npm fund for details

d:\Pictures>immich upload d:\Pictures\deed34539d67a1d7ba003e1a9004888b.jpg
Crawling for assets...
file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821
extensions: [...image, ...video]
^

TypeError: image is not iterable
at scan (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async upload (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17803:21)

Node.js v20.13.1

The OS that Immich Server is running on

uname -a Linux 6d21f460344d 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux

Version of Immich Server

v1.125.7

Version of Immich Mobile App

v1.0.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#
name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.dockerproxy.net/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${PHOTO_LOCATION}:/extlib
    env_file:
      - .env
    ports:
      - '2279:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: true

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.dockerproxy.net/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    environment:
      - HF_ENDPOINT:https://hf-mirror.com
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: true

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
    # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1;
        Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align
        --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')";
        echo "checksum failure count is $$Chksum";
        [ "$$Chksum" = '0' ] || exit 1
    command: >-
      postgres
      -c shared_preload_libraries=vectors.so
      -c 'search_path="$$user", public, vectors'
      -c logging_collector=on
      -c max_wal_size=2GB
      -c shared_buffers=512MB
      -c wal_compression=on
    restart: always

volumes:
  model-cache:

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/cache/appdata/immich/library
UPLOAD_LOCATION=./library
# The location where your database files are stored
#/mnt/cache/appdata/immich/postgres
DB_DATA_LOCATION=./postgres

# External storage for media files
PHOTO_LOCATION=D:\Pictures
# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

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

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

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

Reproduction steps

in Win 10 docer host
immich login-key http://127.0.0.1:2279//api keyValue
immich upload --album --recursive d:/pictures
or in immich host
immich login-key http://localhost:2283//api keyValue
immich upload --album --recursive /extlib

will show same error message.

Relevant log output

d:\Pictures>npm i -g @immich/cli

changed 20 packages in 23s

3 packages are looking for funding
  run `npm fund` for details

d:\Pictures>immich upload d:\Pictures\deed34539d67a1d7ba003e1a9004888b.jpg
Crawling for assets...
file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821
    extensions: [...image, ...video]
                    ^

TypeError: image is not iterable
    at scan (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async upload (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17803:21)

Node.js v20.13.1

d:\Pictures>

Additional information

with same error message show.

Originally created by @hanamichigogogo on GitHub (Feb 1, 2025). ### The bug Hi developer, Failed with following error message hen try to use cli upload jpg according cli. d:\Pictures>npm -i -g @immich/cli Unknown command: "@immich/cli" To see a list of supported npm commands, run: npm help d:\Pictures>npm i -g @immich/cli changed 20 packages in 23s 3 packages are looking for funding run `npm fund` for details d:\Pictures>immich upload d:\Pictures\deed34539d67a1d7ba003e1a9004888b.jpg Crawling for assets... file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821 extensions: [...image, ...video] ^ TypeError: image is not iterable at scan (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821:21) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async upload (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17803:21) Node.js v20.13.1 ### The OS that Immich Server is running on # uname -a Linux 6d21f460344d 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux ### Version of Immich Server v1.125.7 ### Version of Immich Mobile App v1.0.0 ### Platform with the issue - [x] Server - [x] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: immich-server: container_name: immich_server image: ghcr.dockerproxy.net/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding volumes: # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - ${PHOTO_LOCATION}:/extlib env_file: - .env ports: - '2279:2283' depends_on: - redis - database restart: always healthcheck: disable: true immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.dockerproxy.net/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - model-cache:/cache environment: - HF_ENDPOINT:https://hf-mirror.com env_file: - .env restart: always healthcheck: disable: true redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8 healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: test: >- pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1 command: >- postgres -c shared_preload_libraries=vectors.so -c 'search_path="$$user", public, vectors' -c logging_collector=on -c max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on restart: always volumes: model-cache: ``` ### Your .env content ```Shell # 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/cache/appdata/immich/library UPLOAD_LOCATION=./library # The location where your database files are stored #/mnt/cache/appdata/immich/postgres DB_DATA_LOCATION=./postgres # External storage for media files PHOTO_LOCATION=D:\Pictures # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps in Win 10 docer host immich login-key http://127.0.0.1:2279//api keyValue immich upload --album --recursive d:/pictures or in immich host immich login-key http://localhost:2283//api keyValue immich upload --album --recursive /extlib will show same error message. ### Relevant log output ```shell d:\Pictures>npm i -g @immich/cli changed 20 packages in 23s 3 packages are looking for funding run `npm fund` for details d:\Pictures>immich upload d:\Pictures\deed34539d67a1d7ba003e1a9004888b.jpg Crawling for assets... file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821 extensions: [...image, ...video] ^ TypeError: image is not iterable at scan (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17821:21) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async upload (file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:17803:21) Node.js v20.13.1 d:\Pictures> ``` ### Additional information with same error message show.
Author
Owner

@hanamichigogogo commented on GitHub (Feb 2, 2025):

seems issues fixed.
when try to use IP: 172.0.0.1 fail
but success using : 172.19.112.1 < an vEthernet (WSL) IP address.

btw , both these two IP can access to container immich web
dont know why...

C:\Users\Administrator>immich login-key http://172.19.112.1:2279/api
Logging in to http://172.19.112.1:2279/api
Logged in as 1@1.com
Wrote auth info to C:\Users\Administrator.config\immich\auth.yml

C:\Users\Administrator>immich server-info
Server Info (via 1@1.com)
Url: http://172.19.112.1:2279/api
Version: 1.125.7
Formats:
Images: 3fr,ari,arw,cap,cin,cr2,cr3,crw,dcr,dng,erf,fff,iiq,k25,kdc,mrw,nef,nrw,orf,ori,pef,psd,raf,raw,rw2,rwl,sr2,srf,srw,x3f,avif,bmp,gif,heic,heif,hif,insp,jp2,jpe,jpeg,jpg,jxl,png,svg,tif,tiff,webp
Videos: 3gp,3gpp,avi,flv,insv,m2t,m2ts,m4v,mkv,mov,mp4,mpe,mpeg,mpg,mts,vob,webm,wmv
Statistics:
Images: 0
Videos: 0
Total: 0

C:\Users\Administrator>immich upload --album --recursive d:/pictures
Crawling for assets...
Hashing files | ████████████████████████████████████████ | 100% | ETA: 0s | 10/10 assets
Checking for duplicates | ████████████████████████████████████████ | 100% | ETA: 0s | 10/10 assets
Found 4 new files and 6 duplicates
Uploading assets | ████████████████████████████████████████ | 100% | ETA: 0s | 1.7 MB/1.7 MB
Successfully uploaded 4 new assets (1.7 MB)
Creating albums | ████████████████████████████████████████ | 100% | ETA: 0s | 3/3 albums
Successfully created 3 new albums
Successfully updated 10 assets
Adding assets to albums | ████████████████████████████████████████ | 100% | ETA: 0s | 10/10 assets

C:\Users\Administrator>

C:\Users\Administrator>immich server-info
Server Info (via undefined)
Url: http://127.0.0.1:2279//api
Version: undefined.undefined.undefined
Formats:
file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:18130
console.log( Images: ${mediaTypes.image.map((extension) => extension.replace(".", ""))});

@hanamichigogogo commented on GitHub (Feb 2, 2025): seems issues fixed. when try to use IP: 172.0.0.1 fail but success using : 172.19.112.1 < an vEthernet (WSL) IP address. btw , both these two IP can access to container immich web dont know why... C:\Users\Administrator>immich login-key http://172.19.112.1:2279/api <API Key> Logging in to http://172.19.112.1:2279/api Logged in as 1@1.com Wrote auth info to C:\Users\Administrator\.config\immich\auth.yml C:\Users\Administrator>immich server-info Server Info (via 1@1.com) Url: http://172.19.112.1:2279/api **Version: 1.125.7** Formats: Images: 3fr,ari,arw,cap,cin,cr2,cr3,crw,dcr,dng,erf,fff,iiq,k25,kdc,mrw,nef,nrw,orf,ori,pef,psd,raf,raw,rw2,rwl,sr2,srf,srw,x3f,avif,bmp,gif,heic,heif,hif,insp,jp2,jpe,jpeg,jpg,jxl,png,svg,tif,tiff,webp Videos: 3gp,3gpp,avi,flv,insv,m2t,m2ts,m4v,mkv,mov,mp4,mpe,mpeg,mpg,mts,vob,webm,wmv Statistics: Images: 0 Videos: 0 Total: 0 C:\Users\Administrator>immich upload --album --recursive d:/pictures Crawling for assets... Hashing files | ████████████████████████████████████████ | 100% | ETA: 0s | 10/10 assets Checking for duplicates | ████████████████████████████████████████ | 100% | ETA: 0s | 10/10 assets Found 4 new files and 6 duplicates Uploading assets | ████████████████████████████████████████ | 100% | ETA: 0s | 1.7 MB/1.7 MB Successfully uploaded 4 new assets (1.7 MB) Creating albums | ████████████████████████████████████████ | 100% | ETA: 0s | 3/3 albums Successfully created 3 new albums Successfully updated 10 assets Adding assets to albums | ████████████████████████████████████████ | 100% | ETA: 0s | 10/10 assets C:\Users\Administrator> C:\Users\Administrator>immich server-info Server Info (via undefined) Url: http://127.0.0.1:2279//api **Version: undefined.undefined.undefined** Formats: file:///C:/Users/Administrator/AppData/Roaming/npm/node_modules/@immich/cli/dist/index.js:18130 console.log(` Images: ${mediaTypes.image.map((extension) => extension.replace(".", ""))}`);
Author
Owner

@danieldietzler commented on GitHub (Apr 3, 2025):

In your last call you can see that you have two slashes after the port. Nothing about this is a bug with the cli.

@danieldietzler commented on GitHub (Apr 3, 2025): In your last call you can see that you have two slashes after the port. Nothing about this is a bug with the cli.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#4827
No description provided.