Error while importing with CLI - Bad request 400 File does not exist
files are there, CLI also recognize all of them but fail to import them. any Idea?
using truenas
164 Replies
What command did you run?
immich upload --key <my-api-key> --server http://my-server-ip:2283/api /mnt/media/precious-memory --recursive --import
it recognized the files also showed that it did connected to the server but faild at import
what is your docker compose and external path value look like?
The error in the log mis-matches that mount path. Can you run the command from inside the immich-server container instead? The server url will become http://localhost:3001/ I think.
You may want to read through the docs again
https://immich.app/docs/features/read-only-gallery
i did read it it doesnt say anything to help me with my probelm
this is not the server so im getting server adrees error
connection error
both the external path under user and in the app setting are set correctly
it does recocgnize the files, correct number of files, connect to the server, just fails to import
you can see it here :

/usr/src/app/upload/upload/Tomer/IMG-20220704-WA0021.jpg
This is the file not found. Why did the file not match the precious memories folder structure?
GitHub
immich/server/src/immich/api-v1/asset/asset.service.ts at main Β· im...
Self-hosted photo and video backup solution directly from your mobile phone. - immich-app/immich
What are the permissions on the file I posted? Can you send the output of ls -l of the directory with the file? Also, upload/ is where immich stores your library. Why are you importing from that location?
im not 100% sure about everything im kinda a noob
if upload is not the file for uploading what is ?
Ls on the directory @jrasm91

For context, @Mr.President is trying this with the TrueNAS Scale TrueCharts app. Complicates things a bit trying to figure out which pod & container to run this from and translating paths. The app has a setting in the Scale UI for uploads folder to enable the read-only gallery.

Actually, this might be a truecharts issue @Mr.President
https://github.com/truecharts/charts/issues/10202
GitHub
Immich External Exports Mount Β· Issue #10202 Β· truecharts/charts
App Name Immich SCALE Version 22.02.3 App Version 1.65.0_7.1.3 Application Events N/A Application Logs N/A Application Configuration Describe the bug Unable to use Immich External Path to a mounted...
yeah i know i mounted it the right way
and this is something really old you cant choose anymore the internal mount path
so at this time idk what to try more
It's current as of 2 weeks ago
FWIW, I imported my gphotos collection with the cli from my PC to immich no problem
I just used a dedicated immich dataset for the storage and mounted it with hostpath for App Library Storage
yes that's what I did
what did you put under the mount path and the user external path
are you using NFS share or Host path?
Use this section

No need to add another storage
yes as I said they're all set up for folders
but should I put the files i want to upload in the library storage or in Upload storage?
then what did you write in the user host path and in the cli code? because you cant use host path in pods
so... it wont work
I hope we can solve it
I installed it with ingress enabled on TrueNAS, had my photos on my PC, got the docker image on it, and followed this
https://immich.app/docs/features/bulk-upload
I used the alias creation since I main linux on my desktop.
My command was
immich upload --key <key> --server https://<ingress URL>/api <folder to upload>
Bulk Upload (Using the CLI) | Immich
You can use the CLI to upload an existing gallery to the Immich server
what did you put under the user host path in the web ui
I didn't I used this.
Unless I'm misunderstanding what you mean by user host path
so nothing under user host path
external path
in the web ui
Yea, that option doesn't use that
ok ill try it now,
yeah its not wotking im getting no such file or directory error because you cant wirte host path paths in a cli command in a pod
it needs to be the container path
I showed you my command, you don't use host paths
ok maybe i didnt understood
what did you put uner <folder to upload>
You aren't doing this bulk upload from within a container
You're doing this from a different device
This was the folder containing all the pics I wanted to import into immich
You need to pick between import and upload. Import requires the files be mounted on the container. Upload uses http to send the files to the immich server from somewhere else
yes i understand
Yes sorry, i said import when I meant upload
Import uses external path in the UI user settings, upload does not
yeah but im doing it
You can run import from another machine but it is much simpler if your run it from the container directly
that's what im doing...
Then you avoid pathing issues.
but im getting no such file or directory
Then the user who is running the immich server can't read that file
There seems to be an issue with the truecharts container, which is why I'm suggesting upload
.
Is it not added to the server container?
He tried from the immich & server containers I believe
Err no, just from the immich one
If the volume mount is added properly to the server container import should work
The issue I linked seems to suggest there's something funky going on and import doesn't work
Got it.
ok see this:
I had the same problem, maybe you can take a look at #File does not exist within user's external path
If you meant to send a screenshot, it didn't work
im on it, i changes stuff for you guys so waitining for it to redeploy
youll get everything in couple of minutes
thank you for your help btw!!


