Temporal example sample will not run

I’ve been making my way through the sample “Build a Temporal “Hello World!” app from scratch in Go” and am unable to run the app.

I am using docker-compose as per the provided guide.

My docker-compose seems to boot fine with the containers showing healthy in Docker.

The compose sits looping over waiting Elasticsearch to start up, although the elastic search instance is running in docker and I am able to connect to it via the console

Waiting for Elasticsearch to start up.
temporal                | + DURATION=7755
temporal                | + '[' 0 -gt 0 ']'
temporal                | + echo 'Waiting for Elasticsearch to start up.'
temporal                | + sleep 1
temporal                | + curl --silent --fail --user : http://elasticsearch:9200

Attempting to run the app as mentioned above returns the following:

hello-world-project-template-go % go run worker/main.go
2022/04/12 12:20:24 INFO  No logger configured for temporal client. Created default one.
2022/04/12 12:20:24 unable to create Temporal client get system info failed: last connection error: connection closed before server preface received - *serviceerror.Unavailable
exit status 1

I am able to access the Temporal UI via localhost:8088. It does however display an error pop up in the bottom right of the page when attempting to search namespaces.

14 UNAVAILABLE: failed to connect to all addresses. method: getVersionInfo, req: undefined

I’ve tried using tctl to describe the namespace but that also returns an error.

Is there something I have missed?

Try giving the docker more memory. Elastisearch is memory hungry and the default docker memory allocation is not enough.

It currently has 9GB applied to it without any success

Try increasing the ES_JAVA_OPTS in your docker file, for example here.
For Docker, 9GB should be enough, I run on 4GB mem with 1GB swap set in Docker desktop. Do sometimes however get same issue with ES starting up when running
docker compose up
If that happens stopping the process (CTRL-C) and starting the command again helps and ES typically starts up fine.