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

Unable to see value of specific string keys #393

Open
WatersJohn opened this issue Feb 18, 2020 · 7 comments
Open

Unable to see value of specific string keys #393

WatersJohn opened this issue Feb 18, 2020 · 7 comments

Comments

@WatersJohn
Copy link

WatersJohn commented Feb 18, 2020

We've noticed that we're unable to see the values of certain keys that we create programattically in redis. If we create them manually via redis-commander they appear. They also appear when using RedisInsight, so this appears to be unique to redis commander. Example of a key:

RC

The only other item that is notable is that this entry has no TTL.
We expected to see a value of True or False displayed under the key name, but instead see nothing.
The other item that's notable is that we've changed the default folding character from : to |. However, reverting that change made no impact.

@WatersJohn
Copy link
Author

I've since discovered that this only occurs when hosting redis-commander in Azure under node 12.13 on Windows. The same code works fine locally on a VM with node 12.16; I doubt this is a version issue but Azure does not yet have 12.16 available.

@WatersJohn WatersJohn changed the title Unable to see value of specific boolean keys Unable to see value of specific string keys Feb 21, 2020
@sseide
Copy link
Collaborator

sseide commented Feb 21, 2020

Hi - can you please give some more informations to find out whats different?

  • Redis server version?
  • Output of redis command "TYPE <problematic_key>"?
  • Output of redis command "GET <problematic_key>"?

And you said problem only happens on Azure. I assume booth redis commander (Azure and local) use the same Redis server to display data from?

@WatersJohn
Copy link
Author

Thanks for replying! The version of redis is 4.0.14. Correct - redis commander on local and Azure point to the same Redis server.

TYPE <problematic_key> is "string"
GET <problematic_key> is "True"

@WatersJohn
Copy link
Author

One more item - this appears to occur when there is a // in the keyname. ex:
SET Test-https://www.test.com/site False
displays in redis-commander as Test-https:/www.test.com/site,with no value displayed.
however, GET Test-https://www.test.com/site works and shows the value.

@sseide
Copy link
Collaborator

sseide commented Feb 27, 2020

currently i am unable to reproduce it and i have no clue about he reasons. I tested with the latest version from github (master branch).

Are there some error messages inside the browsers javascript console?
No log messages of redis commander server process?

The Azure redis is a Azure db as a service or something you started yourself (VM or container or something like it).

@sseide
Copy link
Collaborator

sseide commented Feb 27, 2020

btw - the docker image is currently running on Node 8, Node 10 should work fine too if its a problem with the node version inside Azure...

@cbazureau
Copy link

cbazureau commented Nov 8, 2021

Hi,

Same problem here. For us it's due to a nginx proxy pass (https://serverfault.com/questions/459369/disabling-url-decoding-in-nginx-proxy)

For example if your key is a:b:{"url","https,//c.com"}

then redis-commander will call /key/<some-connectionId>/a%3Ab%3A%7B"url"%2C"https%2C%2F%2Fc.com"%7D
that will become /key/<some-connectionId>/a:b:{"url","https,/c.com"} (with one slash) when received by redis-commander server.

if you want @sseide i can create a PR with a function like this on front side to build key in url :

window.btoa('a:b:{"url","https,//c.com"}')
    .replace(/\+/g, '-') // (https://en.wikipedia.org/wiki/Base64#Base64_table)
    .replace(/\//g, '_')
    .replace(/=/g, '.')
// => 'YTpiOnsidXJsIiwiaHR0cHMsLy9jLmNvbSJ9'

and then on server-side to get the original key back

Buffer.from(
    'YTpiOnsidXJsIiwiaHR0cHMsLy9jLmNvbSJ9'
      .replace(/-/g, '+')
      .replace(/_/g, '/')
      .replace(/\./g, '='),
    'base64',
  ).toString()

//  => `a:b:{"url","https,//c.com"}`

it will protect the key integrity no matter the architecture above

cbazureau pushed a commit to cbazureau/redis-commander that referenced this issue Nov 8, 2021
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