Turtle Kayak
Turtle Kayak
CCoder.com
Created by Turtle Kayak on 11/21/2022 in #help
TF_LOG verbose Terraform output?
How do I get Coder to show verbose Terraform logs? I'm trying to start a workspace but getting one of the Terraform AWS provider's less helpful error messages where it doesn't tell you what IAM action it doesn't have permission to complete:
$ coder start noah -y -v
✔ Queued [410ms]
✔ Setting up [57ms]
⧗ Starting workspace
Terraform 1.1.9
coder_agent.dev: Refreshing state... [id=2eb6446d-0ea6-41f9-97cb-b00927229958]
coder_agent.dev: Refresh complete [id=2eb6446d-0ea6-41f9-97cb-b00927229958]
aws_instance.dev: Refreshing state... [id=i-005de03cc94c5859e]
Error: reading EC2 Instance (i-005de03cc94c5859e): UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: 4c69c774-0b4e-40e4-858c-3d0b03c58b7b

✔ Starting workspace [6819ms]
✘ Cleaning Up [115ms]
terraform apply: exit status 1
Run 'coder start --help' for usage.
$ coder start noah -y -v
✔ Queued [410ms]
✔ Setting up [57ms]
⧗ Starting workspace
Terraform 1.1.9
coder_agent.dev: Refreshing state... [id=2eb6446d-0ea6-41f9-97cb-b00927229958]
coder_agent.dev: Refresh complete [id=2eb6446d-0ea6-41f9-97cb-b00927229958]
aws_instance.dev: Refreshing state... [id=i-005de03cc94c5859e]
Error: reading EC2 Instance (i-005de03cc94c5859e): UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: 4c69c774-0b4e-40e4-858c-3d0b03c58b7b

✔ Starting workspace [6819ms]
✘ Cleaning Up [115ms]
terraform apply: exit status 1
Run 'coder start --help' for usage.
When doing normal Terraform development and I run into this I get Terraform's verbose logs and trace the request id in the output to the API request, where I can then see the IAM action. I do this by setting the TF_LOG=1 env var in my shell. How might I do this in Coder?
3 replies
CCoder.com
Created by Turtle Kayak on 11/19/2022 in #help
Failed to accept WebSocket connection WebSocket protocol violation
I am overhauling our Coder server deployment. It is in a private AWS subnet with an AWS client VPN endpoint allowing my laptop to connect to the subnet. I can use the HTTP API (via simple commands like workspaces list in the CLI) and access the web dashboard. However when I run the template create command I get a weird networking error. This new deployment of Coder is much more locked down and only allows traffic on the port in the access URL. Additionally now the Coder server is behind an Nginx reverse proxy. Here is the full terminal output:
$ coder template create aws-linux --directory ./aws-linux/terraform --verbose
> Create and upload "aws-linux/terraform"? (yes/no) yes
⧗ Queued
WebSocket protocol violation: handshake request must be at least HTTP/1.1: "HTTP/1.0"
{"message":"Failed to accept websocket.","detail":"failed to accept WebSocket connection: WebSocket protocol violation: handshake request must be at least HTTP/1.1: \"HTTP/1.0\""}
.
logs: unexpected status code 426: WebSocket protocol violation: handshake request must be at least HTTP/1.1: "HTTP/1.0"
{"message":"Failed to accept websocket.","detail":"failed to accept WebSocket connection: WebSocket protocol violation: handshake request must be at least HTTP/1.1: \"HTTP/1.0\""}

Run 'coder templates create --help' for usage.
$ coder template create aws-linux --directory ./aws-linux/terraform --verbose
> Create and upload "aws-linux/terraform"? (yes/no) yes
⧗ Queued
WebSocket protocol violation: handshake request must be at least HTTP/1.1: "HTTP/1.0"
{"message":"Failed to accept websocket.","detail":"failed to accept WebSocket connection: WebSocket protocol violation: handshake request must be at least HTTP/1.1: \"HTTP/1.0\""}
.
logs: unexpected status code 426: WebSocket protocol violation: handshake request must be at least HTTP/1.1: "HTTP/1.0"
{"message":"Failed to accept websocket.","detail":"failed to accept WebSocket connection: WebSocket protocol violation: handshake request must be at least HTTP/1.1: \"HTTP/1.0\""}

Run 'coder templates create --help' for usage.
54 replies
CCoder.com
Created by Turtle Kayak on 8/17/2022 in #help
Coder SSH Not Respecting SendEnv & AcceptEnv?
On my local machine I have
# ~/.ssh/config
Host *
SendEnv INSIDE_EMACS
# ~/.ssh/config
Host *
SendEnv INSIDE_EMACS
And on my coder instance I have:
# /etc/ssh/ssh_config
Host *
AcceptEnv INSIDE_EMACS
# /etc/ssh/ssh_config
Host *
AcceptEnv INSIDE_EMACS
I restarted my computer and restarted the workspace instance. Inside my local terminal I run
export INSIDE_EMACS=y
coder ssh noah
export INSIDE_EMACS=y
coder ssh noah
Inside the remote terminal when I echo $INSIDE_EMACS the variable is empty. I know that Coder had a somewhat special SSH agent or something, is it possible that is interfering w the SSH env var setup?
20 replies
CCoder.com
Created by Turtle Kayak on 8/16/2022 in #help
Coder Templates Update Not A Command In v0.8.5
On the docs it says to use coder templates update <template> but when I try to run this command it says the only coder templates sub commands are create, delete, edit, init, list, plan, pull, push, and versions
4 replies