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.15 Replies
<#1329657486139195492>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
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.
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
Nope—haven’t modified a thing
Just tried this on an entirely separate host and I am having the same issue. Super weird.
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 whatverYup thats what I have been doing
ugh
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
you're using this one, correct?
Yeah
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 workYou 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
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@Phorcys closed the thread.
Right that makes so much more sense. Thanks again