Skip to content

Improve API client connection failure feedback#25536

Merged
strideynet merged 3 commits intomasterfrom
strideynet/improve-api-client-connection-failure-feedback
May 3, 2023
Merged

Improve API client connection failure feedback#25536
strideynet merged 3 commits intomasterfrom
strideynet/improve-api-client-connection-failure-feedback

Conversation

@strideynet
Copy link
Copy Markdown
Contributor

@strideynet strideynet commented May 3, 2023

Closes #25535

This specifically covers cases where DialInBackground == false, which is the style we recommend in our docs to users consuming the API.

As the gRPC client retries connecting until a deadline is met, the error currently emitted is just "context deadline exceeded" which is completely devoid of the actual error that meant that it did not succeed. grpc.WithReturnConnectionError() means that the last error to occur is emitted.

This is not the perfect solution, in some cases, the last error to be emitted is still possibly going to be related to the connection being forced to close. But, it does mean that we will start showing /more/ of the underlying errors which will be helpful.

Before:

all connection methods failed
        
        failed to connect to addr noah.teleport.sh:443 with TLS Routing with ALPN connection upgrade dialer
                context deadline exceeded, 
        failed to connect to addr noah.teleport.sh:443 with TLS Routing dialer
                context deadline exceeded, 
        failed to connect to addr noah.teleport.sh:443 as a web proxy
                context deadline exceeded, 
        failed to connect to addr noah.teleport.sh:443 as a reverse tunnel proxy
                context deadline exceeded, 
        failed to connect to addr noah.teleport.sh:443 as an auth server
                context deadline exceeded
exit status 1

After:

all connection methods failed
        
        failed to connect to addr noah.teleport.sh:443 with TLS Routing dialer
                context deadline exceeded: connection error: desc = "transport: Error while dialing: failed to dial: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain, use of closed network connection", 
        failed to connect to addr noah.teleport.sh:443 with TLS Routing with ALPN connection upgrade dialer
                context deadline exceeded: connection error: desc = "transport: Error while dialing: failed to dial: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain, use of closed network connection", 
        failed to connect to addr noah.teleport.sh:443 as a reverse tunnel proxy
                context deadline exceeded: connection error: desc = "transport: Error while dialing: failed to dial: ssh: handshake failed: ssh: overflow reading version string, close tcp 192.168.1.156:58095->52.223.52.117:443: use of closed network connection", 
        failed to connect to addr noah.teleport.sh:443 as a web proxy
                context deadline exceeded: connection error: desc = "transport: Error while dialing: failed to dial: ssh: handshake failed: ssh: overflow reading version string, close tcp 192.168.1.156:58093->52.223.52.117:443: use of closed network connection", 
        failed to connect to addr noah.teleport.sh:443 as an auth server
                context deadline exceeded: connection error: desc = "transport: authentication handshake failed: tls: first record does not look like a TLS handshake"

@strideynet strideynet marked this pull request as ready for review May 3, 2023 09:57
@github-actions github-actions Bot requested review from codingllama and mdwn May 3, 2023 09:57
@strideynet strideynet added this pull request to the merge queue May 3, 2023
@strideynet strideynet removed this pull request from the merge queue due to a manual request May 3, 2023
@strideynet strideynet enabled auto-merge May 3, 2023 15:27
@strideynet strideynet added this pull request to the merge queue May 3, 2023
Merged via the queue into master with commit 2604f4f May 3, 2023
@strideynet strideynet deleted the strideynet/improve-api-client-connection-failure-feedback branch May 3, 2023 15:54
@public-teleport-github-review-bot
Copy link
Copy Markdown

@strideynet See the table below for backport results.

Branch Result
branch/v11 Failed
branch/v12 Create PR
branch/v13 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Client obscures connection errors with context deadline exceeded

4 participants