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

"Import keys from RDB file" is not working on MacOS #5265

Closed
umax-imagination-media opened this issue Sep 7, 2022 · 26 comments
Closed

"Import keys from RDB file" is not working on MacOS #5265

umax-imagination-media opened this issue Sep 7, 2022 · 26 comments
Labels

Comments

@umax-imagination-media
Copy link

Describe the bug
this feature is not working on the MacOS version of the app. I am using MacOS Monterey version 12.4 and tried all available MacOS versions of the RESP app from https://resp.app/subscriptions/downloads and I am getting the same issue for all of them - I am not able to select the RDB file for "Path to RDB file" in the "Bulk Operations Manager" window because when I am clicking on the "Select File" button - the MacOS file dialog is showing under the "Bulk Operations Manager" window and I am not able to switch focus to the MacOS file dialog anyhow (even if I move the top window to the side, I can't click on anything in the MacOS file dialog.

#4595 (comment)
To Reproduce
Steps to reproduce the behavior:

  1. Connect to the redis server
  2. Select DB
  3. Click on "Bulk Operations" icon
  4. Click on "Import keys from RDB file" icon
  5. Click on "Select File" button
  6. See the error - not able to focus on the MacOS file dialog

Expected behavior
Import from RDB file is working

Screenshots
image

Environment (please complete the following information):

  • OS & version: MacOS Monterey version 12.4
  • Redis-Server version: 5.0.14

Additional context

@uglide
Copy link
Collaborator

uglide commented Sep 8, 2022

Hello @umax-imagination-media

Thanks for the bug report. This regression issue was fixed and is available in resp-intel-2022.4.44.dmg and resp-arm64-2022.4.58.dmg. Downloads are available on https://resp.app/subscriptions/downloads

@uglide uglide closed this as completed Sep 8, 2022
@u-maxx
Copy link

u-maxx commented Sep 8, 2022

good morning @uglide! Thank you for the fast feedback and fix! I have confirmed that there is no issue with selecting the RDB file in the new version, but unfortunately, import is not working, it is showing the message "Success Bulk Operation Finished" but no keys imported to any DB
image
image

@uglide uglide reopened this Sep 8, 2022
@uglide
Copy link
Collaborator

uglide commented Sep 8, 2022

Could you try to press "Show Matched keys" to determine if the underlying rdbtools package can recognize the RDB file. Also, please provide a screenshot of the "Log" drawer:
Screenshot 2022-08-12 at 11 31 37

@u-maxx
Copy link

u-maxx commented Sep 8, 2022

Sure, there is "Cannot get the list of affected keys" message
image

image

@uglide
Copy link
Collaborator

uglide commented Sep 8, 2022

@u-maxx Could you also share the output in the Log drawer? Instructions on how to open in in my previous message

@u-maxx
Copy link

u-maxx commented Sep 8, 2022

Sure, sorry, I pasted the wrong second screenshot.
image

I am connecting to the Redis server via ssh tunnel because the Redis server is running inside the docker container.

@u-maxx
Copy link

u-maxx commented Sep 8, 2022

image

`Connection: redis-server doesn't support AUTH command or ismisconfigured. Trying to proceed without password. (Error:ERR wrong number of arguments for 'auth' command)`

