Hello
I’m setting up the meshery-cloud
and facing some issues running it locally.OS : windows- wsl ubuntu
As mentioned in the docs
Expose local cloud server: Run ngrok http --domain=allowing-poorly-wolf.ngrok-free.app 9876
to expose your local cloud server running on port 9876.
I’ve done it as described, and ngrok is running fine. However, I got stuck at this step:
Start dependencies Postgres, Kratos, and Hydra. Build and run Layer5 Cloud Server. Access at http://localhost:9876
I wasn’t able to run make server-local
as it is asking to download soda
cli, I tried installing from https://gobuffalo.io/documentation/database/soda/
, but still encountering the same issue.
$ make server-local Makefile:653: *** Dependency missing: 'soda'. Ensure 'soda' is installed and available in your 'PATH' - https://gobuffalo.io/documentation/database/soda/. Stop
Try executing this:
export PATH=$PATH:/home/<your-username>/go/bin
Followed by make server-local
Thanks @vishalvivekm , it solved that issue, I setup postgress in wsl and connected docker desktop with wsl.
Now I’m getting this issue, where the issue with meshery-net
Error response from daemon: network with name meshery-net already exists
Here is the complete errro log
$ PATH=$PATH:/home/kaif/go/bin make server-local (docker rm -f postgres) || true postgres docker network create meshery-net || true Error response from daemon: network with name meshery-net already exists docker run -d \ --network meshery-net \ --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=meshery -p 5432:5432 postgres 37f5ecb8c94d095e212cdbe0c0f757ba0c639b697d3bcd6a8c80d1aaa9d3d996 docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5432 -> 0.0.0.0:0: listen tcp4 0.0.0.0:5432: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted. make: *** [Makefile:341: postgres] Error 125
Error response from daemon: network with name meshery-net already exists
I solved the above errror by colsing the docker network connection
docker network rm meshery-net
But getting this now, I guess the problem is with the postgress server, I’ve faced some problems backthen.
$ PATH=$PATH:/home/kaif/go/bin make server-local
(docker rm -f postgres) || true
postgres
docker network create meshery-net || true
e7734399285396b4eb4ce909340ae5787dd55ede677ca1a9fa5ce72440d89bf6
docker run -d
–network meshery-net
–name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=meshery -p 5432:5432 postgres
27f5901595dd940f2bfb70579e1cabcc977e24ff348c062b47f7026ca6561a13
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5432 → 0.0.0.0:0: listen tcp4 0.0.0.0:5432: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
make: *** [Makefile:341: postgres] Error 125
Can you share what’s the result of following
sudo lsof -i :5432
?
We need to kill the process occupying the port 5432 before attempting to start the server.
The above command gives you pid of existing process using that port, if any.
Take that pid and kill it like this
sudo kill <pid>
Then attempt building make server-local
No its nothing, there is no process running refred to this port
I see @Md_Kaif_Ansari
Can you please share the result of the following;
sudo docker ps
sudo systemctl status postgresql
vishalvivekm:
@vishalvivekm
here
$ PATH=$PATH:/home/kaif/go/bin make server-local
(docker rm -f postgres) || true
Error response from daemon: No such container: postgres
docker network create meshery-net || true
630cc9855fc5e3cfdfd2b11a2fbf8b2a31d48edee9d8daf346450df054f31339
docker run -d
–network meshery-net
–name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=meshery -p 5432:5432 postgres
b43894533227cfd693cddaa60803a557c5c8c0a7bd94bd725cb1c671d20a5206
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5432 → 0.0.0.0:0: listen tcp4 0.0.0.0:5432: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
make: *** [Makefile:341: postgres] Error 125
$ sudo service postgresql status
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: enabled)
Active: active (exited) since Mon 2024-11-25 09:07:34 UTC; 3min 11s ago
Process: 3309 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 3309 (code=exited, status=0/SUCCESS)
Nov 25 09:07:34 LAPTOP-HESMK8AC systemd[1]: Starting postgresql.service - PostgreSQL RDBMS…
Nov 25 09:07:34 LAPTOP-HESMK8AC systemd[1]: Finished postgresql.service - PostgreSQL RDBMS.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
kaif@LAPTOP-HESMK8AC:/mnt/d/Layer5/Meshery/meshery-cloud$
As you can see this
Error response from daemon: No such container: postgres
So I stoped the wsl postgresql and continued with container of postgres running and vice versa.
But still I wasn’t able to run it
Lee
November 25, 2024, 12:18pm
9
meshery-net is not why the command is failing.
I will ask here again for public @Md_Kaif_Ansari : what’s the result for sudo netstat -tuln | grep 5432
here is the output
$ sudo netstat -tuln | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
This postgresql is runing in wsl
kill this process and restart your docker and then run again make server local
@Sudhanshu_Dasgupta As you said
I stop the postgresql server
$ sudo service postgresql stop
The service is inactive now
$ sudo service postgresql status
○ postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: enabled)
Active: inactive (dead) since Tue 2024-11-26 12:59:46 UTC; 2s ago
Duration: 13min 5.790s
Process: 364 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 364 (code=exited, status=0/SUCCESS)
Nov 26 12:46:40 LAPTOP-HESMK8AC systemd[1]: Starting postgresql.service - PostgreSQL RDBMS…
Nov 26 12:46:40 LAPTOP-HESMK8AC systemd[1]: Finished postgresql.service - PostgreSQL RDBMS.
Nov 26 12:59:46 LAPTOP-HESMK8AC systemd[1]: postgresql.service: Deactivated successfully.
Nov 26 12:59:46 LAPTOP-HESMK8AC systemd[1]: Stopped postgresql.service - PostgreSQL RDBMS.
$ sudo netstat -tuln | grep 5432
$
After that when I run it again
$ PATH=$PATH:/home/kaif/go/bin make server-local
(docker rm -f postgres) || true
postgres
docker network create meshery-net || true
cc5b0f3d40a5590788e8ab7949e24816561f111d2bdbf63ff642074b6668711a
docker run -d
–network meshery-net
–name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=meshery -p 5432:5432 postgres
708bcbe061864640373ab56341cdb2d07259f92b336d886a461cf435393fbb79
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5432 → 0.0.0.0:0: listen tcp4 0.0.0.0:5432: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
make: *** [Makefile:341: postgres] Error 125
To confirm I dont have any container running, the postgresql server is also inactive
Hmm, try to change the port in makefile (i guess line 343) for now and then run. If it works don’t commit please.
No @Sudhanshu_Dasgupta , it doesn’t work eather
$ PATH=$PATH:/home/kaif/go/bin make server-local
(docker rm -f postgres) || true
postgres
docker network create meshery-net || true
Error response from daemon: network with name meshery-net already exists
docker run -d
–network meshery-net
–name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=meshery -p 5432:5678 postgres
e45c581c34ee8bf786b62f7ab7c76f1651aa7b2f21f15baa90a854f5cff55861
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5432 → 0.0.0.0:0: listen tcp4 0.0.0.0:5432: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
make: *** [Makefile:341: postgres] Error 125
@Md_Kaif_Ansari everything set?
yeah @Sudhanshu_Dasgupta ,
I did it into linux path /home/<repo_name>
. it is working fine though with no issues. I’m just setting up database user for getting started.
Also thinking of write a complete proposed solution for it, under this thread that would be beneficial for other contributors to follow up with the error.