sdk-core: [Bug] ConnectionReset trying to connect to Temporal Server

What are you really trying to do?

Using Rust, trying to connect the client to the server using tls_cert and the connect command as the exemple below

    let mut client_options_builder = ClientOptionsBuilder::default();
    client_options_builder
        .target_url(target_url)
        .client_name("name")
        .client_version("version");`

    if client_tls_config.is_some() {
        client_options_builder.tls_cfg(TlsConfig {
            server_root_ca_cert: None,
            domain: None,
            client_tls_config,
        });
    }

    let client_options = client_options_builder
        .build()
        .map_err(|err| TemporalError::ClientError(err.to_string()))?;

    let client = client_options
        .connect(namespace, meter, None)
        .await
        .map_err(|err| TemporalError::ClientError(err.to_string()))?;

Describe the bug

before #698 the code above connects correctly to the server and we can begin to creating workers, after the merge the same code returns the following error

Error: ClientError("'get_system_info call' error after connection: Status { code: Unknown, message: \"transport error\", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Kind(ConnectionReset)))) }")

Minimal Reproduction

In RUST, using any rev after the following:

temporal-client = { git = "https://github.com/temporalio/sdk-core", rev = "c55ba57" }
temporal-sdk = { git = "https://github.com/temporalio/sdk-core", rev = "c55ba57" }
temporal-sdk-core = { git = "https://github.com/temporalio/sdk-core", rev = "c55ba57" }
temporal-sdk-core-api = { git = "https://github.com/temporalio/sdk-core", rev = "c55ba57" }
temporal-sdk-core-protos = { git = "https://github.com/temporalio/sdk-core", rev = "c55ba57" }
temporal-sdk-core-test-utils = { git = "https://github.com/temporalio/sdk-core", rev = "c55ba57" }

and trying to connect a client to the server as of the exemple above

Environment/Versions

  • OS and processor: [M1 Mac, Linux]
  • Temporal Version: Rust SDK
  • The error runs running locally as well as inside a container in k8s

Additional context

the cargo.toml that gives me the error cargo.toml.txt

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (7 by maintainers)

Most upvoted comments

Well, the OpenTelemetry metrics error occurred. Metrics exporter otlp failed with the grpc server returns error (The service is currently unavailable): , detailed error message: tcp connect error: Connection refused (os error 61) error is unrelated to the rest of the worker connection. That’s seemingly a fairly clear refusal by what looks like datadog to accept the connection. I can’t really say why they are refusing your connection. Maybe you need to be providing some kind of authentication token in the headers which you are currently leaving empty (though I’d expect an unauthorized error in that case). Connection refusal could be the wrong port, or maybe it also doesn’t like the grpc scheme. The mTLS options for the worker connection don’t have anything to do with the OTel connection.

I’m going to close this issue since it looks like problems with the worker’s TLS connection were a result of misconfiguration. I would recommend using the https:// scheme unless you have some compelling reason not to.

Oh, yeah I read the env var getter and assumed the default was what you were hitting. I’ll try this out at some point today and see what I get.

Yeah, I think that would probably do it in terms of having default certs. I think it’s got to be something system related, since we do have tests that are running core based sdks against cloud (and, obviously users in real life doing that all the time too), hard for me to say exactly what though.

@Sushisource no problem! to be honest I’m using a fork, because I’m also writing workflows in rust 😅 (I know, not officially supported yet). It is up to date with main though, so not entirely sure yet what’s causing it. I’m still doing more testing, will let you know what I find, so far it only happens when I’m using TLS certs, without it (locally) it works fine.