Formatters: Return value of PyObject call is NULL: Traceback (most recent call last):
File "qrc:/python//rdb/__init__.py", line 56, in rdb_list_keys process_command(callback, path_to_rdb, db, File "qrc:/python//rdb/__init__.py", line 35, in process_command parser = rdbtools.RdbParser(callback=callback, filters=filters, ignore_values=scan_keys) TypeError: __init__() got an unexpected keyword argument 'ignore_values'

@uglide
Copy link
Collaborator

uglide commented Sep 8, 2022

@u-maxx Thanks. It's a packaging bug. Please try resp-arm64-2022.4.59.dmg build. Thanks!

@u-maxx
Copy link

u-maxx commented Sep 8, 2022

@uglide thank you for the fastest bugfixes and great support!
The previous bugs are fixed, but for some reason it is importing only ~7300 keys (I have made few tests and this value is changing from 7299-7301) from the 29770 keys which are shown in the "Matched keys:" area:

image

As you can see the loading message is showing "Processed: 29565" message, but it is loading for a few minutes w/o progress (I have tested a few times). If I click on the main window - the import window disappears and then if I click on "Reload Keys in Database" icon for db0 - it is showing 7299 keys
image

The RDB file which I am trying to import is 31,6 MB and should have 29770 keys (according to the info from Matched keys)
Here are the logs:
image

Would be great to import the full RDB file.

@u-maxx
Copy link

u-maxx commented Sep 8, 2022

I have tried to wait for more than 1h w/o clicking anywhere during the import loading animation, but as result, it was still loading, and after clicking on the main window - it was showing the same result as in my previous comment - only 7299 keys were imported.

uglide added a commit that referenced this issue Sep 8, 2022
uglide added a commit that referenced this issue Sep 8, 2022
@uglide uglide closed this as completed in 31e0723 Sep 12, 2022
@uglide
Copy link
Collaborator

uglide commented Sep 12, 2022

@u-maxx Please try build resp-arm64-2022.5.62.dmg from the website. Thanks!

@uglide uglide reopened this Sep 12, 2022
@u-maxx
Copy link

u-maxx commented Sep 13, 2022

Hello @uglide! Thank you for the update, unfortunately, I am not able to find the resp-arm64-2022.5.62.dmg build on the website, the latest available is "macOS Apple Silicon — 2022.4.59"
image
Could you please check if the links on the website are correct?

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

Oh, sorry, I see the "macOS Apple Silicon — 2022.5.62" on the "Preview Builds" tab. Checking.

@uglide
Copy link
Collaborator

uglide commented Sep 13, 2022

@u-maxx yes, it's on the preview builds tab

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

I have tried to import the same RDB file and got the following error:

image

image

As a result the same amount of keys were imported - 7301 of 29770 keys from RDB file (according to the info from Matched keys)

@uglide
Copy link
Collaborator

uglide commented Sep 13, 2022

@u-maxx Where your rdb file comes from? Is it produced by Redis v5?

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

It is from Redis server v=6.2.0

redis-server -v Redis server v=6.2.0 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=bb6d0fd02006ff98

@uglide
Copy link
Collaborator

uglide commented Sep 13, 2022

@u-maxx you need to upgrade your local redis to v6 first

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

Ok, thank you for the help! I will give it a try, it is set to v6 in the config files for my docker setup but looks like because of a bug in that docker tool (warden) it has used Redis v5.

@uglide
Copy link
Collaborator

uglide commented Sep 13, 2022

RESP.app uses a modified version of https://github.com/sripathikrishnan/redis-rdb-tools which has limited RDB support (only standard types are supported). For your use case, it should work fine if redis versions are the same. If your rdb file contains keys created by redis modules then you need to filter them out with regex like sess_.+

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

I am still getting the same error and number of keys imported even on Redis v6.2.7,
image
image
Do you think this error is caused by the data inside my RDB file?
I can't use the regex for RDB file since it is not a regular text file. Do you know any way to ignore some keys during export from Redis server to RDB file?

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

The error message during import is Cannot execute command ERR unknown command ef81c109dacbceb8e94b, with args beginning with:

@uglide
Copy link
Collaborator

uglide commented Sep 13, 2022

@u-maxx There is a field for that in the RESP.app import dialog:
image

You just need to update default regex there.

@uglide
Copy link
Collaborator

uglide commented Sep 13, 2022

@u-maxx It might be a good idea to just replace rdb file in local redis if it's just in a local container.

@u-maxx
Copy link

u-maxx commented Sep 13, 2022

image

image

There is only 1 key matching the text from the error message, and if I use the regex feature which you have mentioned - this key is imported w/o issues. So I am not sure what is causing the error then on the full RDB file.

I know about the possibility to manually replacing the RDB file, and tried that but Redis server was overwriting my file, so I started trying to use your tool for RDB import.

@u-maxx
Copy link

u-maxx commented Nov 9, 2022

@uglide thank you a lot for the help! I was able to find out why I was not able to import all the keys from RDB dump - the reason was that the data which were stored in the RDB is the sessions, which have expiration date, so during the import Redis was ignoring the info which has expired 🤯

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

No branches or pull requests

3 participants