Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added actionable errors for network issues. #49246

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

russjones
Copy link
Contributor

@russjones russjones commented Nov 20, 2024

Updated Application Access to return actionable error message when possible for network errors.

Fixes #47330

@russjones
Copy link
Contributor Author

@rosstimothy Adding you to this because I added some timeouts in this PR when I realized no timeouts exists for Application Access.

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-49246.d3pp5qlev8mo18.amplifyapp.com

@russjones russjones added the no-changelog Indicates that a PR does not require a changelog entry label Nov 20, 2024
Copy link
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a slight improvement, but what we've done here is taught the user how to recreate the same error outside of Teleport, not what they need to do to fix it.

For example, today users get confused when they see a connection refused error. After this change merges, they'll see an error that says "run nc -vz.." and when they run that they will see a very similar connection refused error to what they saw with Teleport. This doesn't seem like it will get the user much closer to understanding what's going wrong.

What do you think about making these error messages discuss the cause of the error more? For example, connection refused errors mean that packet(s) did reach the target host, but that nothing was listening on the port, whereas connection timeouts likely indicate some sort of firewall getting in the way.

lib/utils/errors.go Outdated Show resolved Hide resolved
lib/utils/errors.go Outdated Show resolved Hide resolved
lib/utils/errors.go Outdated Show resolved Hide resolved
lib/utils/errors.go Outdated Show resolved Hide resolved
lib/utils/errors.go Outdated Show resolved Hide resolved
api/defaults/defaults.go Outdated Show resolved Hide resolved
@russjones russjones linked an issue Nov 20, 2024 that may be closed by this pull request
api/defaults/defaults.go Outdated Show resolved Hide resolved
lib/srv/app/transport.go Outdated Show resolved Hide resolved
lib/srv/app/transport.go Outdated Show resolved Hide resolved
@russjones
Copy link
Contributor Author

russjones commented Nov 22, 2024

What do you guys think about the following updated error messages?

Connection Refused

Teleport was unable to connect to the requested host, possibly because the server is not
running. Ensure the server is running, listening on the correct port, and not blocked by
firewall rules.

Use "nc -vz HOST PORT" to help debug this issue.
No Route to Host

Teleport could not connect to the requested host, likely because there is no valid network
path to reach it. Check the network routing table to ensure a valid path to the host exists.

Use "ping HOST" and "ip route get HOST" to help debug this issue.
Connection Reset by Peer

Teleport could not complete the request because the server abruptly closed the connection
before the response was received. To resolve this issue, ensure the server (or load balancer)
does not have a timeout terminating the connection early and verify that the server is not
crash looping.

Use protocol-specific tools (e.g., curl, psql) to help debug this issue.
Context Deadline Exceeded

Teleport did not receive a response within %v, likely due to the system being overloaded
or due to network congestion. To resolve this issue, connect to the host directly and
ensure it is responding promptly.

Use protocol-specific tools (e.g., curl, psql) to assist in debugging this issue.
No Such Host

Teleport was unable to resolve the provided domain name, likely because the domain does not
exist. To resolve this issue, verify the domain is correct and ensure the DNS resolver is
properly resolving it.

Use "dig +short HOST" to help debug this issue.

@zmb3
Copy link
Collaborator

zmb3 commented Nov 26, 2024

Connection Refused
Teleport was unable to connect to the requested host, possibly because the server is not
running. Ensure the server is running, listening on the correct port, and not blocked by
firewall rules.

I haven't encountered a firewall that results in a connection refused error. Usually they just silently drop packets and the client sees a network timeout.

I'd move firewalls from here to the "context deadline exceeded" error message, otherwise these new messages look good.

@russjones russjones requested a review from zmb3 December 2, 2024 17:39
lib/srv/app/transport.go Outdated Show resolved Hide resolved
Copy link
Contributor

@webvictim webvictim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @russjones!

@russjones russjones force-pushed the rjones/fix-error-message-502 branch from 24207f3 to 728d8b4 Compare December 2, 2024 21:23
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
@russjones russjones force-pushed the rjones/fix-error-message-502 branch from 5644115 to 6e53156 Compare December 4, 2024 18:00
@russjones russjones added this pull request to the merge queue Dec 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 4, 2024
@russjones russjones added this pull request to the merge queue Dec 4, 2024
Merged via the queue into master with commit ad5afda Dec 4, 2024
41 checks passed
@russjones russjones deleted the rjones/fix-error-message-502 branch December 4, 2024 19:48
@russjones russjones restored the rjones/fix-error-message-502 branch December 4, 2024 19:50
@russjones russjones deleted the rjones/fix-error-message-502 branch December 4, 2024 19:50
russjones added a commit that referenced this pull request Dec 4, 2024
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
russjones added a commit that referenced this pull request Dec 4, 2024
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
russjones added a commit that referenced this pull request Dec 4, 2024
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
github-merge-queue bot pushed a commit that referenced this pull request Dec 4, 2024
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
github-merge-queue bot pushed a commit that referenced this pull request Dec 4, 2024
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
github-merge-queue bot pushed a commit that referenced this pull request Dec 4, 2024
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application-access no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide more information on unavailable web app connection
5 participants