Can you connect to the pod directly and run the command on there?
which pod? ill try it
Immich-server
no such pod, do you mean the main pod of immich?
Idk how truenas is configured, but the main pod, yes
so what i sent you until now was from the main pod
the problem is that you cant use host path in pods as i said before, but when im using container pods i does found the relevant files
just fails to upload them
It can't be you are setting the API address to another port
What pod runs with the IP 1.61?
all of them? I can also ingress it if it will help
What pod uses port 10323?
immich
You are running the command on that pod?
yes
Would it work if you used localhost instead?
I think you told me that and i tried it and it wont connect to the server at all
i can try it again if you want
If you can't make it work with a localhost address then you're not running it on the pod that's running the API...
show me how to write the local host and ill try it again
also
these are the pods if you want me to try it somewhere else

im trying it on the main pod
Are main 1 and 2 load balanced?
im not sure i know what is load balanced, but anyway the main pod is the one that says immich-numbers no the cnpg-main
@bo0tzz do you know how the truenas stuff works?
Just letting you know that the main problem is that you cant use host path in pods but you need the container path. with the container path it works, just fails to upload.
Ok im done with life @jrasm91 XD XD
I just run the same code I said from the begining that didnt work
and it worked
same thing
............
so I was right you cant use host path as I said
but why did it work
Not really. It's kubernetes under the hood but hacked to fit their weird ways of doing things, they don't use our helm chart or anything like that :P
I changed nothing
K will that explains that I guess.
The cnpg-* containers are postgres databases managed by cloudnative-pg, there is one primary and one read-only secondary, it should always be pointing it to the primary, probably nothing to see there
That part I do know how it works π
Obviously my expertise has hit is limit here.
I am so confused
really
I have to go for a meeting ill be back in an hour to try it again and see if its working again
ill let you guys know
ok im back, how you guys ever had a problem with stoppign the app? if you use truenas for some reason everytime i try to stop the app nothing happens. and then I need to delete it and reinstall it fun stuff
Yeah I think all your problems are pretty specific to the truenas implementation, which we don't have any experience or knowledge about, so can't be much help in that area I'm afraid.
yeah but at least i can move my knowlege forward so if someone will ask you the same thing again.. you know what and how
SO with truenas CLI works only if you use container path not Host path, if anyone have the same problem as me
also @jrasm91 do you know about a problem with pictures from what'sapp? I think all the pics from what'sapp after the upload are broken
I think there is a github issue for it. Looks like the exif data for those images are quite bad.
Mmm ok so its a known problem
OH ANOTHER thing
if you press stop or start on the app in Truenas it will break the entire app forever
you have to do it via heavyscript in the shell
so if someone ever ask you about why it wont start or stop
that's why XD
immich is a cnpg app, and so cannot be stopped with the stop button. You need to edit it, check this, then save.

Heavyscript is another way, but I think the stop all checkbox will be more practical for you
idk that's what I see in FAQ
for truechart

