Typescript connection to docker-compose temporal instance

Hi, everyone,

I am trying to connect to the temporal instance, I use for development, launched through docker-compose.

The issue I am having is with the typescript/js client. When the instance is ran locally (localhost), the client has no issues connecting, when I run in on a remote machine on the network, the client crashes with the, presumably, rust, error message:


2022-08-05T15:44:40.231Z [INFO] webpack 5.73.0 compiled successfully in 1722 ms
bundled workflow code
error: tonic::transport::Error(Transport, hyper::Error(Connect, ConnectError(“tcp connect error”, Os { code: 61, kind: ConnectionRefused, message: “Connection refused” })))

The Go client has no issues connecting to the very same instance on the remote machine. Only happens in js/ts. Again if the temporal instance is ran on localhost - no issues with js/ts.

additional detail - the client has the same behavior whether ran on Mac or Linux (did not try on windows).

Anyone successfully dealt with this issue?

Thank you!

How are you setting up the connection in JS?

const _connection = await Connection.connect({
	address: '192.168.1.102:7233',
	tls: false
});

Looks like you’re creating a non-native connection, you need to use NativeConnection from @temporalio/worker for worker connections.
Make sure you pass a reference to that connection to the worker.

1 Like

Thanks.

This error is encountered when setting up the client.

The error you posted is coming from the worker not a client.

Please paste a full sample and the error from the logs so I can understand where the problem is.

@bergundy.
you are absolutely right. I had assumed it was coming from the client initialization. However the error was, in fact, the result of the subsequent create worker call.

Thank you.

2 Likes