What do "Last Used" icon colors indicate
I don't see any difference between instances that have an orange icon and ones that have a gray icon. I'm assuming this is indicating how the workspace was stopped, but which color means what?
25 Replies
<#1265343607724834978>
Category
Other
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Are both of them stopped? Or is the workspace with gray color the one in a stopped state?
They are both stopped
I think this is to indicate how long ago it was stopped
It doesn't seem correlated with stop time @Phorcys I have workspaces that have been stopped for longer that have either orange or blue icons
I'll have to dig into the code to find the difference I guess
for me it was always correlated to the "last used" time
or atleast it seems to
So it looks like the color is based on the fact that coder is trying to connect to the coder agent on the server which gets stopped
I'm not sure why some would be trying to access the coder agent and others wouldn't, is there something I can change in my template to get it to stop trying to connect when the server is stopped?
ooh that
they all should be
how are you shutting Coder down ?
I'm using a modified
AWS EC2 (Linux)
template which stops the ec2 instances when the workspace is stopped, coder server is in the cloud and always running. I stop the workspace by mostly using the coder interface, sometimes I'll use the coder stop
commanddoes the workspace always do this?
like if you restart it
No, only while the box is stopped
If I start and stop it the Agent is taking too long message shows up again
This is happening because the
coder_agent
resource isn't being destroyed on stop
You need to use the data.coder_workspace.me.start_count
to manage life cycle of the agentGotcha, so if I add
count = data.coder_workspace.me.start_count
to my resource "coder_agent" "app" {
and try to build, it complains that my references to coder_agent.app.id
are wrong. If I change all my references to coder_agent.app[0]
like the template shows I get the following:
The given key does not identify an element in this collection value: the collection has no elements. Error: Invalid index on main.tf line 234, in resource "coder_app" "app": 234: agent_id = coder_agent.app[0].idWhat am I missing?
Try replacing 0 with count.index
I was able to get that to build with the following caveats:
1. I had to add the same
count
to every struct that used count.index
2. I had to stick with [0]
in the locals.user_data
where it runs sudo -u ${local.linux_user} sh -c '${try(coder_agent.app[0].init_script, "")}'
Does that sound right @Atif ?It should work
Thanks for the help, that does seem to work
great to hear!
can we close this thread?
Go for it, I don't see a way to via mobile
alright, the command is
/close
but i'll run it for you :-)
I need to make that clearer in the bot@Phorcys closed the thread.