Aaron Taylor
Aaron Taylor
CCoder.com
Created by Aaron Taylor on 7/1/2024 in #help
GCP VMs fail to start sporadically with "desired_status can only accept RUNNING value" error
We are using Coder to manager GCP VMs with devcontainers, and occasionally the machine will get into a state where it is unable to start, getting the following terraform error:
Error: When creating an instance, desired_status can only accept RUNNING value
on main.tf line 334, in resource "google_compute_instance" "vm":
334: resource "google_compute_instance" "vm" {
Error: When creating an instance, desired_status can only accept RUNNING value
on main.tf line 334, in resource "google_compute_instance" "vm":
334: resource "google_compute_instance" "vm" {
Are there any tools available to debug this? One workaround I've seen is to change some of the machine parameters that cause it to be re-created, e.g. it's size, but that's rather annoying to have to do.
3 replies
CCoder.com
Created by Aaron Taylor on 6/12/2024 in #help
Coder envbuilder container starts logging 401 errors when using "Update" option
I am seeing an issue where when I use the "Update" option in the coder dashboard after a template change, the coder process get stuck in this state, where it gets 401 errors trying to talk to the coder agent URL. The issue is resolved by using the "Restart" option instead.
2024-06-12 19:43:20.920 [info] connecting to coderd
2024-06-12 19:43:20.934 [warn] run exited with error ...
error= GET https://coder.example.com/api/v2/workspaceagents/me/rpc?version=2.1: unexpected status code 401: unexpected non-JSON response "": Try logging in using 'coder login'.
Error: no response body
2024-06-12 19:43:20.920 [info] connecting to coderd
2024-06-12 19:43:20.934 [warn] run exited with error ...
error= GET https://coder.example.com/api/v2/workspaceagents/me/rpc?version=2.1: unexpected status code 401: unexpected non-JSON response "": Try logging in using 'coder login'.
Error: no response body
I am using "token" authentication with the coder agent, with config passed to the container for the auth as :
{
name = "CODER_AGENT_TOKEN"
value = try(coder_agent.main[0].token, "")
},
{
name = "CODER_AGENT_URL"
value = data.coder_workspace.me.access_url
},
{
name = "CODER_AGENT_TOKEN"
value = try(coder_agent.main[0].token, "")
},
{
name = "CODER_AGENT_URL"
value = data.coder_workspace.me.access_url
},
9 replies
CCoder.com
Created by Aaron Taylor on 6/11/2024 in #help
Persisting container state across workspace restarts
I am working on setting up development environments with envbuilder, and I would like to emulate the behavior of GitHub Codespaces, where a container is only re-created during a "rebuild" which is distinct from a "restart" in their system. The motivation for this is to persist dotfiles changes that the user may have made. Is there a way to do this? I've been through https://coder.com/docs/templates/resource-persistence and tried disabling the "count" parameter on the coder_agent terraform resource in the template, but the container is still being re-created.
12 replies