dolthub / dolthub/dolt

`dolt sql` doesn't recover gracefully to a server restart

Open
#6,971 0 comments 0 reactions 0 assignees View on GitHub
bad error message cli enhancement
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

If you have a `dolt sql` session open, and your sql-server restarts, you get the following error:

```
mysb> ANY SQL COMMAND
[mysql] 2023/11/07 10:02:23 packets.go:122: closing bad idle connection: connection reset by peer
Error 1045 (28000): Access denied for user '__dolt_local_user__'
Failure to get DB Name for sessionError 1045 (28000): Access denied for user '__dolt_local_user__'
mysb>
```

This happens for any user. Since we have the credentials, we should be able to restart the connection. A short term fix would be to just print a better message and tell the user to restart.

Full Reproduction steps:

1) Start a sql server: `dolt sql-server`
2) Connect to the server: `dolt sql`
3) Restart the server process
4) Attempt to run any command in the `dolt sql` shell.

Expected result: The command should execute succesfully

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.