I
Immichβ€’2y ago
orbit

Unable to import many pictures: "Error getting device's uploaded assets"

Trying to upload a folder containing ~220,000 files doesn't work, I'm assuming it times out behind the scenes while processing all of that. Is there any way to verify that's the case or increase the time limit? Or increase the verbosity of immich upload -r? The same picture folder, albeit maybe a few hundred pictures smaller, imported without issue a few months back with an earlier version of Immich. Another server with identical configuration, also a fresh deployment, imported 12,000 files from the same node client without issue which makes me think this has to do with the amount of files I can get the logs for any of these subcontainers, just let me know which would be most useful
immich-redis-5679bcff58-cmm2h
immich-typesense-7ff74b47d8-grvw7
immich-postgres-678cd96558-975ct
immich-7b76bc597-bkvp5
immich-web-58dd744b84-k79d4
immich-microservices-7585565d6-wpsss
immich-proxy-6575579b7d-wc62c
immich-machinelearning-7757748ff-k9cj2
immich-redis-5679bcff58-cmm2h
immich-typesense-7ff74b47d8-grvw7
immich-postgres-678cd96558-975ct
immich-7b76bc597-bkvp5
immich-web-58dd744b84-k79d4
immich-microservices-7585565d6-wpsss
immich-proxy-6575579b7d-wc62c
immich-machinelearning-7757748ff-k9cj2
Setup: Kubernetes Helm container (TrueNAS Scale Official) Version 1.67.2_1.0.5 (latest for TrueNAS) - Fresh install/deployment 7.2TB Free for Immich, 467GB Library folder attempting to import Thanks!!
No description
165 Replies
Alex Tran
Alex Tranβ€’2y ago
What is your immich cli version?
orbit
orbitOPβ€’2y ago
0.39.0
Alex Tran
Alex Tranβ€’2y ago
Hmm 0.39 should be compatible with 1.67.2 If you try again, would the same issue occur?
orbit
orbitOPβ€’2y ago
I've tried a few times, yeah Restarted the container and cli vm as well
Alex Tran
Alex Tranβ€’2y ago
Strange. Once they release 1.68 or 1.69 can you update the CLi to 0.40.1 and try again? We fixed a few things in 0.40.1
orbit
orbitOPβ€’2y ago
Just saw there's an update available for 1.69.x, I hadn't checked in a few days I'll install that soon Well same issue, now on 0.40.1 and 1.69.0_1.0.7
Alex Tran
Alex Tranβ€’2y ago
Same error can you post the screenshot please?
orbit
orbitOPβ€’2y ago
No description
Alex Tran
Alex Tranβ€’2y ago
Let me add a message to print out the error and publish it should be up in 5 mins it is published can you help install the new version 0.40.2 and try again it should print out the detail error message
orbit
orbitOPβ€’2y ago
Okay updated, waiting on it to index local assets first
orbit
orbitOPβ€’2y ago
I had in it tmux so I can scroll around but can't copy the entire output since it's in a vm(novnc). This seems to be the important bit
No description
orbit
orbitOPβ€’2y ago
I can screenshot the rest in pieces if that's helpful
Alex Tran
Alex Tranβ€’2y ago
yes please how many assets are you having on your instance currently?
orbit
orbitOPβ€’2y ago
2
Alex Tran
Alex Tranβ€’2y ago
really? hmm I thought it might have been millions to cause such issue like this
orbit
orbitOPβ€’2y ago
No description
No description
No description
No description
Alex Tran
Alex Tranβ€’2y ago
Where are you currently running the CLI on? These are some weird error
orbit
orbitOPβ€’2y ago
CLI is on endeavour os (Linux 6.3.1-arch2-1) importing about 200k assets
Alex Tran
Alex Tranβ€’2y ago
I suspect that it might have been issue with the TrueNas Can you spin a test instance on your endeavour OS using docker-compose method? then try to run this upload to that instance to see if it works, meaning getting through the prompt
orbit
orbitOPβ€’2y ago
I'll follow the guide and try it, sure My vm was out of date when I went to install docker-compose, so I updated everything (which also reinstalled npm and immich-cli) and retried the import to truenas just to be sure nothing changed. It was the same error As for the test instance, I keep seeing "no space left on device". There was only 3gb left on the vm so I tried it on my laptop with >100gb free. Same error so the message is a bit misleading. Must be a docker issue, I'm looking more into it before I can continue I was in ssh without realizing it - the instance came up fine on my laptop. VM imported test 2 test assets fine and it's running the 200k files now
orbit
orbitOPβ€’2y ago
Same error I believe, truenas has been ruled out
No description
No description
No description
Alex Tran
Alex Tranβ€’2y ago
If you choose a subfolder , would that work?
orbit
orbitOPβ€’2y ago
Probably yeah, I tried *.* before to just import loose files and it worked, got to the next prompt I'll try a folder though
Alex Tran
Alex Tranβ€’2y ago
Pinging other @Contributor, so everyone aware of this issue
orbit
orbitOPβ€’2y ago
Tried a 62gb subfolder and it worked as well
No description
Lama
Lamaβ€’2y ago
Are you trying to do *.* in a folder with 262k assets? Ignore that, apparently I can't read πŸ˜… When you get EPIPE it usually means that the other end closed the connection Can you see any error in the server log?
jrasm91
jrasm91β€’2y ago
To be clear how big is the list of uploaded assets at this point? It is basically 0 right? It is running into an error getting the "assets by device id", right @Alex ?
Lama
Lamaβ€’2y ago
The error seems to occur before anything is uploaded, that's why I think the server log might be more interesting here
orbit
orbitOPβ€’2y ago
Which of these logs should I pull?
immich-typesense-7ff74b47d8-grvw7
immich-postgres-678cd96558-975ct
immich-7b76bc597-bkvp5
immich-web-58dd744b84-k79d4
immich-microservices-7585565d6-wpsss
immich-proxy-6575579b7d-wc62c
immich-machinelearning-7757748ff-k9cj2
immich-typesense-7ff74b47d8-grvw7
immich-postgres-678cd96558-975ct
immich-7b76bc597-bkvp5
immich-web-58dd744b84-k79d4
immich-microservices-7585565d6-wpsss
immich-proxy-6575579b7d-wc62c
immich-machinelearning-7757748ff-k9cj2
Yes basically , it's only 2
orbit
orbitOPβ€’2y ago
Got the log of immich-7b76bc597-bkvp5 from this command template k3s kubectl logs --namespace "ix-$app_name" -f "$pod" -c "$container Is there a way to increase verbosity? Or am I looking at the wrong file
jrasm91
jrasm91β€’2y ago
This is strange. Looks normal.
Lama
Lamaβ€’2y ago
Do you have a firewall that could interrupt connections?
orbit
orbitOPβ€’2y ago
My router is fairly basic so I doubt it would do that but I'll check
bo0tzz
bo0tzzβ€’2y ago
Your router shouldn't be involved here at all right?
orbit
orbitOPβ€’2y ago
Given it's all on LAN side I don't think it would be
orbit
orbitOPβ€’2y ago
I can turn off these things and give it a test if that would make a difference? (TP-Link ER605)
No description
No description
orbit
orbitOPβ€’2y ago
Not sure though, it would have no reason to block immich transfers since it's all within LAN, and even if for some reason the firewall rules applied it wouldn't be considered ping of death or winnuke (icmp / port searching / urgent packet) I realize though you could've meant software firewall, those I'm less familiar with. I'll see if truenas or endeavour came with those. UFW, IP Tables, and Apparmor are the only ones to look for, right?
orbit
orbitOPβ€’2y ago
VM has iptables, but no ufw or apparmor. Here's the iptables rules
No description
orbit
orbitOPβ€’2y ago
Truenas has a long list of iptables rules and a few apparmor profiles(?), but no ufw. Here's those
Lama
Lamaβ€’2y ago
I just wanted to check whether you had explicitly configured something. I don't think any default setups should interfere with that.
orbit
orbitOPβ€’2y ago
Okay Then no I haven't messed with it
jrasm91
jrasm91β€’2y ago
The thing that's is strange is the login endpoint works but getting a list of previously uploaded assets results in that write pipe error. Obviously he can connect to the server, since it logs in. Also, the request is not an upload, but another API request to the server, so I think any upload related issues aren't in play here either. Can you access that endpoint in the browser after logging in so you have a cookie? The url in the middle of this picture (/api/asset/UUID)
Lama
Lamaβ€’2y ago
Is there mabe some form of concurrency going on?
jrasm91
jrasm91β€’2y ago
What do you mean?
orbit
orbitOPβ€’2y ago
This works in the browser
No description
jrasm91
jrasm91β€’2y ago
Afaict that request in the CLI is running into an error https://github.com/immich-app/CLI/blob/main/bin/index.ts#L188
GitHub
CLI/bin/index.ts at main Β· immich-app/CLI
CLI utilities for Immich to help with upload images and videos from a location on a desktop machine or a server to the Immich's server - immich-app/CLI
orbit
orbitOPβ€’2y ago
Is the cli preparing its api GET request before it's done indexing local files, then the request "expires" by the time indexing is complete? Since the number of files defines how long that step takes, timing must have an impact, as a smaller(faster) folder works fine
jrasm91
jrasm91β€’2y ago
This is only an issue for large folders?
etnoy
etnoyβ€’2y ago
Do you have the option to try the new, prerelease cli?
orbit
orbitOPβ€’2y ago
Yes, I tested importing the whole photos folder (~220k assets) vs a subfolder (~38k assets) earlier in the thread and only the latter worked. There was also an identically configured server/instance that imported a folder of ~12k assets fine from the same cli Probably yes, is this installed through npm or built from source?
etnoy
etnoyβ€’2y ago
Try cloning the source code and then reading the readme in the cli folder It should be pretty straightforward. Please let me know of any issues, we're aiming to get it stable after I'm back from summer vacation
jrasm91
jrasm91β€’2y ago
Fyi We have a partially rewritten CLI in the main immich-app/immich repository, not the immich-app/CLI repo. That's what @etnoy is referring to
etnoy
etnoyβ€’2y ago
Yes, should mention that you clone the main immich repo
orbit
orbitOPβ€’2y ago
Oh I see, will do
jrasm91
jrasm91β€’2y ago
It is supposed to be done with indexing before fetching remote asset data. But something must be causing an issue if the same code works with a smaller folder. Maybe the drive is busy or no more file handles are available or something weird like that
etnoy
etnoyβ€’2y ago
It's a very interesting thing, I'm intrigued
jrasm91
jrasm91β€’2y ago
Worst case you could just import sub folders one at a time I assume.
orbit
orbitOPβ€’2y ago
I was thinking the same thing, but also intrigued on what's causing this, hopefully we can figure it out
orbit
orbitOPβ€’2y ago
Error with ts-node, am I missing a package?
No description
etnoy
etnoyβ€’2y ago
Ah, do an npm install in the cli folder
jrasm91
jrasm91β€’2y ago
What version of node are you using? node -v
orbit
orbitOPβ€’2y ago
installed yesterday so latest afaik but I'll check 9.8.1
etnoy
etnoyβ€’2y ago
Yeah, go to 18 instead That one's ancient
jrasm91
jrasm91β€’2y ago
There was a 9.8.1 version?
etnoy
etnoyβ€’2y ago
Try using nvm Wait maybe that's npm
orbit
orbitOPβ€’2y ago
Oh mb, yeah that was the npm version node is v20.4.0
jrasm91
jrasm91β€’2y ago
Lol niiiiice
etnoy
etnoyβ€’2y ago
That makes more sense indeed πŸ˜…
jrasm91
jrasm91β€’2y ago
npm i in the CLI directory should fix the errors
orbit
orbitOPβ€’2y ago
It did Going through the rest of readme now
orbit
orbitOPβ€’2y ago
Running import🀞
No description
orbit
orbitOPβ€’2y ago
Error :( Something less vague this time though
No description
No description
No description
No description
No description
orbit
orbitOPβ€’2y ago
Is it that file "000_0784.jpg" causing an error? Or is that a coincidence I'll start a new import without that file and this time tee the output to a .txt
orbit
orbitOPβ€’2y ago
Seems like a coincidence though as that's the first file alphabetically
No description
etnoy
etnoyβ€’2y ago
That seems to be the first file being uploaded
bo0tzz
bo0tzzβ€’2y ago
What is the full cli command you're using?
etnoy
etnoyβ€’2y ago
I don't think that immich is able to access that file in the container "File does not exist" How's your docker-compose?
orbit
orbitOPβ€’2y ago
ts-node cli/src import -r /mnt/dataset/Photos It's a helm chart I don't think there is a docker-compose I'll pull up the config though
etnoy
etnoyβ€’2y ago
You need to add the /mnt/dataset/Photos as a volume to the server and microservices containers
bo0tzz
bo0tzzβ€’2y ago
Just to double check - you're aware of the distinction between upload and import?
orbit
orbitOPβ€’2y ago
My mistake - just checked the readme for new CLI and I went through too fast, I'll retry this with upload I made sure my old cli command used upload so that was correct at least will post log once it's complete
etnoy
etnoyβ€’2y ago
Did the upload get started?
orbit
orbitOPβ€’2y ago
It's still sitting on this screen, hasn't gotten to the percentage counter yet
No description
etnoy
etnoyβ€’2y ago
Ok, keep us posted btw, what happens if you run find /mnt/dataset/Photos? Does that command complete?
Lama
Lamaβ€’2y ago
&>/dev/null
etnoy
etnoyβ€’2y ago
True The progress bar should appear basically after crawling the local files
Lama
Lamaβ€’2y ago
Why does it take so long though?
bo0tzz
bo0tzzβ€’2y ago
There's a lot of files
Lama
Lamaβ€’2y ago
But just reading their names should only take some milliseconds, even for thousands of files
etnoy
etnoyβ€’2y ago
Previous screenshot shows 500 gigabytes of files If I don't misremember, it also has to stat the files for basic file info
Lama
Lamaβ€’2y ago
no readdir muuuuch faster IIRC
etnoy
etnoyβ€’2y ago
I'd have to check my source code for when it stats the files
Lama
Lamaβ€’2y ago
Should be a single syscall to list an entire directory including name and type
orbit
orbitOPβ€’2y ago
Good news?
No description
etnoy
etnoyβ€’2y ago
Nice!
Lama
Lamaβ€’2y ago
Ah yeah that's probably the bottleneck
etnoy
etnoyβ€’2y ago
Taking notes about the initial crawl potentially needing a progress bar I love that I put an ETA estimate + size indicator in the new cli πŸ˜„
Lama
Lamaβ€’2y ago
Would switching to fs.readdir be a possiblity for you?
etnoy
etnoyβ€’2y ago
I don't have the code in front of me, but don't we need to stat every file in the crawl?
Lama
Lamaβ€’2y ago
readdir returns that information without needing to stat
etnoy
etnoyβ€’2y ago
Ah, didn't know that
Lama
Lamaβ€’2y ago
that's why find is much faster
etnoy
etnoyβ€’2y ago
I'll double check to see what info is actually read
Lama
Lamaβ€’2y ago
not a priority anyhow^^
orbit
orbitOPβ€’2y ago
Thanks for the help !! It's settled at 5hr now, not so bad for a gbit link will the old cli be retired at some point, so we don't need to worry abut debugging what happened before?
etnoy
etnoyβ€’2y ago
The old cli uses an old way of detecting duplicates That we're discontinuing so it will be retired as soon as the new cli is stable enough
orbit
orbitOPβ€’2y ago
Okay
orbit
orbitOPβ€’2y ago
Left it for a while and when I checked it stopped on this error. File is readable with ls. I restarted the upload to try again since it seems random for the cli to stop on a file for no particular reason
No description
jrasm91
jrasm91β€’2y ago
Are you running this on the same machine that's hosting immich?
orbit
orbitOPβ€’2y ago
No, I have no way of putting npm on that machine at the moment
jrasm91
jrasm91β€’2y ago
That's fine. I was just wondering if the jobs in were all running (machine learning, thumbnail generation, exif extraction) and if it was impacting the availability of reading the files from disk. Is it reading/writing the files on the same disk? Network share? Otherwise I'm not sure why it would temporarily be unavailable 50gb in
orbit
orbitOPβ€’2y ago
/mnt/dataset is a network share going to the machine running immich, yes. And it is running jobs I believe If it's the network share causing issues I can reboot the immich machine to enable virtualization, spin up a vm to run npm and upload from there so it's all within the same box
orbit
orbitOPβ€’2y ago
The disks and cpu haven't been constantly busy so there was most likely bandwith to spare even with jobs going
No description
No description
jrasm91
jrasm91β€’2y ago
Well. My guess is all the background jobs led to the error you got. My two cents. There was a read/write spike around 18:00. Did the CLI run for an hour and then die?
orbit
orbitOPβ€’2y ago
Not sure how long it was running when it failed, but I paused the jobs just in case they affect the next run
jrasm91
jrasm91β€’2y ago
That's what I was about to suggest. Did you try out immich before doing this big data load?
orbit
orbitOPβ€’2y ago
Yes I ran a super old version (before search, machine learning, etc) for a while before I switched helm chart providers and needed to reinstall + reupload
jrasm91
jrasm91β€’2y ago
There's still a bunch of stuff to fix, especially for large libraries like yours. Too much to do and too little time to do it all 😁
orbit
orbitOPβ€’2y ago
It's an impressive feat to take on google photos when so many other projects have failed at it ! Even if imperfect Immich has been very helpful so far
orbit
orbitOPβ€’2y ago
Failed at the preceding file...
No description
orbit
orbitOPβ€’2y ago
I'm going to try uploading from a different client, that is a weird error
Alex Tran
Alex Tranβ€’2y ago
Thank you for helping testing this. This is the first instance we see this error from the CLI
orbit
orbitOPβ€’2y ago
Of course! Is there be any way to add verbosity/context to this error or is it filesystem related?
Alex Tran
Alex Tranβ€’2y ago
it is the most verbose we can print out for that error
orbit
orbitOPβ€’2y ago
Okay
Alex Tran
Alex Tranβ€’2y ago
I think If you can spin up an Ubuntu/Debian VM and try, it would be a great baseline test
orbit
orbitOPβ€’2y ago
Sure, I need to set up qemu and install Debian so that may be a minute
Alex Tran
Alex Tranβ€’2y ago
No rush here Orbit πŸ˜› We are here to help to get you upload/import everything to Immich
orbit
orbitOPβ€’2y ago
Same error on my laptop
No description
orbit
orbitOPβ€’2y ago
VM is up, just need to login with api key and start the upload from there
Alex Tran
Alex Tranβ€’2y ago
interesting same file I wonder if the file is corrupted somehow
orbit
orbitOPβ€’2y ago
Maybe , I'll try opening it It opens fine so not corrupted afaict, I could take out that entire folder (866NCMTO) if you think it'd make a difference The first error with cli-v2 was on another file in there IMG_3037, not IMG_3036
Alex Tran
Alex Tranβ€’2y ago
I think we can definitely try that as welll
orbit
orbitOPβ€’2y ago
I checked IMG_3036 against another working image in a hex viewer and theres no obvious error like a blank spot or repeating sequence I'll take out the folder and try again in VM
Alex Tran
Alex Tranβ€’2y ago
Thank you
orbit
orbitOPβ€’2y ago
No description
orbit
orbitOPβ€’2y ago
The common denominator between all 3 clients is CIFS (smb mounted on linux), should I try uploading from Windows or is there another plan to debug
Alex Tran
Alex Tranβ€’2y ago
smb mount shouldn't cause any issue
orbit
orbitOPβ€’2y ago
Okay
orbit
orbitOPβ€’2y ago
Is there any way to test for the second case here? Or would there not be more than one thread accessing
No description
orbit
orbitOPβ€’2y ago
etnoy
etnoyβ€’2y ago
Interesting I've set the cli to fail on first error. In the future I'm planning to have it do, say, three retries with exponential backoff However it's tricky when you get an underlying OS error like EAGAIN, there's not much we can do with that unless it would clear on a retry Do you have the option to run the cli from another machine straight from disk, ie not mounted via cifs? From my experience, I'd say the issue is caused by cifs for sure
orbit
orbitOPβ€’2y ago
I do have a local copy of the Photos folder I could try I'll connect it and start the local upload from endeavour vm
orbit
orbitOPβ€’2y ago
It made it past 53.8gb (!) I won't see it complete until the morning but there's good news
No description
etnoy
etnoyβ€’2y ago
Awesome. I guess you'd run in to random cifs errors all along the way so this is probably the way to go
orbit
orbitOPβ€’2y ago
I'd be curious to see if cifs was causing errors in the old cli version as well, i'll try that if the upload goes well
etnoy
etnoyβ€’2y ago
Yes, the old version wasn't clear on errors.. I'm sure it ran into the same issues. We were just able to expose the problem now To test, why don't you run the old cli on that other machine? 😎
orbit
orbitOPβ€’2y ago
There are 3 (+2 virtual) machines at play now lol, you may have to specify The local copy i'm importing from now is on a hard drive plugged in where only the endeavour vm can access - I can start an old-cli upload in a second terminal pane if it won't interfere If you'd rather I use a different machine though I could move the drive once it's done tomorrow morning
etnoy
etnoyβ€’2y ago
Ah. Let's wait until this upload finishes and we can play with it later If you want to speed it up and you have lan connection you can do --skip-hash It will send every file and not do deduplication before upload That will only happen server side For initial imports that will save time Already uploaded files will not be duplicated
orbit
orbitOPβ€’2y ago
Oh good to know, thanks
orbit
orbitOPβ€’2y ago
Walked past the server and heard a lack of crunching hdd activity, checked to find this error.
No description
No description
No description
No description
No description
No description
No description
bo0tzz
bo0tzzβ€’2y ago
Supported types aside, @etnoy we shouldn't stop the whole show on this kind of error right? Just skip the asset and carry on
etnoy
etnoyβ€’2y ago
Previously, the cli was too forgiving of errors. I'm planning to have some hike of retry mechanism, but just skipping past errors is not really the way to go In this case, the new cli uncovered an underlying issue that frankly could lead to data loss if not acted upon Most core UNLV Unix tools will fall on first error Would you like to create a GitHub issue about that? That's an issue on the server, not cli
bo0tzz
bo0tzzβ€’2y ago
Sure we shouldn't just skip past, but there's a meaningful distinction between things like the error above (unsupported filetype) and more fatal stuff like connection errors We should shout loudly about things like this of course, but I don't think we need to stop the whole upload
etnoy
etnoyβ€’2y ago
We need to sit down and categorize the different error types we can encounter and handle them accordingly In the meantime, fail fast is the safe approach
jrasm91
jrasm91β€’2y ago
Missing .tiff might be a regression (bug)
orbit
orbitOPβ€’2y ago
Sure I'll make an issue for it https://github.com/immich-app/immich/issues/3429 It completed all 500gb, 100% just now Thanks everyone for the help!
etnoy
etnoyβ€’2y ago
Awesome!
jrasm91
jrasm91β€’2y ago
Let's go! Nope you can help us track all the other stuff that doesn't work with large libraries πŸ™‚
orbit
orbitOPβ€’2y ago
Sure! If i run into anything else I'll let you guys know
etnoy
etnoyβ€’2y ago
Don't worry Jason, I have a large library at home to test with: 6.4T and 570k items πŸ˜‰
jrasm91
jrasm91β€’2y ago
Noice

Did you find this page helpful?