Cant start coder on windows pc

Hello i want to start my coder server but i get this error form postgres: Encountered an error running "coder server" Usage: coder server [flags] Error: Failed to start built-in PostgreSQL. Optionally, specify an external deployment with --postgres-url: unable to init database using 'C:\Users\info\AppData\Roaming\coderv2\postgres\bin\bin\initdb.exe -A password -U coder -D C:\Users\info\AppData\Roaming\coderv2\postgres\data --pwfile=C:\Users\info\AppData\Roaming\coderv2\postgres\runtime\pwfile': exit status 0xc0000135
Solution:
you will need to log out and login, or run newgrp docker before running coder server
Jump to solution
40 Replies
Codercord
Codercord10mo ago
<#1230522694655672461>
Category
Help needed
Product
Coder OSS (v2)
Platform
Windows
Logs
Please post any relevant logs/error messages.
SolarMan27
SolarMan27OP10mo ago
welp
Cian
Cian10mo ago
Looking up exit status 0xc0000135 it appears that generally you see that when Windows is missing a library it needs. I think you have two options here: 1) Set CODER_PG_CONNECTION_URL to point to an existing PostgreSQL database, or 2) Install the PostgreSQL CLI tools so that you have the required libraries. You can do that by downloading the Windows PostgreSQL installer from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads , launching the MSI, and only selecting "Command Line Tools" when prompted to select components.
Cian
Cian10mo ago
In any case, filed https://github.com/coder/coder/issues/13010 to track this issue.
GitHub
bug: windows: coder server fails to start with `exit status 0xc00...
Reproduced on Windows 21H2 (OS build 20348.2159) coder server fails to start with the error: Error: Failed to start built-in PostgreSQL. Optionally, specify an external deployment with --postgres-u...
Cian
Cian10mo ago
Scratch that, it might just be missing the VC++ runtime
Cian
Cian10mo ago
No description
Cian
Cian10mo ago
only shows up if you run the initdb cmd in cmd.exe and not in PS
SolarMan27
SolarMan27OP10mo ago
No i fixed it Dw btw @EB :) i mean @Cian I got an other problem
docker_image.main: Creating...
docker_image.main: Still creating... [10s elapsed]
docker_image.main: Still creating... [20s elapsed]
docker_image.main: Still creating... [30s elapsed]
docker_image.main: Still creating... [40s elapsed]
docker_image.main: Creating...
docker_image.main: Still creating... [10s elapsed]
docker_image.main: Still creating... [20s elapsed]
docker_image.main: Still creating... [30s elapsed]
docker_image.main: Still creating... [40s elapsed]
it spams this :/ someone welp :(
Cian
Cian10mo ago
It looks like it's failing to build the Docker image. Are you using a Docker daemon running on the same Windows host?
SolarMan27
SolarMan27OP10mo ago
I switched over to a vps ubuntu Error: Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? now i get this error wlp
Cian
Cian10mo ago
Have you checked that the user under which coder runs has permissions to access the docker daemon socket? Is Docker installed and running?
SolarMan27
SolarMan27OP10mo ago
I installed docker.io and its running how do i add coder to the docker daemon
SolarMan27
SolarMan27OP10mo ago
No description
No description
SolarMan27
SolarMan27OP10mo ago
both are running and coder has been added to the docker group @Cian
Cian
Cian10mo ago
that appears correct.
SolarMan27
SolarMan27OP10mo ago
so what now?
Cian
Cian10mo ago
have you tried to import the example docker template?
SolarMan27
SolarMan27OP10mo ago
like the hello world how do i run that? Idk how
Cian
Cian10mo ago
SolarMan27
SolarMan27OP10mo ago
Done I gives me the same error root@Coder:~# sudo -u coder docker ps Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? root@Coder:~# ^C
Cian
Cian10mo ago
Make sure you restarted Coder since installing Docker then validate that sudo -u coder docker ps works and sudo -u coder docker run hello-world should also work
SolarMan27
SolarMan27OP10mo ago
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. See 'docker run --help'.
Cian
Cian10mo ago
Double-check that you followed these steps https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user Double-check that the coder user is a member of the docker group:
grep coder /etc/group
grep coder /etc/group
Double-check that the ownership of /var/run/docker.sock allows the docker group to both read and write. Double-check that coder is running as the coder user:
ps -eo pid,uid,command | grep [c]oder
ps -eo pid,uid,command | grep [c]oder
Docker Documentation
Linux post-installation steps for Docker Engine
Find the recommended Docker Engine post-installation steps for Linux users, including how to run Docker as a non-root user and more.
SolarMan27
SolarMan27OP10mo ago
No description
No description
Cian
Cian10mo ago
It looks like coder is running under uid 1001 and the coder user has uid 998. How are you running coder? Via systemd service or manually via coder server?
SolarMan27
SolarMan27OP10mo ago
i used them both lol I mostly use coder server
Cian
Cian10mo ago
Stick to using systemd.
SolarMan27
SolarMan27OP10mo ago
Why? @Cian
Cian
Cian10mo ago
If you run coder as your regular user vivek then that will store data under a different path than under systemd. Also, the whole point of systemd is to keep a service running
SolarMan27
SolarMan27OP10mo ago
wdym vivek is a non-root user so i can run it on root
Cian
Cian10mo ago
is vivek a member of the docker group?
SolarMan27
SolarMan27OP10mo ago
idk i dont think so let me check Nope why?
Cian
Cian10mo ago
If the coder service is running as the user vivek and attempt to run docker commands, but the user vivek does not have permission...
SolarMan27
SolarMan27OP10mo ago
oof
Cian
Cian10mo ago
The other reason is that coder runs a built-in postgres server if you don't specify otherwise. That's going to be under /home/vivek/.config/coderv2/postgres/data if you run as vivek and if you run as coder it's going to be under /home/coder/.config/.... You'll end up with two different coder installs, essentially.
SolarMan27
SolarMan27OP10mo ago
so if i add vivek to the docker group will it work then?
Cian
Cian10mo ago
you'll need to stop and start coder after you do that actually
SolarMan27
SolarMan27OP10mo ago
alrigjt
Solution
Cian
Cian10mo ago
you will need to log out and login, or run newgrp docker before running coder server
SolarMan27
SolarMan27OP10mo ago
Now it works wait docker_image.main: Still creating... [1m0s elapsed] now it spams this :( the same as on windows that is when im trying to create a code spce i mean workspace it works now

Did you find this page helpful?