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
No description
No description
No description
38 Replies
Alex Tran
Alex Tran•2y ago
the right and left hand side of the mount has to be the same so it should be /home/debian/media:/home/debian/media
SmartPhoneLover
SmartPhoneLoverOP•2y ago
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.
Alex Tran
Alex Tran•2y ago
can you post your updated docker-compose and the value of external path in the edit user form?
SmartPhoneLover
SmartPhoneLoverOP•2y ago
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
Alex Tran
Alex Tran•2y ago
And the CLI command that you use?
SmartPhoneLover
SmartPhoneLoverOP•2y ago
No description
SmartPhoneLover
SmartPhoneLoverOP•2y ago
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
Alex Tran
Alex Tran•2y ago
@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 yet
SmartPhoneLover
SmartPhoneLoverOP•2y ago
No description
bo0tzz
bo0tzz•2y ago
It doesn't matter what path you use as long as its the same everywhere Including inside the cli container
Alex Tran
Alex Tran•2y ago
isn't inside the container read the mount at /import?
bo0tzz
bo0tzz•2y ago
@SmartPhoneLover what path did you mount to your Immich server?
Alex Tran
Alex Tran•2y ago
I cannot see the error from your screenshot
bo0tzz
bo0tzz•2y ago
Yes, so then the server should also have /import
SmartPhoneLover
SmartPhoneLoverOP•2y ago
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
Alex Tran
Alex Tran•2y ago
Can you install nodejs and install immich cli from npm instead? so that we don't run into this issue?
bo0tzz
bo0tzz•2y ago
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
Alex Tran
Alex Tran•2y ago
yeah that makes it quite complicated
bo0tzz
bo0tzz•2y ago
Not really, just need to mount it the same everywhere 😛
Alex Tran
Alex Tran•2y ago
so the gallery would be mounted as /import everywhere?
bo0tzz
bo0tzz•2y ago
For example, or mounted to a different path in the cli container
jrasm91
jrasm91•2y ago
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.
Alex Tran
Alex Tran•2y ago
@SmartPhoneLover can you use the cli tool install from npm instead of docker?
SmartPhoneLover
SmartPhoneLoverOP•2y ago
Well, I just wanted use docker for it, but I will give itba try. I will
jrasm91
jrasm91•2y ago
You might be able to use docker if you run it and replace /import with the other path
SmartPhoneLover
SmartPhoneLoverOP•2y ago
I have done that more than 6 times. Nothing.
jrasm91
jrasm91•2y ago
And pass the path as the final argument to the command
SmartPhoneLover
SmartPhoneLoverOP•2y ago
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'?
jrasm91
jrasm91•2y ago
You don't need the colon and it twice, just one string of the path, but yes
SmartPhoneLover
SmartPhoneLoverOP•2y ago
Ahhhh
jrasm91
jrasm91•2y ago
Or add -e IMMICH_ASSET_PATH /home/debian/media before the ghcr.io... and don't add the path at the end
SmartPhoneLover
SmartPhoneLoverOP•2y ago
As I'm mounting a path (-v), I assumed I had to set both, the source and the container path.
jrasm91
jrasm91•2y ago
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
SmartPhoneLover
SmartPhoneLoverOP•2y ago
I understand
jrasm91
jrasm91•2y ago
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?
SmartPhoneLover
SmartPhoneLoverOP•2y ago
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?
Alex Tran
Alex Tran•2y ago
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
SmartPhoneLover
SmartPhoneLoverOP•2y ago
I saw the update release notes right now. Great!

Did you find this page helpful?