[BUG] Import using Immich-cli failed #746

Closed
opened 2026-02-04 22:17:14 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @alberto8051 on GitHub (Mar 14, 2023).

The bug

I tried to import serveral photos using immich-cli with a tiny shell script which works fine until version 1.37. About two o three weeks ago, the import proccess start to completly failed. I get this error response

Failed to upload 21 files [
{
file: '/import/DSC_3049.JPG',
reason: Error: Request failed with status code 400
at createError (/usr/src/app/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/src/app/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/src/app/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
config: [Object],
request: [ClientRequest],
response: [Object],
isAxiosError: true,
toJSON: [Function: toJSON]
},
response: { statusCode: 400, message: [Array], error: 'Bad Request' }
},
{
file: '/import/DSC_3046.JPG',
reason: Error: Request failed with status code 400
at createError (/usr/src/app/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/src/app/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/src/app/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
config: [Object],
request: [ClientRequest],
response: [Object],
isAxiosError: true,
toJSON: [Function: toJSON]
},
response: { statusCode: 400, message: [Array], error: 'Bad Request' }
},

I got this message for each file I try to upload. I installed immich using portainer. I running Immich in an old Intel Atom with 2 Gb RAM / 9 Gb SWAP and Openmediavault as NAS Software, so I'm using bartmelis machine learning.

The OS that Immich Server is running on

Debian 11

Version of Immich Server

V1.50.1

Version of Immich Mobile App

V1.50.0 build 72

Platform with the issue

  • Server
  • Web
  • Mobile

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:
      - stack.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:
      - stack.env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: bertmelis1/immich-machine-learning-noavx:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.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:
      - stack.env
    environment:
      # Rename these values for svelte public interface
      - PUBLIC_IMMICH_SERVER_URL=${IMMICH_SERVER_URL}
    restart: always

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

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

Your .env content

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/srv/dev-disk-by-uuid-04f2e2dd-2612-45f9-9ecb-3586fc03aac4/immich-backup
JWT_SECRET=strongpasswordnobodycanguess
PUBLIC_LOGIN_PAGE_MESSAGE="Bienvenido a Immich en Trantor."
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

Reproduction steps

1.Just execute the shell-script below 
2.
3.
...

Additional information

This is the shell-script i'm using for import each folder in a path.

#! /bin/bash
for DIR in $(ls "$(pwd)"/immich-import)
do
echo "Importando " $DIR
docker run -it --rm -v "$(pwd)"/immich-import/$DIR:/import ghcr.io/immich-app/immich-cli:latest upload --key [KeyForMyUser] --delete --threads 2 --server http://192.168.1.20:2283/api --yes
echo
echo
done
echo "Proceso finalizado"

Originally created by @alberto8051 on GitHub (Mar 14, 2023). ### The bug I tried to import serveral photos using immich-cli with a tiny shell script which works fine until version 1.37. About two o three weeks ago, the import proccess start to completly failed. I get this error response > Failed to upload 21 files [ { file: '/import/DSC_3049.JPG', reason: Error: Request failed with status code 400 at createError (/usr/src/app/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/src/app/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/src/app/node_modules/axios/lib/adapters/http.js:322:11) at IncomingMessage.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { config: [Object], request: [ClientRequest], response: [Object], isAxiosError: true, toJSON: [Function: toJSON] }, response: { statusCode: 400, message: [Array], error: 'Bad Request' } }, { file: '/import/DSC_3046.JPG', reason: Error: Request failed with status code 400 at createError (/usr/src/app/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/src/app/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/src/app/node_modules/axios/lib/adapters/http.js:322:11) at IncomingMessage.emit (node:events:539:35) at endReadableNT (node:internal/streams/readable:1345:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { config: [Object], request: [ClientRequest], response: [Object], isAxiosError: true, toJSON: [Function: toJSON] }, response: { statusCode: 400, message: [Array], error: 'Bad Request' } }, > I got this message for each file I try to upload. I installed immich using portainer. I running Immich in an old Intel Atom with 2 Gb RAM / 9 Gb SWAP and Openmediavault as NAS Software, so I'm using bartmelis machine learning. ### The OS that Immich Server is running on Debian 11 ### Version of Immich Server V1.50.1 ### Version of Immich Mobile App V1.50.0 build 72 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML 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: - stack.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: - stack.env environment: - NODE_ENV=production depends_on: - redis - database restart: always immich-machine-learning: container_name: immich_machine_learning image: bertmelis1/immich-machine-learning-noavx:release entrypoint: ["/bin/sh", "./entrypoint.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - stack.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: - stack.env environment: # Rename these values for svelte public interface - PUBLIC_IMMICH_SERVER_URL=${IMMICH_SERVER_URL} restart: always redis: container_name: immich_redis image: redis:6.2 restart: always database: container_name: immich_postgres image: postgres:14 env_file: - stack.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: ``` ### Your .env content ```Shell DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_PASSWORD=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis UPLOAD_LOCATION=/srv/dev-disk-by-uuid-04f2e2dd-2612-45f9-9ecb-3586fc03aac4/immich-backup JWT_SECRET=strongpasswordnobodycanguess PUBLIC_LOGIN_PAGE_MESSAGE="Bienvenido a Immich en Trantor." IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001 IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 ``` ### Reproduction steps ```bash 1.Just execute the shell-script below 2. 3. ... ``` ### Additional information This is the shell-script i'm using for import each folder in a path. > #! /bin/bash for DIR in $(ls "$(pwd)"/immich-import) do echo "Importando " $DIR docker run -it --rm -v "$(pwd)"/immich-import/$DIR:/import ghcr.io/immich-app/immich-cli:latest upload --key [KeyForMyUser] --delete --threads 2 --server http://192.168.1.20:2283/api --yes echo echo done echo "Proceso finalizado" >
Author
Owner

@bo0tzz commented on GitHub (Mar 14, 2023):

Can you run docker pull ghcr.io/immich-app/immich-cli:latest to make sure you've got the latest version of the cli, and then try again?

@bo0tzz commented on GitHub (Mar 14, 2023): Can you run `docker pull ghcr.io/immich-app/immich-cli:latest` to make sure you've got the latest version of the cli, and then try again?
Author
Owner

@alberto8051 commented on GitHub (Mar 14, 2023):

It works!!!
Thank You.
I have immich installed in a container and I upgraded all the images. I don't know why immich-cli wasn't upgrade. Is immich-cli incluided on any image?

Best Regards
Alberto

@alberto8051 commented on GitHub (Mar 14, 2023): It works!!! Thank You. I have immich installed in a container and I upgraded all the images. I don't know why immich-cli wasn't upgrade. Is immich-cli incluided on any image? Best Regards Alberto
Author
Owner

@bo0tzz commented on GitHub (Mar 14, 2023):

immich-cli is a separate image, so it won't be upgraded when you upgrade the main stack.

@bo0tzz commented on GitHub (Mar 14, 2023): immich-cli is a separate image, so it won't be upgraded when you upgrade the main stack.
Author
Owner

@alberto8051 commented on GitHub (Mar 14, 2023):

Thank you for your comment. I'll keep it in mind.

B. Regards
Alberto

@alberto8051 commented on GitHub (Mar 14, 2023): Thank you for your comment. I'll keep it in mind. B. Regards Alberto
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#746