Issues with Accessing Typesense Service via Docker

TLDR Kanak had difficulties connecting to Typesense on Docker despite successful installation. After discussions with Jason troubleshooting the issue, Kanak realized the problem was with the ufw firewall.

Photo of Kanak
Kanak
Wed, 26 Jul 2023 21:26:57 UTC

I am trying to install typesense using docker (latest build) on a fresh machine with 100+GB free memory. My docker-compose is exactly as in the docs. I see the familiar "Peer refresh succeeded" message, but I can never connect to the service, the /health endpoint just times out. What could be causing this? I have tested on multiple typesense images. `netstat` also shows that 8108 is active. Here is the output of `docker-compose logs typesense` .

Photo of Jason
Jason
Wed, 26 Jul 2023 21:39:35 UTC

Could you share the exact curl command you’re running to check /health?

Photo of Kanak
Kanak
Wed, 26 Jul 2023 21:45:34 UTC

`curl `, `curl `... No errors or response, just timeouts

Photo of Jason
Jason
Wed, 26 Jul 2023 21:47:24 UTC

Hmm, did you run netstat from the host?

Photo of Kanak
Kanak
Wed, 26 Jul 2023 21:47:51 UTC

yes

Photo of Jason
Jason
Wed, 26 Jul 2023 21:47:53 UTC

Could you docker exec bash into the container and try running the healthcheck from within the container?

Photo of Jason
Jason
Wed, 26 Jul 2023 21:52:19 UTC

May I know what host OS you’re running docker on, and also the docker engine version?

Photo of Kanak
Kanak
Wed, 26 Jul 2023 21:58:37 UTC

Sorry, inside the container I am able to access the health endpoint. (I have no docker chops, just want to try the latest image.) I guess it's a firewall issue I will have to troubleshoot. Thanks for the help!

Photo of Jason
Jason
Wed, 26 Jul 2023 21:59:51 UTC

You’re running `curl ` from the server where Typesense is running right, not from your local machine?

Photo of Kanak
Kanak
Wed, 26 Jul 2023 22:00:19 UTC

Yes :smile:

Photo of Jason
Jason
Wed, 26 Jul 2023 22:00:41 UTC

Just making sure!

Photo of Jason
Jason
Wed, 26 Jul 2023 22:01:00 UTC

Wonder what else could be wrong… That docker compose file seems to work fine for me at least from a mac

Photo of Kanak
Kanak
Wed, 26 Jul 2023 22:06:35 UTC

I have traced it to ufw... apparently it's a thing.

Photo of Jason
Jason
Wed, 26 Jul 2023 22:07:23 UTC

I see, good to know!