Failed to create upload/encoded-video
During initial startup of the immich server using sudo docker compose up, Error message stated as the screenshot attached states. Error with Creating a file. I wonder if I have done something wrong with my setup and by sending docker and .env + listing permisions to help me solve this.

161 Replies
:wave: Hey @Mackan,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time).
2. :blue_square: read applicable release notes.
3. :blue_square: reviewed the FAQs for known issues.
4. :blue_square: reviewed Github for known issues.
5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: uploaded the relevant information (see below).
7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.What is the preferable way to send docker compose in?
and or .env
Oh I saw the link
too many carachters for discord
dang
I hope this work
If this is truly the first run of immich and you haven't started it, then updated the upload location and restarted it, then the error is saying that wherever your upload location is set too, immich can't write the files. So it's a permission issue on the host.
This happened on the first time I ran immich-servers yeah. I only ran the postgres database initially for the restore. I was going to paste the more information on this later on, and it is that the upload location is set to the uploads folder on a nfs share, I am not an expert in permissions but I do think I did it right, but becasuse I get errror then probobly not or maybe it is the docker user or something. And to my second question regarding which is why I marked it as a question, I set the upload location in the .env file to the uploads folder where I have all uploaded content in terms of photos and videos like all uploaded via immich. I browsed the profile and the library locatino on my old instance but they seemed empty except the profile where one used had a image uploaded which was me and I can just reupload it again. But when I set uploads location will immich create the rest of folders like library, profile, video... in /usr/app/...... except the uploads folder which it will alread read and upload to as specified in the .env file for uploads locations?
I tried to make that paragraph understandle but don't be afraid to ask for clarificatin š
Where did you backup / restore from and to? Does the new device have proper permissions on the nfs share?
from my truenas to a vm running ubuntu on the same machine using truenas virutalisation feature:
etc/exports file
My fstab mount entry on my vm running docker

using ls -l to see the permissions on the mouted file in vm
Is there anything more I can provide to make it easier to maybe figure the issue out?
Are these hosted straight through docker or first mounted on the host?
If the latter, try making a file or directory through the host and compare permissions to those already there
I am unsure what you mean with this. Mind elaborating
Perms look fine, can you
ls -la
inside the folder?the uploads folder?
Yes
my gut is saying that this is incorrect:
user1@admin-ubuntu:/mnt/truenas-shares/immich/uploads$ ls -la
total 56
drwxr-xr-x 8 root root 9 nov 30 18:04 .
drwxr-xr-x 9 root root 4096 dec 15 11:43 ..
drwxr-xr-x 258 root root 258 apr 28 2024 0d8dbfe8-939c-472d-98c1-9a8573c2f85d
drwxr-xr-x 258 root root 258 maj 9 2024 2ef8c364-b4de-40ca-a901-de6b22e731fa
drwxr-xr-x 3 root root 3 apr 28 2024 4a6c84f2-5686-40ab-b4dc-6921520ae745
drwxr-xr-x 258 root root 258 maj 11 2024 5c2cd7f9-23c4-4c6c-af3a-15cbfb6c4af7
drwxr-xr-x 258 root root 258 maj 2 2024 7d840a2e-d16c-40df-928c-4ed6d2220a12
drwxr-xr-x 258 root root 258 apr 19 2024 b721a15a-612d-4415-a9c9-8a5093d2a0d6
-rw-r--r-- 1 root root 13 dec 14 16:48 .immich
user1@admin-ubuntu:/mnt/truenas-shares/immich/uploads$
Yeah that looks like upload/upload and not upload/
yeah that is the folder users uploaded assets to on my old instance
By which I mean the env var "upload location" actually corresponds to the folder that contains upload, library, encoded-video, profile and thumbs
oh
how would I specify the uploads uploads folder then?
maybe that is what is wrong then
With family right now so a bit difficult to type it all out š I'll get back to you later if noone else has, but there are examples floating around
Oh okay, Terribly sorry to disturb if you are with family. But thanks for the help so far. I love immich and just wanted it to work and I can wait it is no problem
just don't forget it š
Haha what do you mean disturb, I'm just on my phone here
I could try to find the examples right
haha, celebrating christmas?
or just the holiday
Just visiting
What hobbies do you have?
Where does that come from? lol
oh, I wanted to start a small convo
Maybe not suited here
sorry.
All good. If anything that's probably for #off-topic :)
Yeah š
is this something I need to backup?

