Permission Issues on fresh containers
Hello! I just set up my coder project, and created a workspace with the default
Devcontainers (docker)
template. It created successfully, but when I opened the project in vscode, I kept getting no permission errors when trying to create files. So I checked the permissions in the terminal, and the project was created with root as the owner. Any ideas why the permissions aren't being set correctly by default?

14 Replies
<#1329739711564091392>
Category
Bug report
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Same issue when creating with
Docker containers
template, my home directory belongs to root.

on version 2.18.2, running coder w/ docker compose
ah, for this,
aericio
isn't even an actual user... after i changed to this, seems to be ok now.
this affects volumes.container_path
and coder_app.code-server.url

does the default template have an issue then?
changed from
/workspaces
to /home/coder
instead, not sure how to fix /workspaces
perm in tf
oh but the git clone still going to /workspaces
yeah so this line is good as-is, the proper fix would be to replace line 198 with
container_path = "/home/coder"
instead, see my comment about why this issue is happening
in the latest version it does, yes
now for this, you do want it to stay as /workspaces
since this is how it was intended, could you send the parameters that you inputted when creating the workspace?
the folder name should never be javascript-node:22
, the :22
is most definitely what's causing issues thereI was initially confused about the "Repo URL" link, I thought it meant to link to a devcontainer image so I put in
mcr.microsoft.com/devcontainers/typescript-node:22
. It parsed it as a git url and tried to clone it (created an empty repo).
I think I found the problem though; when the git repo is empty, the step in red is skipped.
Reproduction:
- I am not providing .devcontainer
, so using fallback image in both cases
- Set repo URL as one of
- Non-empty repo: https://github.com/Aericio/silver-guacamole
- Empty repo: https://github.com/Aericio/expert-memory
- Keeping everything else the sameoh also, used this template w/o modifications
https://github.com/coder/coder/tree/main/examples/templates/docker-devcontainer
GitHub
coder/examples/templates/docker-devcontainer at main · coder/coder
Provision remote development environments via Terraform - coder/coder
also, here's the logs for when I used
mcr.microsoft.com/devcontainers/typescript-node:22
by accident in repo urlyeah that makes sense, we should look into fixing it
yeah so in your case you'll want to pick one of the starter devcontainer images and clone the repo afterwards
in your case, using the Repo URL field doesn't make sense since you do not have a devcontainer spec in the repo
or, create a devcontainer spec in your repo
it still makes the repo folder anyways though, so why couldn't it set perms regardless?
it sets perms fine when i use non-empty repo without devcontainer file
yea was being lazy, will do
that is true, but i still want to point out this is not the intended use for this template
there might be something it's waiting for in the build pipeline that just fails
i'll create issues to fix these issues you've encountered and add more friendly error messages
cool, thanks!
@Phorcys closed the thread.