Troubleshooting

Connection problems

Why a client cannot connect or log in to raftdb-mysql or raftdb-server, and why a connection drops, with the errors each case produces.

MySQL and MariaDB clients (raftdb-mysql)#

SymptomCauseFix
Can't connect to MySQL server on '127.0.0.1' (111) or (10061)Nothing listens on that address and portStart raftdb-mysql; check listen (default 127.0.0.1:3307). Use TCP: the client's localhost means a socket file on Unix.
Connects from the machine, not from anotherlisten is on loopback (the default)Set listen = 0.0.0.0:3306 only on a network you control and through a tunnel or firewall (Network exposure).
ERROR 1045 (28000): Login refused for user 'app'@'localhost' (password supplied: YES)Wrong user or password, or no such user. A loopback client is shown as localhost.Check the user = NAME:PASSWORD line (a # cuts a password) or the CREATE USER account and its host ('app'@'%' matches every host).
ERROR 1045 ... (password supplied: NO)The client sent no passwordAdd -p.
ERROR 1040 (08004): Too many connectionsmax_connections (default 500) reachedRaise it, or fix connection leaks in the application.
MariaDB client: a TLS or SSL error at connectThe MariaDB 11.4 client asks for TLS and the front-end offers none (no ssl_cert), or the certificate does not verifyConfigure TLS (TLS and encryption), or add --skip-ssl (Connecting); with --ssl-verify-server-cert give --ssl-ca the server certificate.
mysql --ssl-mode=REQUIRED failsNo TLS is offered (no ssl_cert / ssl_key / ssl = auto)Configure TLS on the front-end; without it remove the option or use a tunnel.
ERROR 3159 (HY000): Connections using insecure transport are prohibitedssl_mode = required and the client did not use TLSUse TLS in the client (--ssl-mode=REQUIRED, sslMode=REQUIRED), or set ssl_mode = preferred.
VERIFY_CA or VERIFY_IDENTITY fails (certificate verify failed)The client does not have the server certificate as its CA, or the certificate does not name the host usedPass the certificate as the CA (--ssl-ca); make a certificate with the host name or address in its alternative names. A certificate made by ssl = auto is new at each start and cannot be verified.
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet' or during queryThe server stopped or restarted; the login took longer than 10 seconds; a firewall closed the connection; or the front-end lost its link to Raft DBCheck the process; with embed look at the start-up lines; check raftdb-server in two-process mode.
ERROR 2013 ... Lost connection to Raft DB: ... (message from raftdb-mysql)In two-process mode the link to raftdb-server brokeCheck raftdb-server, its address in raftdb, and the account of raftdb_user.
Login succeeds, then every statement fails with Raft DB: ... (error 1105)The front-end's own account (raftdb_user) is wrong or lacks a role the statement needs, or the server answers with a refusalCheck raftdb_user and raftdb_password; give it admin if the MySQL users create databases.
A client that required UTF-8 data gets error 1366 Incorrect string value: the statement is not valid UTF-8The text of a COM_QUERY is not UTF-8Send UTF-8, or binary data as hexadecimal or _binary literals, or as prepared-statement parameters.

Find out what a client sends: start raftdb-mysql with RAFTDB_MYSQL_TRACE=1 in the environment. Each login logs the client's capabilities and plugin; each statement is logged with its outcome. Statements with passwords are logged in clear: delete the output.

Native clients and HTTP (raftdb-server)#

SymptomCauseFix
Connection refusedServer not running, wrong port, or loopback-only addrCheck raftdb-server --print-config; the single profile listens on 127.0.0.1 only.
HTTP 401 unauthenticated ("log in (POST /v1/auth/login) or send Authorization: Bearer ...")No loginLog in; the password of admin is in <dir>/admin.password.
401 "wrong user name or password" (after 250 ms)Wrong accountCheck the user lines; remember that passwords with : need care: a last part counts as a role only if it is one.
HTTP 403 forbidden; binary error 11 FORBIDDENThe account's role or database scope does not allow itCheck GET /v1/auth/whoami.
HTTP 403 read_only_replica; binary error 12 READ_ONLYA replica, or a managed node that is not the primaryWrite to the primary, or POST /v1/promote on a replica you are making the primary.
HTTP 409 not_leader with an addressTable-group mode: this node does not lead the tableUse the node named in the answer, or the binary protocol (it forwards).
HTTP 400 confirm_requiredA drop without the exact name in the bodySend {"confirm": "<name>"}.
HTTP 503 or 404 after a drop or renameThe table was dropped or renamed under the connectionReconnect and Use the new name.
A binary connection is closed after a bad frameThe frame was malformed (frames are 5 bytes to 16 MiB)Fix the client; the server answers with an error then closes.
Browser: the Studio cannot reach another serverCross-origin rulesSet cors on the called server and allow-remote-servers on the Studio's server (HTTP administration API).

Connections that drop#

  • Idle connections: no idle timeout is documented for them; a firewall or load balancer in between may close them.
  • A table is checkpointed, dropped or renamed: connections on it fail and must reconnect.
  • The server was killed: a statement in progress gets a lost-connection error; retry after checking whether the write happened.
  • In two-process mode a dropped table fails the sessions on it with a "table was not found" error (1146) instead of closing their connections.

See also#