Error reading server preface: EOF

I’ve deployed temporal/auto-setup and temporal/ui in AWS ECS + Fargate cluster. In the temporal/ui container, I set TEMPORAL_ADDRESS=temporal:7233 env var.

I’ve also setup AWS Cloud Map, so temporal/ui can reach temporal server through temporal:7233 dns name.

I can verify that the temporal/ui container can reach temporal:7233 using the following command:

ip-10-0-0-198:/home/ui-server# nc -z -v temporal 7233
temporal (xxx.xxx.0.2:7233) open

I can also ping:

ip-10-0-0-198:/home/ui-server# ping temporal
PING temporal (xxx.xxx.0.2): 56 data bytes
64 bytes from xxx.xxx.0.2: seq=0 ttl=127 time=0.041 ms
64 bytes from xxx.xxx.0.2: seq=1 ttl=127 time=0.163 ms

However, when I try to call curl -v http://localhost:8080/api/v1/namespaces/default from within the temporal/ui container, it looks like it fails to call the temporal server (I’m assuming):

{
  "code": 14,
  "message": "last connection error: connection error: desc = \"error reading server preface: EOF\""

Verbose curl log:

ip-10-0-0-198:/home/ui-server# curl -v http://localhost:8080/api/v1/namespaces/default
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /api/v1/namespaces/default HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 503 Service Unavailable
< Content-Type: *
< Set-Cookie: _csrf=LFWayzP6chEO3SRHqjzor4JmOlLHinzO; Path=/; Expires=Thu, 09 Jan 2025 20:13:05 GMT; Secure; SameSite=Strict
< Vary: Accept-Encoding
< Vary: Origin
< Vary: Cookie
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< X-Xss-Protection: 1; mode=block
< Date: Wed, 08 Jan 2025 20:13:05 GMT
< Content-Length: 118
<
{
  "code": 14,
  "message": "last connection error: connection error: desc = \"error reading server preface: EOF\""
* Connection #0 to host localhost left intact
}ip-10-0-0-198:/home/ui-server#

What’s happening? What is that error? Any insights to troubleshoot?

error reading server preface: EOF

most of time that have seen this had to do with tls issues with certs.

ip-10-0-0-198:/home/ui-server# nc -z -v temporal 7233
temporal (xxx.xxx.0.2:7233) open

can you use Temporal cli to check cluster health?
temporal operator cluster health