dolthub / dolt

Dolt – Git for Data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running sql-server from an empty state make inconsistent repository

guilhem opened this issue · comments

Running sql-server on an empty dir make dolt in an inconsistent state.

sql-server is working well, but dolt ls make error:

The current directories repository state is invalid
open /var/lib/dolt/.dolt/repo_state.json: no such file or directory

It's also impossible to manipulate remotes, etc.

It's also imposible to dolt init:

Failed to initialize directory as a data repo. .dolt directory already exists at '.'

Thanks for the report. I'll try and reproduce. I assume this is on a *nix platfiorm?

@fulghum is going to run through a bunch of tests here and make individual bugs. I have a long running import running on the default port and I don't want to kill it so I can't test myself.

Hi @guilhem, thanks for taking the time to report this one. I did an audit of how Dolt CLI commands behave when you run them in a directory that is being used for a dolt sql-server, but has not been initialized as a Dolt database yet, and I left the results in #7875.

Some commands display a better error message (i.e. "The current directory is not a valid dolt repository."), but many other commands display a confusing error message like the one you reported (i.e. "The current directories repository state is invalid"). I'm working on some changes to make the CLI commands consistently report "The current directory is not a valid dolt repository".

For dolt init, I'm going to customize the error message with some better instructions. Since a running dolt sql-server won't pick up changes properly if you run dolt init on the directory it's running from, we'll output an error message telling customers that a dolt sql-server is running from the same directory, and that it needs to be stopped before that directory can be initialized.

Let us know if you think more is needed to make those error messages more helpful and easier to understand.

This should be fixed by #7876 and the fix to dolt remotes #7622 when @macneale4 has it. I'll resolve as we decomposed it into multiple bugs.