apache / kvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
https://kvrocks.apache.org/
Apache License 2.0
3.55k stars 466 forks source link

[BUG] Failed to open DB with missing CURRENT file #437

Closed jasonhe88 closed 2 years ago

jasonhe88 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

get following error message when try to start up kvrocks ( first time run )

E1229 15:41:02.217978 276704704 main.cc:314] Failed to open: IO error: No such file or directory: While opening a file for sequentially reading: /tmp/kvrocks/db/CURRENT: No such file or directory

/tmp/kvrocks directory did exist but no sub-directory ./db under it.

caipengbo commented 2 years ago

Have you tried to modify the dir item in the configuration file?

jasonhe88 commented 2 years ago

Have you tried to modify the dir item in the configuration file?

yes, I modified dir to other directory, still got same msg

caipengbo commented 2 years ago

You create the directory manually and see if it works.

jasonhe88 commented 2 years ago

Have you tried to modify the dir item in the configuration file?

just tried, still the same

by the way, make test all ok

git-hulk commented 2 years ago

@jasonhe88 Can u help to check whether /tmp/kvrocks/db/CURRENT was existed or not, or have a look at your directory permission.

jasonhe88 commented 2 years ago

@jasonhe88 Can u help to check whether /tmp/kvrocks/db/CURRENT was existed or not, or have a look at your directory permission.

here are all the files under /tmp/kvrocks:

lrwxr-xr-x 1 jasonhe wheel 63 12 29 16:07 kvrocks.ERROR -> kvrocks.JasoniMac.local.jasonhe.log.ERROR.20211229-160746.77969 lrwxr-xr-x 1 jasonhe wheel 62 12 29 16:07 kvrocks.INFO -> kvrocks.JasoniMac.local.jasonhe.log.INFO.20211229-160746.77969 -rw-r--r-- 1 jasonhe wheel 341 12 29 15:29 kvrocks.JasoniMac.local.jasonhe.log.ERROR.20211229-152937.72372 -rw-r--r-- 1 jasonhe wheel 341 12 29 15:48 kvrocks.JasoniMac.local.jasonhe.log.ERROR.20211229-154820.76439 -rw-r--r-- 1 jasonhe wheel 341 12 29 16:07 kvrocks.JasoniMac.local.jasonhe.log.ERROR.20211229-160746.77969 -rw-r--r-- 1 jasonhe wheel 411 12 29 15:29 kvrocks.JasoniMac.local.jasonhe.log.INFO.20211229-152937.72372 -rw-r--r-- 1 jasonhe wheel 411 12 29 15:48 kvrocks.JasoniMac.local.jasonhe.log.INFO.20211229-154820.76439 -rw-r--r-- 1 jasonhe wheel 411 12 29 16:07 kvrocks.JasoniMac.local.jasonhe.log.INFO.20211229-160746.77969 -rw-r--r-- 1 jasonhe wheel 341 12 29 15:29 kvrocks.JasoniMac.local.jasonhe.log.WARNING.20211229-152937.72372 -rw-r--r-- 1 jasonhe wheel 341 12 29 15:48 kvrocks.JasoniMac.local.jasonhe.log.WARNING.20211229-154820.76439 -rw-r--r-- 1 jasonhe wheel 341 12 29 16:07 kvrocks.JasoniMac.local.jasonhe.log.WARNING.20211229-160746.77969 lrwxr-xr-x 1 jasonhe wheel 65 12 29 16:07 kvrocks.WARNING -> kvrocks.JasoniMac.local.jasonhe.log.WARNING.20211229-160746.77969

jasonhe88 commented 2 years ago

@jasonhe88 Can u help to check whether /tmp/kvrocks/db/CURRENT was existed or not, or have a look at your directory permission.

the original permisson is 755, i changed to 777, still same

drwxrwxrwx 14 jasonhe wheel 448 12 29 16:07 kvrocks

jasonhe88 commented 2 years ago

tried on CentOS 8, same problem

git-hulk commented 2 years ago

Do you use the release RPM? I have no idea about why this happen since can't reproduce on my side.

fishery86 commented 2 years ago

it seems there have some errors link with rocksdb

jasonhe88 commented 2 years ago

Do you use the release RPM? I have no idea about why this happen since can't reproduce on my side.

tried release RPM on CentOS8, it's running ok

git-hulk commented 2 years ago

Many thanks for your feedback, do you follow the pre-install step before installing?

https://github.com/KvrocksLabs/kvrocks#building-kvrocks

jasonhe88 commented 2 years ago

Many thanks for your feedback, do you follow the pre-install step before installing?

https://github.com/KvrocksLabs/kvrocks#building-kvrocks

no problem, thanks to you guys for this great product :-)

I exactly followed the installation steps, except did a check out before make -4j

git checkout v2.0.5

git-hulk commented 2 years ago

Thanks, I would try to reproduce this issue on my side, very welcome to help us to fix this issue if you have any clues.

git-hulk commented 2 years ago

I finally reproduced this issue by wrongly linking the compression library, Kvrocks will ignore the creating column families error and cause failed to open DB since it didn't auto create the db dir. This will be fixed by #620.