#CLI import (read-only) failed with files does not exist

1 messages · Page 1 of 1 (latest)

dry rain
#

I'm trying to import some pics and vids from a folder, but the cli tool generates an error, telling me that files does not exist during the import process. But, it detected them when the cmd is launched.

The command used: docker run --network immich-net -it --rm -v "/home/debian/media/fotos:/import" ghcr.io/immich-app/immich-cli:latest upload --key <api_key> --server http://immich-server:3001 --recursive --import

heady oxide
#

the right and left hand side of the mount has to be the same

#

so it should be /home/debian/media:/home/debian/media

dry rain
#

Ohh, the paths are now fixed.

#

But, the error persists.

#

I started re-installed all the containers again, by cleaning up the dirs for immich services.

heady oxide
#

can you post your updated docker-compose and the value of external path in the edit user form?

dry rain
#

`services:

server:
image: ghcr.io/immich-app/immich-server:release
container_name: immich-server
command: [ "start.sh", "immich" ]
volumes:
- /home/debian/docker-data/immich/upload:/usr/src/app/upload
- /home/debian/media:/home/debian/media
env_file:
- stack.env
depends_on:
- redis
- postgresql
- typesense
restart: unless-stopped
networks:
- immich-net

microservices:
image: ghcr.io/immich-app/immich-server:release
container_name: immich-microservices
command: [ "start.sh", "microservices" ]
volumes:
- /home/debian/docker-data/immich/upload:/usr/src/app/upload
- /home/debian/media:/home/debian/media
env_file:
- stack.env
depends_on:
- redis
- postgresql
- typesense
restart: unless-stopped
networks:
- immich-net

(...)

networks:
immich-net:
name: immich-net`

heady oxide
#

And the CLI command that you use?

dry rain
dry rain
heady oxide
#

@tiny hazel Do you know if we should also mount the /import as the volume path?

#

I think since we are using the identical path for the import mechanism, running the CLI from docker won't work, right?

#

@dry rain Can you install nodejs on your system to install Immich?

#

I think running the CLI as a ocntainer won't work with the import feature just yet

dry rain
tiny hazel
#

Including inside the cli container

heady oxide
#

isn't inside the container read the mount at /import?

tiny hazel
#

@dry rain what path did you mount to your Immich server?

heady oxide
# dry rain

I cannot see the error from your screenshot

tiny hazel
dry rain
#

Mmm, the --import option causes it.

#

Running the command without it, it imports the media withou problem, but not in read-only mode, of course.

dry rain
heady oxide
#

Can you install nodejs and install immich cli from npm instead?

#

so that we don't run into this issue?

tiny hazel
#

Currently in the cli container you're mounting to /import

#

So the path that the cli sees is different from the path that the server sees

heady oxide
#

yeah that makes it quite complicated

tiny hazel
heady oxide
#

so the gallery would be mounted as /import everywhere?

tiny hazel
#

For example, or mounted to a different path in the cli container

clever frigate
#

This will all be a lot easier once the immich-cli is installed on the container. After that, it doesn't matter what the volume mounts are it'll just work.

heady oxide
#

@dry rain can you use the cli tool install from npm instead of docker?

dry rain
#

Well, I just wanted use docker for it, but I will give itba try.

clever frigate
#

You might be able to use docker if you run it and replace /import with the other path

dry rain
clever frigate
#

And pass the path as the final argument to the command

dry rain
#

Now the message, when including the '--import' arg, is that no files were found.

dry rain
clever frigate
#

You don't need the colon and it twice, just one string of the path, but yes

dry rain
#

Ahhhh

clever frigate
#

Or add -e IMMICH_ASSET_PATH /home/debian/media before the ghcr.io... and don't add the path at the end

dry rain
#

As I'm mounting a path (-v), I assumed I had to set both, the source and the container path.

clever frigate
#

That is true

#

But the last argument to the import command is just the path to look for images inside the container, so /home/debian/media

dry rain
#

I understand

clever frigate
#

To be clear the volume mount your had before was right.

#

I think you can either use -e to override the default /import or add /home/debian/media as the final argument to add it to the command as another place to look

#

Do either of those work?

dry rain
#

Sorry guys, for the time spent on this issue.

#

I finally solved it by adding another path at the end.

#

Now, it imports the media perfectly.

#

docker run --network immich-net -it --rm -v "/home/debian/media:/home/debian/media" ghcr.io/immich-app/immich-cli:latest upload --key <api_key> --server http://immich-server:3001 /home/debian/media --recursive --import

#

But, another question related to the generated thumbnails for pics and videos, under '/.../immich/upload/encoded-video' and '/.../immich/upload/thumbs'.
If I decide to delete some files, or maybe the whole directory (imported using the above method), may I have to delete the thumbnails under these dirs, manually?

heady oxide
#

FYI we add the immich command to the container in the latest update so you can also attach to the container and run the cli directly from the server container instead