Yes, it's valid, but since you're new the stop all is easier.
how about start?
But if you wanna use heavyscript go for it
You uncheck the box and save
and it will start?
Yea
ohhhhhhh I seeee
Just be aware that CNPG apps can take a while to fully spin up
yeah
now lets see if i can still do CLI XD
Did you not get it working?
I did but now im trying it on another user with different API so at this point in time i kinda lost all confident in my abilities to use anything so
ill let you knowww
BTW you guys are awosome thanks for the help
This is how I learn. Blindly stumble about till I find something that works and I repeat it lol
True haha
Related, you can tell an app is a cnpg app by clicking on it to open this little window and open the containers portion

Just so you don't accidentally try to stop another app the wrong way
yeah I think you can also see it in pods
i dont think i ever used cnpg apps before
what is so important or good or unique about cnpg ?
They moved to it because ix-systems implementations caused a lot of headaches
I couldn't tell you the specifics of the advantages of cnpg for this usecase, though
just tried that stop option... didnt work and now my app broke
fuckkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
XD
this is nottttt working

its just stays on stop forever fuckkkkkkkkkkkkkk
XD
Something's off with your system then. I use it all the time
You can go into command shell and do
sudo systemctl restart middlewared
and it'll clear
You'll have to log in again
Yea, just did the Stop All with immich and it stopped as I expected.
@Mr.Presidentidk man hahah
Is it still stuck?
nope i restarted the middlewared thingy solved it
then started it with heavyscript
So then stick with heavyscript. Not sure why stop all is being wonky for you
haha yeah
i have another question
do you know why I cant see,the albums i make in the web UI, at the immich android app?
No, shouldn't be like that. That's an immich dev question
I should see the albums?
Yea, I do with mine
is it under sharing or library?
Library
maybe its becuase i just downloaded the app idk maybe it needs to sync?
You on android?
Yes sir
Try force closing the app and open it again
on it
it is still scanning my phone so im letting it finish that and ill force close it
no so I cant see the albums i made in the web ui
also if i made an album in the app i still cant see it but it will be avilable in the web ui
I'd wait till tomorrow when some devs are around and troubleshoot with them
how do I reach devs? open new support and close this one?
we are here and following
can you nuke your installation and try again?
well I dont really want to lose everything... and already did that yesterday and problem is still there
can you spin up a VM to use docker and docker compose to see if the problems persist?
phfff well the ability is there but I've never done it or really know how to do it
if you want to help me with that I would be more than happy to try
yeah why not π
sure lets dooo itttt
do I need any operation system from the VM?
what do you mean?
i might be stupid because im pretty newwww to servers
but as far as i know
when you run a VM you need like an opration system for it? like linux or something
no worry we are all learning something new here
ah I see, use Linux and Ubuntu for ease of use
ok let me find the installer and see if i know how to do it XD
is it ubuntu desktop or server?
server
do you know what permitions i need to let vm for it to be able work? im getting an error trying to figure it out
I dont unfortunately, I use promox so all the systems run on different VMs π
what error are you encountering?

Hmm can you ask Google?
im trying haha
ill let you know
ok i solved it but now i have something else
when i spin the vm im getting this

add an IOMMU?
@Alex I give up I cant find anything about it online
Do you have many services already run on your server?
Mmmm maybe but there's 20 cores in my server and like 1% usage so idk
that's so weird i change it to 1 core and it worked
I hope it wont be slow lets see
@Alex I think its working now
The old instace?
yeah i just put 1 cpu instead of 5 and it worked
:BO_djtmecuocdoi:
Doesnβt make any sense
welcome to truenas
XD
TruePain
Its all magic
True
I hope you will find revelation one day in system like Promox
IDK i still think for a storage server truenas is pretty good

now what
Wait until it boots to the shell
will it? it stuck there
:icebearehwhat:
Problem for tomorrow
Iβm going to bed
LOL ok ok let me know when are you avilable tomorrow ill be here
Keep researching
My weekend schedule is pretty tight
You can ask in general channel for help as well
I fixed it it is working now so if you want can try and check
what you wanted π