Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid RDB version number 9 while extracting redis dump #161

Open
alokch18 opened this issue Feb 10, 2020 · 8 comments
Open

Invalid RDB version number 9 while extracting redis dump #161

alokch18 opened this issue Feb 10, 2020 · 8 comments

Comments

@alokch18
Copy link

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

@oranagra
Copy link
Collaborator

@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.

@alokch18
Copy link
Author

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.

@oranagra
Copy link
Collaborator

@alokch18
Copy link
Author

@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')

@oranagra
Copy link
Collaborator

@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

@alokch18
Copy link
Author

@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'.

@oranagra
Copy link
Collaborator

@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/)

@sksksksksksksk
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants