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?
No description
25 Replies
Codercord
Codercord4mo ago
<#1265343607724834978>
Category
Other
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Atif
Atif4mo ago
Are both of them stopped? Or is the workspace with gray color the one in a stopped state?
ShamesBond
ShamesBondOP4mo ago
They are both stopped
Phorcys
Phorcys4mo ago
I think this is to indicate how long ago it was stopped
ShamesBond
ShamesBondOP4mo ago
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
Phorcys
Phorcys4mo ago
for me it was always correlated to the "last used" time or atleast it seems to
Phorcys
Phorcys4mo ago
No description
ShamesBond
ShamesBondOP4mo ago
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
ShamesBond
ShamesBondOP4mo ago
No description
ShamesBond
ShamesBondOP4mo ago
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?
Phorcys
Phorcys4mo ago
ooh that they all should be how are you shutting Coder down ?
ShamesBond
ShamesBondOP4mo ago
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 command
Phorcys
Phorcys4mo ago
does the workspace always do this? like if you restart it
ShamesBond
ShamesBondOP4mo ago
No, only while the box is stopped
No description
ShamesBond
ShamesBondOP4mo ago
If I start and stop it the Agent is taking too long message shows up again
Atif
Atif4mo ago
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 agent
ShamesBond
ShamesBondOP4mo ago
Gotcha, 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].id
What am I missing?
Atif
Atif4mo ago
Try replacing 0 with count.index
ShamesBond
ShamesBondOP4mo ago
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 ?
Atif
Atif4mo ago
It should work
ShamesBond
ShamesBondOP4mo ago
Thanks for the help, that does seem to work
Phorcys
Phorcys4mo ago
great to hear! can we close this thread?
ShamesBond
ShamesBondOP4mo ago
Go for it, I don't see a way to via mobile
Phorcys
Phorcys4mo ago
alright, the command is /close but i'll run it for you :-) I need to make that clearer in the bot
Codercord
Codercord4mo ago
@Phorcys closed the thread.
Want results from more Discord servers?
Add your server