I skipped specifiying the library folder on my old instance because it seemed empyu
I did not think of hidden files
Nope
I know I should not ask but looks in docs instead but what is it for the library?
I have used immich a lot on the old instance so it is not really new
Assets end there if you're using the storage template
oh alright
FWIW the folder names & structure overall are quite confusing and we plan on changing that soon (tm) because it's just a mess tbh
I get confused by them when I was reading the docs so I do agree
But that sounds like a rather simple fix
except updating all docs, and the latest compose files etc
Yeah, it'll be a breaking change for literally everyone
lol
That's never a simple fix or something to take lightheartedly
I'm looking forward to the day
So many confusions solved :prayge:
okay, so Now I get this error instead:
:NOP:
so it is probably a issue with permissions
should I try to manually create it?
user1@admin-ubuntu:/usr/src/app$ ls -la
Can you show your compose/env files?
Yes š
No, you should fix your perms on truenas so that immich can create files
Okay
Oh thaaaanks
I got it to wokr I think :DDDDD
It was permissinos in truenas
the dataset was only set to allow read and excecute on it for other than owners iirc
Is there a way to chek if it works, like if all assets can be accessed and that it was restored correctly?
like a scan of some sort
Oh nice!
Immich checks all mounts on start up at least
Checking individual assets can be partially done by looking at the repair page, though that's quite broken atm lol
oh alright
wat is the link to bypass oauth?
I should google sorry
I'll also close this
Huh?
I found it
Ah k lol
autolaunch=0
is this because i did not specify any existin thumbs path?

all images are like tat
yes
you can recreate all thumbs through the admin menu
I have ehm terrabytes of photos
will it take a while
haa
Yes
depends on your hardware, but yes š
wait

shit
there are a load bunh of errors here suddenly
when I started generating
:PepeHands:
Maybe i can ignore it
you can check the asset at your.url/tld/photos/assetid to see if it works

nope
any thumbs appearing in the folder?
where do I check those?
UPLOAD_LOCATION/thumbs
Check if the folder size is increasing i.e. there is at least some successoh dang, it got in the wrong place:

);
this is not good
17k

I need to fix this asap
Im freaking out
step 1: shut immich down
done
step 2: post your actual compose
and env
if you changed them from earlier ^
this is it
did not change it
- ${UPLOAD_LOCATION}:/usr/src/app/upload/uploadš¤ That doesn't sound right it should be
- ${UPLOAD_LOCATION}:/usr/src/app/upload
Mackan was asking where the upload/upload folder is located
But yeah setting
UPLOAD_LOCATION
to that is not a great idea lolI set it to that in the beginning
I think
but upload and upload/upload is confusing
Yeah true
I want the uploads folder where my uploaded photos are to be the nfs share mnt/truenas-shares/immich/uploads and be read and uploaded there but the rest should not be on the nfs share but locally on the vm
That'll be library, inside the UPLOAD_LOCATION
hmm?
When not using storage template? :monkaHmm:
I do not use storage template engine thing no
Env file:
This should cover both cases
You specify a local folder for thumbs, profile and video
The above folder is on the NAS
Which means the folders library and upload are also on the nas
So the
/mnt/NAS/uploads
folder should be the folder that contains library
and upload
on your NASlet me read through this creafully now
ANd replace
/mnt/truenas-shares/immich/
with whatever path on the VM you want these folders onso the? immich/uploads?

or the immich/library too?
when I did those originally I followed this: https://immich.app/docs/install/truenas/#setting-up-storage-datasets
right I see
Env file:
Something like this then, where you explicitely specify all folders
Though I am confused how these folders are supposed to get on the VM?
I mount them using nfs shares? or wdym
What's the path for these folders on your VM so I can use that instead of getting confused š
user1@admin-ubuntu:/mnt/truenas-shares/immich/uploads$ ls
0d8dbfe8-939c-472d-98c1-9a8573c2f85d 4a6c84f2-5686-40ab-b4dc-6921520ae745 7d840a2e-d16c-40df-928c-4ed6d2220a12 backups library thumbs
2ef8c364-b4de-40ca-a901-de6b22e731fa 5c2cd7f9-23c4-4c6c-af3a-15cbfb6c4af7 b721a15a-612d-4415-a9c9-8a5093d2a0d6 encoded-video profile upload
?

yeah but you wanted them local on the VM instead of on the NFS share?
yeah
I have not created the local ones yey
yet
I will do it in /home/user/immich/
i tink
Right so what's the plan then š first recreate all thumbs on the network and then move to local? seems weird to me
it would be better to just get tumbs directly from the nfs share too?
I just want to migrate my immich from truenas scale app to docker compose in vm
I did nfs to not have to copy the data to the vm
to instead access over internet
does that answer it?
right so is it mounted on your VM with just the
/mnt/truenas-shares/immich
or each individual share?each individual becasue nfs could not share subdatasets without issues it seemed
I had the fstab here somewehre

