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

Show timeout and conflicting settings #284

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

Dhghomon
Copy link
Contributor

@Dhghomon Dhghomon commented Nov 1, 2023

Two very small user-oriented changes.

On the CLI side there are a few things that can go wrong when attempting to connect. One is the port which if wrong will display this and only this for 30 seconds (or another if a different wait_until_available specified):

Connecting to EdgeDB instance 'anything' at localhost:10700...

A user could specify RUST_LOG="debug" for more info (and considering adding that note as a hint inside the CLI) which shows the multiple connection failures as they happen but if not then it looks like it is just hanging. With a method to see the wait_until_available it could look something like this instead:

Connecting to EdgeDB instance 'anything' at localhost:10700 (will try up to 30s)...

The error when tls_cert_data or tls_ca is wrong is good, it's just not spaced out and looks like this.

edgedb error: ClientError: cannot read credentials file C:\Users\mithr\AppData\Local\EdgeDB\config\credentials\anything.json: detected conflicting settings: tls_ca=Some("-----BEGIN CERTIFICATE-----\nMIIC0zCCAbugAwIBAgIRAMFs6w0fiU2omuuhw9I7ew0wDQYJKoZIhvcNAQELBQAw\nGDEWMBQGA1UEAwwNRWRnZURCIFNlcnZlcjAeFw0yMzEwMjIxODM4MzNaFw00MjEy\nMjIxODM4MzNaMBgxFjAUBgNVBAMMDUVkZ2VEQiBTZXJ2ZXIwggEiMA0GCSqGSIb3\nDQEBAQUAA4IBDwAwggEKAoIBAQCPDnnf5mcSzOC8MQkGvhBSrBMuQRtCm/YPacLA\nX6zUqIYI9F3tjlcKRtM7Swt6/ZEzsjB97ynZgz1FaU4VdoZ1UxxVQIp47VnwaQ7h\nNRLhHOlYNZHrUT+bUwUhMcGPsR2K6d+R4J4iwGaLEhsjnUVr2Mgmq9cXotXeHWET\nhXmJkurAyCU7bC8sqeA6OllZt2rdxv0j8hfcejgzYO8SBOxN8mqnOO8ZAs75EPjK\nPVMqSAO5y2rYPfT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YPfTBMgZmCkf7RZrmU1RL/be8/0WBipZcwGUVaNpQ27/sj9Uill/x\n2uTkckbDHHsIO9T2L6YT/Hl4ZzBRQwGUpRGRMRVYwNk0I7xTAgMBAAGjGDAWMBQG\nA1UdEQQNMAuCCWxvY2FsaG9zdDANBgkqhkiG9w0BAQsFAAOCAQEAY8PVKtHRFz8k\noQ+bvSDKcxivgWAzj+11BWcleazQCIDMLmCC9Fb8D9ElNQHaxM3IARbXHK5V7PYz\nZnWSzNMBIvALLd3t5OMUaP44k6CRvMssUJ2NTwdXi9L4pfYVA8HoC9Mu97R+vOIK\nTNC+1MnX7Xk+/OjVqgddi/Zo3QiBKJJ9PQz9uyYADKapMx3kTdgkmQEUp1eM0x2/\nkUeI8d+YyWLSRN6xg6JsQ+4Wu4igzZnUBrg4/+hnAeZkDn6Gr7wcF+7fi26zGNVi\nbtN627XEn8BYvBvg9eIKH9QUQ5bSIEklp/uDTw4XAFI+ulXcHbarF4skJFNAu+Q8\nyuEpkyskTA=\n-----END CERTIFICATE-----\n")

So change to this:

edgedb error: ClientError: cannot read credentials file C:\Users\mithr\AppData\Local\EdgeDB\config\credentials\anything.json: detected conflicting settings.
tls_ca =
Some(
    "-----BEGIN CERTIFICATE-----\nMIIC0zCCAbugAwIBAgIRAMFs6w0fiU2omuuhw9I7ew0wDQYJKoZIhvcNAQELBQAw\nGDEWMBQGA1UEAwwNRWRnZURCIFNlcnZlcjAeFw0yMzEwMjIxODM4MzNaFw00MjEy\nMjIxODM4MzNaMBgxFjAUBgNVBAMMDUVkZ2VEQiBTZXJ2ZXIwggEiMA0GCSqGSIb3\nDQEBAQUAA4IBDwAwggEKAoIBAQCPDnnf5mcSzOC8MQkGvhBSrBMuQRtCm/YPacLA\nX6zUqIYI9F3tjlcKRtM7Swt6/ZEzsjB97ynZgz1FaU4VdoZ1UxxVQIp47VnwaQ7h\nNRLhHOlYNZHrUT+bUwUhMcGPsR2K6d+R4J4iwGaLEhsjnUVr2Mgmq9cXotXeHWET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q9cXotXeHWET\nhXmJkurAyCU7bC8sqeA6OllZt2rdxv0j8hfcejgzYO8SBOxN8mqnOO8ZAs75EPjK\nPVMqSAO5y2rYPfTBMgZmCkf7RZrmU1RL/be8/0WBipZcwGUVaNpQ27/sj9Uill/x\n2uTkckbDHHsIO9T2L6YT/Hl4ZzBRQwGUpRGRMRVYwNk0I7xTAgMBAAGjGDAWMBQG\nA1UdEQQNMAuCCWxvY2FsaG9zdDANBgkqhkiG9w0BAQsFAAOCAQEAY8PVKtHRFz8k\noQ+bvSDKcxivgWAzj+11BWcleazQCIDMLmCC9Fb8D9ElNQHaxM3IARbXHK5V7PYz\nZnWSzNMBIvALLd3t5OMUaP44k6CRvMssUJ2NTwdXi9L4pfYVA8HoC9Mu97R+vOIK\nTNC+1MnX7Xk+/OjVqgddi/Zo3QiBKJJ9PQz9uyYADKapMx3kTdgkmQEUp1eM0x2/\nkUeI8d+YyWLSRN6xg6JsQ+4Wu4igzZnUBrg4/+hnAeZkDn6Gr7wcF+7fi26zGNVi\nbtN627XEn8BYvBvg9eIKH9QUQ5bSIEklp/uDTw4XAFI+ulXcHbarF4skJFNAu+Q8\nyuEpkyskTA==\n-----END CERTIFICATE-----\n",
)

@Dhghomon Dhghomon marked this pull request as ready for review November 1, 2023 05:36
@Dhghomon Dhghomon merged commit 2aad531 into master Nov 2, 2023
3 checks passed
@Dhghomon Dhghomon deleted the show-timeout-and-conflicting-settings branch February 9, 2024 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants