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?
No description
No description
14 Replies
Codercord
Codercord4w ago
<#1329739711564091392>
Category
Bug report
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Aericio
AericioOP4w ago
Same issue when creating with Docker containers template, my home directory belongs to root.
No description
No description
Aericio
AericioOP4w ago
on version 2.18.2, running coder w/ docker compose
Aericio
AericioOP4w ago
ah, for this, aericio isn't even an actual user... after i changed to this, seems to be ok now.
locals {
- username = data.coder_workspace_owner.me.name
+ username = "coder"
}
locals {
- username = data.coder_workspace_owner.me.name
+ username = "coder"
}
this affects volumes.container_path and coder_app.code-server.url
No description
Aericio
AericioOP4w ago
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
Phorcys
Phorcys4w ago
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 there
Aericio
AericioOP4w ago
I 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.
- #3: 🔄 Updating the ownership of the workspace...
- #3: 👤 Updated the ownership of the workspace! [629.966µs]
#4: 🔄 Updating ownership of /home/coder...
#4: 🏡 Updated ownership of /home/coder! [869.007µs]
- #3: 🔄 Updating the ownership of the workspace...
- #3: 👤 Updated the ownership of the workspace! [629.966µs]
#4: 🔄 Updating ownership of /home/coder...
#4: 🏡 Updated ownership of /home/coder! [869.007µs]
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 same
Aericio
AericioOP4w ago
GitHub
coder/examples/templates/docker-devcontainer at main · coder/coder
Provision remote development environments via Terraform - coder/coder
Aericio
AericioOP4w ago
also, here's the logs for when I used mcr.microsoft.com/devcontainers/typescript-node:22 by accident in repo url
Phorcys
Phorcys4w ago
yeah 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
Aericio
AericioOP4w ago
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
Phorcys
Phorcys4w ago
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
Aericio
AericioOP4w ago
cool, thanks!
Codercord
Codercord4w ago
@Phorcys closed the thread.

Did you find this page helpful?