Workspaces are seemingly not persisting data whatsoever.

Hi all. To keep things brief: when I create a workspace off of the "Docker Containers" starter template and save any files to my home directory (/home/coder), the files are totally lost after the workspace restarts. It is my understanding from reading docs that this is not supposed to be happening, and it's certainly not how I remember Coder behaving in the past. This is happening on a totally fresh Coder install (same behavior on coder server and a Docker run or docker-compose install). I'm not sure if it's related, but I see that the home_volume resource that's automatically created with the template is saying that "No agents are currently assigned to this resource", and that's just about the only clue I've otherwise got. Would be extremely grateful for any guidance.
No description
15 Replies
Codercord
Codercord2w ago
<#1329657486139195492>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Konstantine
KonstantineOP2w ago
And, if it is at all helpful, all I am really attempting to do for my use-case is setup workspaces with nvm/npm installed that persist.
Phorcys
Phorcys2w ago
hey, this is pretty weird did you modify the Dockerfile at all? the "No agents are currently assigned to this resource" is normal behavior for a Docker volume, agents are only assigned to compute in our templates
Konstantine
KonstantineOP2w ago
Nope—haven’t modified a thing Just tried this on an entirely separate host and I am having the same issue. Super weird.
Phorcys
Phorcys2w ago
really funky, if you something like touch /home/coder/test and restart, is it not there anymore afterwards? just want to make sure there's no weird symlink stuff with npm or whatver
Konstantine
KonstantineOP2w ago
Yup thats what I have been doing
Phorcys
Phorcys2w ago
ugh
Konstantine
KonstantineOP2w ago
Yeah super super weird It'd be one thing if I had done some extensive config changes or something But it's weird that it's happening across two completely different hosts with fresh installs
Phorcys
Phorcys2w ago
you're using this one, correct?
No description
Konstantine
KonstantineOP2w ago
Yeah
Phorcys
Phorcys2w ago
could you stop the workspace and send the logs that it outputs? just wanna see what it deletes nevermind, I can reproduce it @Konstantine I have no clue how this happened but replace line 198 with container_path = "/home/coder" and it'll work
Konstantine
KonstantineOP2w ago
You are a saint FWIW, and I haven't had time to confirm yet, but I think some of the other Docker based templates might have this issue as well But yeah that fix totally works, thanks a ton
Phorcys
Phorcys2w ago
I think this is the only one the devcontainers template is a bit different the PR that caused this issue is fix: remove built-in image for Docker template we have switched from building a local Dockerfile with a dynamic USER parameter to our enterprise-base image with the generic coder user, but we kept persisting /home/<coder username> instead of /home/coder so basically you had persistence, just in the wrong folder closing this one out
Codercord
Codercord2w ago
@Phorcys closed the thread.
Konstantine
KonstantineOP2w ago
Right that makes so much more sense. Thanks again

Did you find this page helpful?