how do i get coder to run all the time?
I understand what the below error literally means. just not in the context of coder.
listen tcp 127.0.0.1:3000: bind: address already in use
i ran the coder v2 install script and then set coder service to enable and run on reboot. but get the above error. so then i kill the process on port 3000. and run $coder server and everything works. but the coder server doesn’t run 24/7. because i killed the process
what am i missing?
Solution:Jump to solution
What if you change it like this
```env
#CODER_ACCESS_URL=
CODER_HTTP_ADDRESS=127.0.0.1:3000
#CODER_PG_CONNECTION_URL=...
14 Replies
<#1235332377358893106>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
There is something else running in port 3000
Edit your /etc/coder.d/coder.env file and change
CODER_HTTP_ADDRESS
port to another port
Or
Find what's running on port 3000 and kill that processi should have been clearer, it’s coder that is running on that port 3000.
i have the same issue, even after changing the port.
it’s failing and it gives no logs
coder.service - "Coder - Self-hosted developer workspaces on your infra"
Loaded: loaded (/usr/lib/systemd/system/coder.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2024-05-02 19:26:51 UTC;>
Docs: https://coder.com/docs/coder-oss
Process: 5690 ExecStart=/usr/bin/coder server (code=exited, status=1/FAILURE)
Main PID: 5690 (code=exited, status=1/FAILURE)
CPU: 39ms
About - Coder v2 Docs
About Coder
the webui is on a try coder domain. is this the problem?
i was able to figure out how to find the error
Failed to start coder.service - "Coder - Self-hosted developer workspaces on your infra".
May 02 18:51:20 localhost systemd[1]: coder.service: Scheduled restart job, restart counter is at 5.
May 02 18:51:20 localhost systemd[1]: Starting coder.service - "Coder - Self-hosted developer workspaces on your infra"...
May 02 18:51:20 localhost coder[931]: Encountered an error running "coder server", see "coder server --help" for more information
May 02 18:51:20 localhost coder[931]: error: configure http(s): listen tcp: address 1597: missing port in address
May 02 18:51:20 localhost systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
May 02 18:51:20 localhost systemd[1]: coder.service: Failed with result 'exit-code'.
May 02 18:51:20 localhost systemd[1]: Failed to start coder.service - "Coder - Self-hosted developer workspaces on your infra".
i changed the port to 1597. what else should i have changed?
can you share what do you have in
/etc/coderd./coder.env
filefarah@localhost:~$ cat /etc/coder.d/coder.env
Coder must be reachable from an external URL for users and workspaces to connect.
e.g. https://coder.example.com
CODER_ACCESS_URL=https://<>.try.coder.app
CODER_HTTP_ADDRESS=1597
CODER_PG_CONNECTION_URL=
CODER_TLS_CERT_FILE=
CODER_TLS_ENABLE=
CODER_TLS_KEY_FILE=
Run "coder server --help" for flag information.
Solution
What if you change it like this
And then run
i made the change and when i go the url this is the message
{"message":"Peer is not connected."}
Is it the same machine where you are running Coder and accessing it?
no. im going to my access url, https://<>.pit-1.try.coder.app/login and the error is
{"message":"Peer is not connected."}
i’m unable to keep the instance alive 24/7.
do i have to get my own domain name for that access url? i don’t understand what needs to be done.
the only way i can get to the access url is to do ‘coder server’ on the server but then that is only for testing. as you know. once the terminal closes the instance is offline and i get the message ‘peer is not connected’
you do not need to run
coder server
when you run it using the systemctl
as a service
It will keep running
Yes if you have your own domain thats the besti understand this. my original ticket is saying it is not running as a service, what do i need to do to fix this. the error is peer is not connected.
i can add a domain, but if that is not what’s causing the issue, i’ll add a domain after solving for coder not running on system start up.
Could you come in https://discord.com/channels/747933592273027093/1204825825476616202
Lets debug this
When its running as a servive you do not see the logs in your console.
you need to get the try.coder URL from the journalctl logs
these
After checking the correct URL, the coder service is running fine.