that is all mountd rn
so no thumbs, video yet right?
no path shared using nfs shares
It is diffucult to explain it
Env file:
I think I did not miss any, this should be what the paths actually are for you. I've added a top folder with "DATA_LOCATION" just in case over at /home/user/immich for anything I missed, this is what other people have with
UPLOAD_LOCATION
Fill in the thumbs and video location if need be.so I should mount the thumbs, videos, profiles, library from my nas on those paths?
because that would work
you don't have to but the path has to exist and be writeable of course (and it probably needs an .immich file)
should I delete the wrongfully created folders in /uploads now then
and then restart
where will pgbackup be stored now?
In whatever you define as top level folder under a subfolder backups
is thumbs supposed to have a sub folder called immich-tumbs
ok

No
ill put the path for thumbs to .../immich/thumbs/immich-thumbs
then
For reference, all folders look like this (except backup)


That'll be 5 users + admin
yep
it for my family
š
is the id beginning with 0 admin?
or how did you know
because every admin has its own folder regardless š
oh
haha
big brain
[Nest] 17 - 12/26/2024, 7:51:49 PM ERROR [Api:StorageService] Failed to write upload/library/.immich: Error: EACCES: permission denied, open 'upload/library/.immich'
:peepoCryingAlot:
any tips?
For a permission denied? Not really, other than "check your permissions" š
The only special thing I see for yours is "root:nogroup"
it is so many places to check right?
immich_server can't write to that location for a reason I can't tell you because it's all on your system
it can't read on upload/backup/.immich either
what is wrong here:

It should be right
gave it the ol' 777 huh?
My guess is it's a truenas ACL thing but I don't know anything about those
I did sudo chmod -R 777 /mnt/truenas-shares/immich/ but regretted it afterwards
im fucked
I hope not
I don't think it broke things tbh
Yeah don't
You can change perms in the dataset settings in the webui
it's just bad juju
Shouldn't have broken anything though, yep
good phew
I'd expect truenas will just override it once you change the ACL
bad juju?
voodoo, magic, whatever
looks like this but yeah this is truenas so

I should maybe do recursivley
idk
it did not help to do it recursively so idk
You need to tick "apply group"/ "apply user" as well, depending on what you changed
yeah I did
Oh wait, also: you shouldn't have a separate dataset for library
As that causes actual file moves instead of efficient "fs does some magic" operations when moving files there
Generally you should just have one Immich dataset
I followed this stating it should be seven datasets: https://immich.app/docs/install/truenas/#setting-up-storage-datasets
lol
I will starup the old one and continue tomorrow
Maybe it's not an issue anymore? Let me check back with other people
not sure, But I don't know if I have to say again, but I am very thankful for any help I am relatively new to linux and all so I may make mistakes here an there
so thanks
Have a nice remaining day!
Since I got this error,
If I specify a directory for the backup location locally where it should be able to have permissions?
Daniel
I... ehm
I don't know if I should have done
but I manually created the .immich file
amd then everything started up
but as it said in docs the .immich is made to see if permissions are valid right
so maybe that was dumb
But how can I verify that immich works now?
can immich do a permissions scan using admin gui or something
because I can see all images amd their dumbnails along with geo data
I haven't tried downloading any image yet
or uploading
Nope, the startup check was the scan
can I run the startup scan again?
would that show me something
Well, restart Immich :D
Then you can see if Immich can write to those files at least
does it recheck if the file already exists?
Yeah
I restarted it and it works
I can upload conent from admin account and delete content
Well, at initial startup it sets a flag in the DB stating that the file should be there. Every subsequent restarts check the file's presence and if it can write to it
and generating thumbnails for new content works
sorry, I interuped there daniel
But I am happy now
No worries!
I just need to setup authentik and npm now š
haha
to get Oauth to work
If you haven't decided on an IDP yet, check out Zitadel. It's less feature rich, but I personally quite like it and I find the UI better (more intuitive and snappier) than authentik's
Obv that's very much personal preference. You should just use whatever works best for you
I use authentik right now, But I am not sure if I will need to redo the configuration, if then I could use something else. I will check Zitadel out š
But overall thanks for the help, I will close this help forum now š
Have a good rest of christmas and good new year
happy new year*
how do I close?
You too! :)
This thread has been closed. To re-open, use the button below.