Access denied on everything
Hi guys.
I am currently unable to deploy new coder workspaces as nearly every single command fails on no permissions or nu such directory.
Its the same template we used for months and I was not changing anything in it.
Do you have any idea what is going on? I checked what I can think of and I am unable to find any issue
I attach the log and my templates.
Main.tf: https://paste.brcb.eu/ynyqudepyp.sh
Dockerfile: https://paste.brcb.eu/zeloseqaby.properties
10 Replies
<#1371064742243991583>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
does
/home/simonc
actually exist?
if it can you send the output of the following commands:
- id
- stat /home/simonc
- stat /home/simonc/filebrowser.db
also, fyi, in your startup_script
, you should be able to use $HOME
instead of templating every time (e.g on L172 of your main.tf)
Yes, the folder exists. Here is the output of commands you asked me to send 🙂
does this only happen on new workspaces or existing ones too ?
@Šimon Čecháček I found the issue, your Docker image is not creating the home folder
so, what happens when a volume mount is first created in Docker is that if the folder exists in the container, it's going to copy the contents and permissions inside the volume and continue from there
on the other hand though, if it doesn't exist, Docker will create the folder with
root:root
permissions, which is what's happening in your case because the folder didn't exist prior to the volume mount's creation
so you should edit L39 of your Dockerfile to create the home folderHi there. sorry for the delay
only new ones
One thing is that for me is /home/simonc, but the username should be changing for the user creating the workspace.
I changed the the line to
RUN useradd --groups sudo --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
But that did nto help.
I explicitely added:
and now it looks like it works 😄 Not sure if this is the correct solution though.use
adduser
instead, that'll create the home folderI had the same issue, and this fixed it for me. Thank you!!
Will try after school finals. Now this workaround works 😄 thanks for the help!
Any idea what happened as it stopped working after months?
i think we changed the base image or something
but honestly i'm unsure