CLI import (read-only) failed with files does not exist
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
38 Replies
the right and left hand side of the mount has to be the same
so it should be
/home/debian/media:/home/debian/media
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.
can you post your updated docker-compose and the value of external path in the edit user form?
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
And the CLI command that you use?
docker run --network immich-net -it --rm -v "/home/debian/media:/import" ghcr.io/immich-app/immich-cli:latest upload --key <api_key> --server http://immich-server:3001 --recursive --import
@bo0tzz 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?
@SmartPhoneLover 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 yetIt doesn't matter what path you use as long as its the same everywhere
Including inside the cli container
isn't inside the container read the mount at
/import
?@SmartPhoneLover what path did you mount to your Immich server?
I cannot see the error from your screenshot
Yes, so then the server should also have /import
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.
volumes:
- /home/debian/docker-data/immich/upload:/usr/src/app/upload
- /home/debian/media:/home/debian/media
Can you install nodejs and install immich cli from npm instead?
so that we don't run into this issue?
You need to make sure the mount in the cli container matches this
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
yeah that makes it quite complicated
Not really, just need to mount it the same everywhere 😛
so the gallery would be mounted as
/import
everywhere?For example, or mounted to a different path in the cli container
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.
@SmartPhoneLover can you use the cli tool install from npm instead of docker?
Well, I just wanted use docker for it, but I will give itba try.
I will
You might be able to use docker if you run it and replace /import with the other path
I have done that more than 6 times. Nothing.
And pass the path as the final argument to the command
Now the message, when including the '--import' arg, is that no files were found.
Do you mean placing the path at the of the command, just after 'docker run (...) --recursive --import /path/to/media:/path/to/media'?
You don't need the colon and it twice, just one string of the path, but yes
Ahhhh
Or add -e IMMICH_ASSET_PATH /home/debian/media before the ghcr.io... and don't add the path at the end
As I'm mounting a path (-v), I assumed I had to set both, the source and the container path.
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
I understand
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?
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?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 insteadI saw the update release notes right now. Great!