immich-app / immich

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

[BUG] Immich CLI no longer supports custom album names with `--album` option #6289

Closed SitramSoft closed 7 months ago

SitramSoft commented 8 months ago

The bug

Immich CLI version 2.0.6 no longer supports custom album names with --album option

The OS that Immich Server is running on

Ubuntu 22.04.2 LTS

Version of Immich Server

v1.92.0

Version of Immich Mobile App

v1.92.0 build.117

Platform with the issue

Your docker-compose.yml content

version: "3.9"

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

services:
  #Immich - self hosted photos and videos management application - https://immich.app/
  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
    env_file:
      - .env
    ports:
      - 2283:3001
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    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
    restart: always

#PostgressSQL database with pgvecto.rs extension - https://github.com/tensorchord/pgvecto.rs
  db_postgress:
    container_name: db_postgress
    #image: postgres:14-alpine
    image: tensorchord/pgvecto-rs:pg14-v0.1.11
    user: 1000:1000
    environment:
      - POSTGRES_USER=xx
      - POSTGRES_PASSWORD=xx
    ports:
      - 5432:5432
    volumes:
      - /home/sitram/docker/postgres:/var/lib/postgresql/data:rw
    restart: unless-stopped

#Redis is an open-source, networked, in-memory, key-value data store with optional durability. It is written in ANSI C.- https://hub.docker.com/_/redis
  redis:
    container_name: redis
    image: redis:6.2
    env_file:
      - .env
    user: 1000:1000
    environment:
      - TZ=Europe/Bucharest
    command: redis-server /usr/local/etc/redis/redis.conf
    ports:
      - 6379:6379
    volumes:
      - /home/sitram/docker/redis:/data
      - /home/sitram/docker/redis/config:/usr/local/etc/redis
    restart: unless-stopped

volumes:
  model-cache:

Your .env content

COMPOSE_PROJECT_NAME=serenity_immich

# 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=/home/sitram/data/photos_immich

# 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
DB_PASSWORD=xx

# Timezone
TZ=Europe/Bucharest

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

REDIS_HOSTNAME=xx

Reproduction steps

1. Install/update npm

sudo npm install -g npm
  1. Install/update immich
    sudo npm i -g @immich/cli
  2. Authenticate to Immich server
    immich login-key http://192.168.0.101:2283/api xxxxxx
  3. Upload a folder with and specify a custom album name
    immich upload $DRY_RUN --recursive --album 'test1' /home/sitram/mounts/data/photos/'2006.07 - Poze cu Miky pisica lui Adi'

Error received:

Executing API key auth flow...
Logged in as axxx@gmail.com
Wrote auth info to /home/sitram/.config/immich/auth.yml
node:internal/fs/promises:1014
  const result = await PromisePrototypeThen(
                 ^

Error: ENOENT: no such file or directory, lstat 'test1'
    at async Object.lstat (node:internal/fs/promises:1014:18)
    at async Upload.run (/usr/lib/node_modules/@immich/cli/dist/src/commands/upload.js:26:30)
    at async Command.<anonymous> (/usr/lib/node_modules/@immich/cli/dist/src/index.js:43:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: 'test1'
}

Node.js v21.5.0
Executing logout flow...
Removed auth file /home/sitram/.config/immich/auth.yml
Successfully logged out


### Additional information

_No response_
fbaudens commented 8 months ago

Hello, Same here with immich v2.0.6 freshly installed and node.js v21.5.0 (on iMac intel)

alextran1502 commented 8 months ago

cc: @etnoy

etnoy commented 8 months ago

Thanks for the report, will look into it

AngelPone commented 8 months ago

This issue is because of outdated documentation. Current CLI has a --album-name parameter. If it is set, add all assets to specified album. See immich upload --help for details.

SitramSoft commented 8 months ago

@AngelPone You are right. Thanks for pointing this out.

I guess this issue can be either closed or kept open to update the documentation.

etnoy commented 7 months ago

Fixed in main

babaz8 commented 4 months ago

Tried different times with this command: immich upload --album-name "Liam" --recursive Pictures/ It creates the album but it doesn't put the pictures inside it.