redis-rdb-tools icon indicating copy to clipboard operation
redis-rdb-tools copied to clipboard

Invalid RDB version number 9 while extracting redis dump

Open alokch18 opened this issue 5 years ago • 8 comments

Hi Krishnan,

We are trying to extract the redis dump through your tool "redis-rdb-tools" but we are getting the below error while executing "rdb --command json /home/gstjdgusr/Redis_rdb_Tool/bk20200207-120000-6-GstMasterDb-1_of_2-16-1-2048.rdb > GstMasterDb_DC1_01.txt" under path "/home/gstjdgusr/Redis_rdb_Tool/redis-rdb-tools-master".

Kindly help us to resolve the same.

Traceback (most recent call last): File "/usr/bin/rdb", line 9, in load_entry_point('rdbtools==0.1.11', 'console_scripts', 'rdb')() File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/cli/rdb.py", line 86, in main parser.parse(dump_file) File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/parser.py", line 350, in parse self.parse_fd(open(filename, "rb")) File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/parser.py", line 355, in parse_fd self.verify_version(f.read(4)) File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/parser.py", line 816, in verify_version raise Exception('verify_version', 'Invalid RDB version number %d' % version) Exception: ('verify_version', 'Invalid RDB version number 9')

Regards, Alok

alokch18 avatar Feb 10 '20 07:02 alokch18

@alokch18 it looks like maybe you're using an old version of redis-rdb-tools. rdb version 9 (Redis 5.0) is supported long ago.

oranagra avatar Feb 10 '20 09:02 oranagra

Hi Oranagra,

I downloaded a package from the site itself for which I'm getting the same error. Can you please share the link to download the latest package.

alokch18 avatar Feb 10 '20 11:02 alokch18

@alokch18 this is the latest release: https://github.com/sripathikrishnan/redis-rdb-tools/archive/rdbtools-0.1.14.tar.gz

oranagra avatar Feb 10 '20 12:02 oranagra

@oranagra , Thanks for the link for latest release but I'm getting the same error as before when I used the latest package. It seems that it is using the old tool only even though I have moved the previous tool in different directory altogether. Also, kindly let us know if we need to install the tool post copying , unzipping and after doing tar -xvf "tool_name".

[gstjdgusr@TRNJDGD1 Redis_rdb_Tool]$ rdb --command json /home/gstjdgusr/Redis_rdb_Tool/bk20200207-120000-6-GstMasterDb-1_of_2-16-1-2048.rdb > GstMasterDb_DC1_02.txt Traceback (most recent call last): File "/usr/bin/rdb", line 9, in load_entry_point('rdbtools==0.1.11', 'console_scripts', 'rdb')() File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/cli/rdb.py", line 86, in main parser.parse(dump_file) File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/parser.py", line 350, in parse self.parse_fd(open(filename, "rb")) File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/parser.py", line 355, in parse_fd self.verify_version(f.read(4)) File "/usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg/rdbtools/parser.py", line 816, in verify_version raise Exception('verify_version', 'Invalid RDB version number %d' % version) Exception: ('verify_version', 'Invalid RDB version number 9')

alokch18 avatar Feb 11 '20 07:02 alokch18

@alokch18 yes, you need to install the tool, the rdb command you run isn't executed from the current directory.. do which rdb and you'll see. maybe you just need to pip install --upgrade rdbtools?

bottom line, you'll need to either find out how you installed it and upgrade it. or if you want, you can run it from source using something like this:

env PYTHONPATH=`pwd` python rdbtools/cli/rdb.py --command json file.rdb

oranagra avatar Feb 11 '20 08:02 oranagra

@oranagra When I tried to install using command "pip install --upgrade rdbtools", I got the below mentioned response.

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc6b43ce910>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/rdbtools/ Requirement already up-to-date: rdbtools in /usr/lib/python2.7/site-packages/rdbtools-0.1.11-py2.7.egg (0.1.11) Requirement already satisfied, skipping upgrade: redis in /usr/lib/python2.7/site-packages/redis-2.7.3-py2.7.egg (from rdbtools) (2.7.3)

However, when I retried the conversion, I got the same error as mentioned before, i.e., Invalid RDB version number 9'.

alokch18 avatar Feb 12 '20 05:02 alokch18

@alokch18 i don't know what's wrong with your pip. when i try to install rdbtools i get the right version, which is 0.1.14 (see https://pypi.org/project/rdbtools/)

oranagra avatar Feb 12 '20 07:02 oranagra

I ran into this issue myself, and I discovered PyPI doesn't have an up-to-date rdbtools available for Python 2.

Python3 and pip3 work just fine.

pip3 install --upgrade rdbtools # should take care of this issue.

sksksksksksksk avatar May 29 '21 10:05 sksksksksksksk