RedisDesktopManager icon indicating copy to clipboard operation
RedisDesktopManager copied to clipboard

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

Open umax-imagination-media opened this issue 3 years ago • 25 comments

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.

https://github.com/uglide/RedisDesktopManager/pull/4595#issuecomment-1239802177 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

umax-imagination-media avatar Sep 07 '22 19:09 umax-imagination-media

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 avatar Sep 08 '22 07:09 uglide

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

u-maxx avatar Sep 08 '22 07:09 u-maxx

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

uglide avatar Sep 08 '22 07:09 uglide

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

image

u-maxx avatar Sep 08 '22 07:09 u-maxx

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

uglide avatar Sep 08 '22 07:09 uglide

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 avatar Sep 08 '22 07:09 u-maxx

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'

u-maxx avatar Sep 08 '22 08:09 u-maxx

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

uglide avatar Sep 08 '22 08:09 uglide

@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 avatar Sep 08 '22 08:09 u-maxx

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.

u-maxx avatar Sep 08 '22 10:09 u-maxx

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

uglide avatar Sep 12 '22 11:09 uglide

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 avatar Sep 13 '22 09:09 u-maxx

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

u-maxx avatar Sep 13 '22 09:09 u-maxx

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

uglide avatar Sep 13 '22 09:09 uglide

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)

u-maxx avatar Sep 13 '22 09:09 u-maxx

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

uglide avatar Sep 13 '22 09:09 uglide

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

u-maxx avatar Sep 13 '22 10:09 u-maxx

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

uglide avatar Sep 13 '22 10:09 uglide

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.

u-maxx avatar Sep 13 '22 10:09 u-maxx

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_.+

uglide avatar Sep 13 '22 10:09 uglide

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 avatar Sep 13 '22 11:09 u-maxx

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

u-maxx avatar Sep 13 '22 11:09 u-maxx

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

You just need to update default regex there.

uglide avatar Sep 13 '22 12:09 uglide

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

uglide avatar Sep 13 '22 12:09 uglide

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 avatar Sep 13 '22 12:09 u-maxx

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

u-maxx avatar Nov 09 '22 22:11 u-maxx