I
Immich•2y ago
coxtor

Import External photos bad request unsupported filetype

I am trying to import my external library using the bulk upload tool. However it appears that the paths get messed up somehow. For some reason all slashes are removed according to the upload log. I upload using this command: immich upload --recursive --import --key <key> --server http://192.168.178.97:3001 /media/data/Bilder/ Docker-Compose for both server and microservices: volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /media/data/Bilder/:/media/data/Bilder/:ro After indexing and completing the upload I get an error for every file (89K) that was supposed to be uploaded looking like this (see attached file). I have added the path : /media/data/Bilder/ to the user in the UI This has worked on a previous installation and I don't see whats going wrong. I am able to see and browse the data in the container too. I have also already tried running the command from the container too.
21 Replies
jrasm91
jrasm91•2y ago
Can you try removing the trailing slash in your command?
coxtor
coxtorOP•2y ago
no change unfortunately but the communication with the server appears to be fine.
coxtor
coxtorOP•2y ago
No description
jrasm91
jrasm91•2y ago
That looks so weird. The request is fine and the response looks bad. It is not getting the file extension correctly. I think this might be a recent regression. Can you open a GitHub request for the issue? Yeah, confirmed this is a bug. You can try importing against the previous release possibly
coxtor
coxtorOP•2y ago
good to know 🙂 - I thought I was going mad after reading the docs the 10000 time . I have created an issue: https://github.com/immich-app/immich/issues/4091
GitHub
[BUG] [Regression] External Library uploading using CLI not workin...
The bug Adding an external library using the CLI is no longer functional as of discord discussion https://discord.com/channels/979116623879368755/1151645349522456668 , confirmed by @jrasm91 . The c...
Alex Tran
Alex Tran•2y ago
Thank you, I will take a look at this and push out a hot fix asap
Alex Tran
Alex Tran•2y ago
The problem bit is in here
No description
Alex Tran
Alex Tran•2y ago
It somes how change all the path from /usr/src/app/UsersalexDownloadsexternal_libraryusgs-R_W86FHa-Sk-unsplashjpg to assetPath: 'UsersalexDownloadsexternal_libraryusgs-R_W86FHa-Sk-unsplashjpg' in the controller I suspect by updating the nodejs version of Nest causing the issue 🤔? because those lines haven't been changed for months Yeah the sanitize file package somehow alters the file path If we remove the Transform decorator then it works fine
jrasm91
jrasm91•2y ago
The testing PR actually fixed a few issues here and added the validation pipe, which started using the decorators Basically the endpoint has the decorators but they weren't being used. We "turned them on" and it turns out that one has been broken the whole time.
Alex Tran
Alex Tran•2y ago
That PR didn't touch the Transform decorator or toSanitized though, do you mean the order of how the order of the property get validated over each decorator?
jrasm91
jrasm91•2y ago
Let me link it here
Alex Tran
Alex Tran•2y ago
ah so toSanitized was broken the whole time, right?
jrasm91
jrasm91•2y ago
Yes
Alex Tran
Alex Tran•2y ago
ah ok, let me see if I can fix it
jrasm91
jrasm91•2y ago
I can't link the line ony phone, but in the asset controller in this commit. https://github.com/immich-app/immich/commit/7173af60e499de97254b7324d1b0ac996e7e22f9
GitHub
chore(server): Improve test coverage! (#3889) · immich-app/immich@7...
* tests for person service * tests for auth service * tests for access core * improve tests for album service * fix missing brackets and remove comments * tests for asset service ...
Alex Tran
Alex Tran•2y ago
ah the transform property
jrasm91
jrasm91•2y ago
It was using booleans as strings, etc. still
Alex Tran
Alex Tran•2y ago
I think the bug here is that we use sanitize-filename for the whole path, so it strips out all of the path notations, we use only sanitize the filename
jrasm91
jrasm91•2y ago
Correct I think this is meant to be used in file paths to folders to strip out .. and other invalid characters It had been working fine as is though (without it being applied at all) and the path is still getting resolved and checked against the users storage path so I don't know if we even need to keep it
Alex Tran
Alex Tran•2y ago
yeah, let me remove it
coxtor
coxtorOP•2y ago
great resolved!

Did you find this page helpful?