`/upload/upload` directory being created.

I think I may be misunderstanding User Storage Labels and Storage Templates I'm attaching a volume to immich-server as follows:
volumes:
- /etc/localtime:/etc/localtime:ro
- type: volume
source: user-data
target: /usr/src/app/upload
volume:
nocopy: true
volumes:
- /etc/localtime:/etc/localtime:ro
- type: volume
source: user-data
target: /usr/src/app/upload
volume:
nocopy: true
I assume (maybe wrongfully) that the /usr/src/app/upload should be the root of the upload directory. In this volume I start with two empty folders to start usernameA and usernameB I than set Storage Label for the two users to their to respective usernameA and usernameB. Now, what I thouht would happen, would each user's uploads would go in there respective folders, while what actually happend was a new folder named upload and another folder in that for userA followed by the file such that the full path of what is created is /usr/src/app/upload/upload/3fb9942e-bdb7-4cd1-9ffc-8ca5cdedc0f4/ad9e2273-d681-47b3-b66e-3fac8b715840.pnginstead of /usr/src/app/upload/usernameA/ad9e2273-d681-47b3-b66e-3fac8b715840.png Is there a way I can resolve this?
21 Replies
Alex Tran
Alex Tran•2y ago
it should be shown in the mount on your file system as library/<label>/
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
root@b5cf0923b9a3:/usr/src/app# ls -Alh
total 908K
drwxr-xr-x 2 root root 4.0K Nov 13 23:10 assets
drwxr-xr-x 2 root root 4.0K Nov 13 23:10 bin
drwxr-xr-x 7 root root 4.0K Nov 13 23:10 dist
drwxr-xr-x 401 root root 16K Nov 13 23:10 node_modules
-rw-r--r-- 1 root root 857K Nov 13 23:08 package-lock.json
-rw-r--r-- 1 root root 5.6K Nov 13 23:08 package.json
-rwxr-xr-x 1 root root 43 Nov 13 23:08 start-microservices.sh
-rwxr-xr-x 1 root root 36 Nov 13 23:08 start-server.sh
-rwxr-xr-x 1 root root 753 Nov 13 23:08 start.sh
drwxr-xr-x 2 root root 0 Nov 17 15:24 upload
root@b5cf0923b9a3:/usr/src/app# ls -Alh upload/
total 0
drwxr-xr-x 2 root root 0 Nov 17 15:17 usernameA
drwxr-xr-x 2 root root 0 Nov 17 15:20 usernameB
drwxr-xr-x 2 root root 0 Nov 17 15:20 library
drwxr-xr-x 2 root root 0 Nov 17 15:24 upload
root@b5cf0923b9a3:/usr/src/app# ls -Alh upload/library/
total 0
root@b5cf0923b9a3:/usr/src/app# ls -Alh upload/upload/
total 0
drwxr-xr-x 2 root root 0 Nov 17 15:24 3fb9942e-bdb7-4cd1-9ffc-8ca5cdedc0f4
root@b5cf0923b9a3:/usr/src/app# ls -Alh
total 908K
drwxr-xr-x 2 root root 4.0K Nov 13 23:10 assets
drwxr-xr-x 2 root root 4.0K Nov 13 23:10 bin
drwxr-xr-x 7 root root 4.0K Nov 13 23:10 dist
drwxr-xr-x 401 root root 16K Nov 13 23:10 node_modules
-rw-r--r-- 1 root root 857K Nov 13 23:08 package-lock.json
-rw-r--r-- 1 root root 5.6K Nov 13 23:08 package.json
-rwxr-xr-x 1 root root 43 Nov 13 23:08 start-microservices.sh
-rwxr-xr-x 1 root root 36 Nov 13 23:08 start-server.sh
-rwxr-xr-x 1 root root 753 Nov 13 23:08 start.sh
drwxr-xr-x 2 root root 0 Nov 17 15:24 upload
root@b5cf0923b9a3:/usr/src/app# ls -Alh upload/
total 0
drwxr-xr-x 2 root root 0 Nov 17 15:17 usernameA
drwxr-xr-x 2 root root 0 Nov 17 15:20 usernameB
drwxr-xr-x 2 root root 0 Nov 17 15:20 library
drwxr-xr-x 2 root root 0 Nov 17 15:24 upload
root@b5cf0923b9a3:/usr/src/app# ls -Alh upload/library/
total 0
root@b5cf0923b9a3:/usr/src/app# ls -Alh upload/upload/
total 0
drwxr-xr-x 2 root root 0 Nov 17 15:24 3fb9942e-bdb7-4cd1-9ffc-8ca5cdedc0f4
Alex Tran
Alex Tran•2y ago
here is what the filesystem should look like in the container
No description
Alex Tran
Alex Tran•2y ago
can you run apt-get install tree and then do tree -L 2 from the upload dir
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
root@b5cf0923b9a3:/usr/src/app# apt-get install tree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package tree
root@b5cf0923b9a3:/usr/src/app# apt-get install tree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package tree
From within the container or the host?
Alex Tran
Alex Tran•2y ago
from the container
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
It might be a restrictive firewall rule come to think of it. Let me fix that really quick Ok, i fixed where I'm mapping my user directories
root@8128b5f92c54:/usr/src/app# cd upload/
root@8128b5f92c54:/usr/src/app/upload# tree -L 2
.
|-- library
| |-- usernameA
| `-- usernameB
`-- upload
`-- 19db0c95-e657-48c4-9436-e26dc4054a31

6 directories, 0 files
root@8128b5f92c54:/usr/src/app/upload#
root@8128b5f92c54:/usr/src/app# cd upload/
root@8128b5f92c54:/usr/src/app/upload# tree -L 2
.
|-- library
| |-- usernameA
| `-- usernameB
`-- upload
`-- 19db0c95-e657-48c4-9436-e26dc4054a31

