I
Immich•3y ago
Shrung

Server not getting to UPLOAD_LOCATION

Hi, I'm using an ubuntu VM in proxmox, with portainer. I've added a new drive to my ubuntu VM, mounted it and made a directory for photos: /database/immich_photos In deployment of the stack, I changed all - .env to - stack.env My environment variables:
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/database/immich_photos
TYPESENSE_API_KEY=some-random-text
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/database/immich_photos
TYPESENSE_API_KEY=some-random-text
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003
My deployed server shows only 3.9GiB of space, and uploaded photos are not landing in /database/immich_photos Perhaps it is a permissions issue? Usually in portainer I make my volumes using portainer, and they come out as root owned directories, not sure if I need something different for this use case. Thanks for any help! I'm super excited to try this out 😄
No description
41 Replies
Shrung
ShrungOP•3y ago
My volumes created by the stack appear as shown above if that is useful.
Alex Tran
Alex Tran•3y ago
The UPLOAD_LOCATION should not be the volume that is created by docker it should be an existing folder on your machine that you have access to
I've added a new drive to my ubuntu VM, mounted it and made a directory for photos: /database/immich_photos
Have you made sure that this folder is mounted? Can you check with lsblk?
Shrung
ShrungOP•3y ago
Here you can see the ls-l from within /database, and then lsblk
No description
Shrung
ShrungOP•3y ago
and here I've made a test file to be sure it's really mounted and working.
No description
Alex Tran
Alex Tran•3y ago
Hmm, it is mounted as root probably why I should be mounted as your user ajm
Alex Tran
Alex Tran•3y ago
No description
Shrung
ShrungOP•3y ago
okay, I've chowned them, I'll give it a try! deleted everything and rebuilding from scratch to see if that fixed it
Alex Tran
Alex Tran•3y ago
okay!
Shrung
ShrungOP•3y ago
Interesting, after deleting the stack and all associated volumes in portainer, I remade the stack and deployed it, and I get this:
No description
Shrung
ShrungOP•3y ago
After recreating the admin account of course. It's odd because it shows the used space I had previously (the small photo dump I tested with to see if it was landing in the right spot
Alex Tran
Alex Tran•3y ago
try /database for the upload_location
Shrung
ShrungOP•3y ago
This is from in the container, I haven't uploaded since I wiped and redeployed. Somehow the 1.5gb I uploaded before has persisted.
No description
Alex Tran
Alex Tran•3y ago
from /database can you do df -h?
Shrung
ShrungOP•3y ago
and I can see the volume mounted as it should be, so I'm not sure what is up
No description
Shrung
ShrungOP•3y ago
yeah, I see the 2TB from that in my vm shell, from in the container shell you can see the 3.9G
Alex Tran
Alex Tran•3y ago
maybe restart the VM?
Shrung
ShrungOP•3y ago
No description
Shrung
ShrungOP•3y ago
I think it must be some black magic with portainer and bind mounts... I suspect there is some 'portainer-path'/database/immich_photos that portainer generated
Alex Tran
Alex Tran•3y ago
I am not sure, I haven't heard anything about this scenario yet. @Zack when you have a chance can you help explain this scenario? Did you create this volume in Portainer?
Shrung
ShrungOP•3y ago
It was created by the docker-compose stack setup After restarting the vm, the upload directory is empty again, but it is still only 3.9GB
Alex Tran
Alex Tran•3y ago
lsblk still show the mount after restarting?
Shrung
ShrungOP•3y ago
yeah, still mounted as expected from the vm
No description
Alex Tran
Alex Tran•3y ago
instead of mount to /database/immich_photos just try /database in the UPLOAD_LOCATION
Shrung
ShrungOP•3y ago
okay, I'll try that. If I stop the container and go to edit it, I can see it is correctly set as a Bind, and the paths look correct
No description
Shrung
ShrungOP•3y ago
same result using /database, still 3.9G inside the container
Alex Tran
Alex Tran•3y ago
the host still shown as /database/immich_photos though
Shrung
ShrungOP•3y ago
I just didn't do a new screenshot, that was the previous one:
Shrung
ShrungOP•3y ago
No description
Alex Tran
Alex Tran•3y ago
ok how about this you create a new directory at /mnt/immich_data then mount your drive to that location then use /mnt/immich_data for your upload_location remember to chown it and make sure it has the correct user and group permission
Shrung
ShrungOP•3y ago
GitHub
Bug? Error bind-mounting with Portainer, but not with the actual cl...
Question: NOTE: Using WSL2 and Swarm. When I use this in Portainer's stack editor, and then click the deploy/update button, I get an error: version: "3.7" services: pihole: hostname: ...
Shrung
ShrungOP•3y ago
"When creating the docker compose through Portainer it fails with a compose file that works fine outside of Portainer. I discovered that outside of Portainer my paths, when not relative, must include /mnt/DRIVE-LETTER/path/to/location but within Portainer they must NOT have /mnt & must start with the drive letter. an example path that works Outside Portainer but does not work inside Portainer /mnt/k/docker/tv/xteve/conf:/home/xteve/conf An example of a path that works Inside Portainer but not outside /k/docker/tv/xteve/conf:/home/xteve/conf"
Alex Tran
Alex Tran•3y ago
nice so you need that /mnt
Shrung
ShrungOP•3y ago
Seems I HAVE to use a directory starting with /mnt, and portainer doesn't want to be told /mnt rebooting everything with fingers crossed!
Alex Tran
Alex Tran•3y ago
yahheeh
Shrung
ShrungOP•3y ago
hmmm, now I have the drive mounted at /mnt/database, with the immich_photos folder present, and I am giving it /database/immich_photos as the path as described in that page, same result going to try giving it /mnt/database/immich_photos now
Alex Tran
Alex Tran•3y ago
yeah you should be doing this instead
Shrung
ShrungOP•3y ago
aha! success! So I guess that guys issue with /mnt being ignored has been fixed, but it seems portainer needs specific directories for binds to work properly, and one of those is /mnt So in the end, I'm using /mnt/database/immich_photos as my UPLOAD_LOCATION, and I have my drive mounted on /mnt/database
Alex Tran
Alex Tran•3y ago
Yeah I think that should work, you can use /mnt/database but I assume you want that sub level to split things up
Shrung
ShrungOP•3y ago
yeah, I'm planning to keep backups in photos /mnt/database/photos that is
Alex Tran
Alex Tran•3y ago
well enjoy, let us know if you run into any other issues
Shrung
ShrungOP•3y ago
Will do! Thanks again for helping me troubleshoot portainer, haha!

Did you find this page helpful?