Skip to content

Commit b45d444

Browse files
committed
Documentation: Add guidelines about debugging connectivity problems
Python may have skipped installing its SSL root certificate bundle on macOS. Educate the user about how to improve the situation.
1 parent 139fcbc commit b45d444

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ Now, run it::
8080
If you would like to run ``crash`` from any directory, and without the leading
8181
``./``, the file has to be in a directory that is on your `PATH`_.
8282

83+
Troubleshooting
84+
===============
85+
86+
The documentation section about `troubleshooting connection errors`_ provides
87+
support and guidelines how to debug and resolve problems when connecting to
88+
`CrateDB`_ or `CrateDB Cloud`_.
89+
8390
Contributing
8491
============
8592

@@ -104,3 +111,4 @@ Looking for more help? Check out our `support channels`_.
104111
.. _PATH: https://en.wikipedia.org/wiki/PATH_(variable)
105112
.. _pip: https://pypi.python.org/pypi/pip
106113
.. _support channels: https://cratedb.com/support/
114+
.. _troubleshooting connection errors: https://cratedb.com/docs/crate/crash/en/latest/troubleshooting.html

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The CrateDB Shell (aka *Crash*) is an interactive `command-line interface`_
3030
getting-started
3131
run
3232
commands
33+
troubleshooting
3334
appendices/index
3435

3536
.. _command-line interface: https://en.wikipedia.org/wiki/Command-line_interface

docs/troubleshooting.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
===============
2+
Troubleshooting
3+
===============
4+
5+
This sections enumerates potential connection problems with ``crash``,
6+
and how to investigate and resolve them.
7+
8+
9+
Debugging connection errors
10+
===========================
11+
12+
If you are connecting to `CrateDB`_, for example like this::
13+
14+
crash --hosts 'http://localhost:4200' -U 'admin' -W
15+
16+
... and ``crash`` responds with a connection error message like this::
17+
18+
CONNECT ERROR
19+
20+
you may want to add the ``--verbose`` command line option, in order to find out
21+
about the reason why the connection fails. It could be a DNS / name resolution
22+
error, or it could be a problem related to SSL termination.
23+
24+
Other than ``--verbose``, you can also use the shorthand version ``-v``::
25+
26+
crash --hosts 'http://localhost:4200' -U 'admin' -W -v
27+
28+
29+
30+
SSL connection errors
31+
=====================
32+
33+
`A recent problem`_ outlined SSL connectivity problems when connecting to
34+
`CrateDB Cloud`_::
35+
36+
crash --hosts 'https://MY-CLUSTER-NAME.eks1.eu-west-1.aws.cratedb.net:4200' -U 'admin' -W -v
37+
38+
The verbose output using ``crash -v`` signaled a certificate verification error
39+
like that::
40+
41+
Server not available, exception: HTTPSConnectionPool(host='MY-CLUSTER-NAME.eks1.eu-west-1.aws.cratedb.net', port=4200):
42+
Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '
43+
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))
44+
45+
If you are on macOS, the Python Installer offers an easy option to install the
46+
required SSL root certificates. Because ``crash`` uses Python, this is the
47+
right choice to resolve the problem durably.
48+
49+
.. figure:: https://github.com/crate/crash/assets/453543/c4e49d7e-86d8-40f6-b0d8-f64889f9d972
50+
51+
In order to install the SSL root certificates retroactively, you can use a
52+
command like::
53+
54+
/Applications/Python 3.11/Install Certificates.command
55+
56+
57+
.. _a recent problem: https://community.cratedb.com/t/issue-connecting-to-cratedb-cloud-cluster-from-local-machine/1707
58+
.. _CrateDB: https://github.com/crate/crate
59+
.. _CrateDB Cloud: https://console.cratedb.cloud

0 commit comments

Comments
 (0)