dvc: "unexpected error - unable to open database" file after updating from 0.59.2 to 0.71.0
Please provide information about your setup DVC version: 0.71.0 Platform: Ubuntu 18.04 Method of installation: pip
Iโve used dvc for managinf model files. I have not updated dvc for a while and after doing so going from 0.59.2 to 0.71.0 I could not add any new files to the existing dvc cache.
Here is the verbose output of the dvc add command
dvc add Empty\ Document -v
/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/git/repo/base.py:129: UserWarning: The use of environment variables in paths is deprecated
for security reasons and may be removed in the future!!
warnings.warn("The use of environment variables in paths is deprecated" +
ERROR: unexpected error - unable to open database file
------------------------------------------------------------
Traceback (most recent call last):
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/main.py", line 49, in main
ret = cmd.run()
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/command/add.py", line 25, in run
fname=self.args.file,
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/repo/__init__.py", line 35, in wrapper
with repo.lock, repo.state:
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/state.py", line 136, in __enter__
self.load()
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/state.py", line 228, in load
self.database = _connect_sqlite(self.state_file, {"nolock": 1})
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/state.py", line 495, in _connect_sqlite
return sqlite3.connect(uri, uri=True)
sqlite3.OperationalError: unable to open database file
Downgrading dvc version to 0.59.2 makes the problem dissapear again.
It feels like some backwards incopatibility issue?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (13 by maintainers)
Commits related to this issue
- state: quote % in path Fixes #2885 — committed to efiop/dvc by efiop 5 years ago
@mroutis I used
pip install dvc --upgrade
doingpip uninstall dvc && pip install dvc
like in your example did not change the behaviour@efiop I tried updating dvc and then removing
.dvc/state
but still experience the same behaviour.Here are the outputs: For the working version
and for the latest version
Output of
python -c 'import sqlite3; print(str(sqlite3.sqlite_version_info))'
(3, 29, 0)Perhaps there some other small example I could also try to reproduce?
I couldnโt reproduce it @sremm, @efiop ๐
Maybe your state file got corrupted somehow.
How did you perform the update?
@sremm Great news! So weโve found the issue. Patch is coming soon, stay tuned! ๐ Thanks for the feedback!
Running the snipped below
results in no errors and the state file is created in
/home/mlburk/Repositories/Repo%20Base/.dvc/
@efiop So ๐ the prevous output from Ubuntu
Note that in my previous comment I also had to change the actual repository name, I realised that special characters might also have an effect and that there is the โ%20โ in the folder name as seen below, everything else is just letters. (same name on widows for the actualy repository folder)
and the new test
test_for_dvc_bug_2.py
So this runs without errors. I guess this is what you expected since the โ_build_sqlite_uriโ function is under suspect. The โ%20โ in the name does not seem to be an issue for the sqlite3.connect() call though.