Issue with coder_access_url
Hi,
I'm launching coder through a terraform-script using the official AWS AMI.
After changing the CODER_ACCESS_URL=http://...... I still get forwarded to some random address in us-east i.e https://hd45esvj629ve.pit-1.try.coder.app/ when trying to access it.
Why is this happening? Is it because of the HTTP-usage or is it something else that needs to be configured.
I have no option to use https at the moment since everything is for internal testing purposes.
Thank you for the help.
5 Replies
<#1199755640713777213>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
where are you defining your CODER_ACCESS_URL ?
it seems that coder isn't seeing it
Done both ways.
Export and edit the env. in /etc/coder.d/coder.env. Tried both without the other as well.
EDIT: I dont know how this is supposed to work but it seems I need to change both of them in order for coder to start succesfully
Also finding errors in my journalctl -u coder.service -b. According to the logs coder still wants me to specify the http:// or https:// for the address.
EDIT: Get no error now, I was tired yesterday and forgot to put http:// in coder.env.
Although, when I "coder server" it I get no error from the booting process of coder, it just says that it connected successfully to my RDS and also gives me the address to the Load Balancer.
Edit: Seems as if coder has started, now I get a time-out when trying to connect to it, both through the nlb and the instance public IP.
![No description](https://cdn.answeroverflow.com/1200001077970477137/Screenshot_2024-01-25_at_09.42.20.png)
![No description](https://cdn.answeroverflow.com/1200001078192766986/Screenshot_2024-01-25_at_09.46.19.png)
![No description](https://cdn.answeroverflow.com/1200001078410891305/Screenshot_2024-01-25_at_09.49.32.png)
All seems to be working now.
For future if someone has the same issue (and I don't know if this is needed but in my case) I needed to specify the CODER_ACCESS_URL variable in both places.
In my user_data it looks something like this.
#Configure env for coder
sed -i 's#CODER_ACCESS_URL=#CODER_ACCESS_URL=${web_url}#' '/etc/coder.d/coder.env'
sed -i 's#CODER_PG_CONNECTION_URL="postgres://coder:coder@localhost/coder?sslmode=disable"#CODER_PG_CONNECTION_URL="postgres://${db_username}:${db_password}@${rds_endpoint}/coderrds?sslmode=disable"#' "/etc/coder.d/coder.env"
#Configure the env.
echo export CODER_PG_CONNECTION_URL="postgres://${db_username}:${db_password}@${rds_endpoint}/coderrds?sslmode=disable" >> /etc/profile
echo export CODER_ACCESS_URL="${web_url}" >> /etc/profile
Another question for that someone might have the answer to.
I'm got my EC2s in eu-north, when using the templates that comes with the basic installation the template region is specified to us-east.
Is this something that I need to configure with coder or what's happening?
You can edit the template to update the region
And it's a bit weird that you needed to specify the CODER_ACCESS_URL at both places.
Are you running as a system service or on CLI using
coder server