6 directories, 0 files
root@8128b5f92c54:/usr/src/app/upload#
But images don't seem to get moved to their respective directories The test file is the result of me doing a touch test within the contianer to verify it wasnt a permissions issue
root@8128b5f92c54:/usr/src/app/upload/library# tree -L 2
.
|-- usernameA
`-- usernameB
`-- test

3 directories, 1 file
root@8128b5f92c54:/usr/src/app/upload/library#
root@8128b5f92c54:/usr/src/app/upload/library# tree -L 2
.
|-- usernameA
`-- usernameB
`-- test

3 directories, 1 file
root@8128b5f92c54:/usr/src/app/upload/library#
Alex Tran
Alex Tran•2y ago
Can you elaborate?
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
I have a smaba share, i mount that as a volume within the compose file. I restructured it such that it now mounts to uploads as before but now within that folder, i start with a directory named library which contains 2 empty directorys usernameA and usernameB
Alex Tran
Alex Tran•2y ago
Are you creating those directory manually?
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
yes, as they ultimatly go back to a ro directories in sharedrive
Alex Tran
Alex Tran•2y ago
hmmmmmm
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
does immich expect to create the directories itself?
Alex Tran
Alex Tran•2y ago
I would say so So this is what I would do create a new Immich instance which Immich's default settings in docker-compose file create a new user with the label you wish to use login to that user and upload dummy image to get those directory create in the container Now try to map your samba drive to the library/<user-label and try to upload another dummy image to see if it gets put to the network drive as well as showing up in Immich
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
I think I'm following! 😄 I'll give that a go give me a few and I'll report back
Alex Tran
Alex Tran•2y ago
No problem, take your time
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
So with the default settings, no volume mounted to /usr/src/app/upload When I upload the image, I'm still getting the same behavior. The image uploads without error. the file is now in uploads and no folder is created in library I haven't even got to the other steps, so this is just a vanilla install basicly
root@933826d6d36a:/usr/src/app# ls -Alh upload/
library/ upload/
root@933826d6d36a:/usr/src/app# ls -Alh upload/library/
total 0
root@933826d6d36a:/usr/src/app# ls -Alh upload/upload/
total 4.0K
drwxr-xr-x 2 root root 4.0K Nov 17 16:18 3336d5a4-9f7b-49b7-ba13-6ebbbbc7eebc
root@933826d6d36a:/usr/src/app# ls -Alh upload/
library/ upload/
root@933826d6d36a:/usr/src/app# ls -Alh upload/library/
total 0
root@933826d6d36a:/usr/src/app# ls -Alh upload/upload/
total 4.0K
drwxr-xr-x 2 root root 4.0K Nov 17 16:18 3336d5a4-9f7b-49b7-ba13-6ebbbbc7eebc
Alex Tran
Alex Tran•2y ago
can you check if microservices is not starting up correctly? can you see the thumbnail and such? I don't see any thumb directory get created
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
Ohhh I didnt even look at that section. I jjust saw it also has volume mount as well that might be my issue let me see feeling silly. I think that was a lot of what my issue was. going to tear it all down and try again from scratch
Alex Tran
Alex Tran•2y ago
No problem 😄
DisgruntledQuokka
DisgruntledQuokkaOP•2y ago
That fixed it! Wow I feel silly. Sorry for waisting your time I will work to document this setup and and share it to the docs if you would like. I can see someone else trying to do what I have done, and it would be helpfull to have it all documented last nuke and pave and it's production 😄

Did you find this page helpful?