GCP Memorystore Redis: Protocol error, got "\x15" as reply type byte
Asked Answered
B

1

6

I have been researching this Redis error for days now...

I created a GCP Memorystore Redis instance and received the following internal IP endpoint:

10.xxx.xxx.xxx:6378

I created a small GCE instance and made sure that zone matched the Redis instance:

us-central1-f

enter image description here

However, I when I ssh into the VM, connect to Redis, and issue a PING, I get the following error response

Protocol error, got "\x15" as reply type byte

enter image description here

Any idea why I am getting this error?

Bootstrap answered 7/4, 2022 at 16:22 Comment(0)
O
8

If the Redis instance was configured with an AUTH string and/or TLS encryption, you would need to pass these credentials when connecting to it.

I received the same error when using your command to connect to my encrypted instance. This can be done in two ways as far as I tested (from a GCE instance in the same VPC as Redis):

1. Using the redis-cli, you could use the following command to authenticate (see here for information on the flags used in the command):

redis-cli -h <ip_addres> -p <port> -a <auth_string> --tls --cacert <path/to/certificate_file.pem>

Note: the certificate file would need to be installed to your VM.

2. The GCP Memorystore documentation recommends using telnet and Stunnel to connect to a secured and encrypted instance.

Something not included in the documentation is that after running telnet localhost 6378 in step 4, you would need to pass the AUTH string in the telnet console:

AUTH <auth_string>
+OK
PING
+PONG

After that, you can PING the instance in step 5, skipping sending the AUTH string will return this error: -NOAUTH Authentication required. Besides that, you should follow as documented the rest of the steps.

Opportunity answered 8/4, 2022 at 15:42 Comment(2)
thank you, attaching the AUTH string worked...Bootstrap
It will great if you could provide code snipet for java or nodejs or python to connect to my GCP Memorystore Redis instance from us-central1-f with TLS enabled.Monto

© 2022 - 2024 — McMap. All rights reserved.