You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using GCP Memorystore Redis Cluster. The way this works is you know its main IP and connect on port 6379, but may be MOVED to another arbitrary IP/port. We don't know the members of the cluster up-front, and rely on CLUSTER SHARDS to find the members of the cluster.
This works fine with predis, unless we need to authenticate. It seems like whenever there's a MOVED response from the Redis server, the newly created connection loses its password attribute.
To Reproduce
Set up a Redis Cluster which requires password authentication.
Run the PHP code snippet below. It may work some of the times, but will fail other times.
<?phprequire'vendor/autoload.php';
// this only works in GCE/GKE, but bug should be reproducible with any arbitrary password$ch = curl_init("http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Metadata-Flavor: Google"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true)
$token = json_decode(curl_exec($ch))->access_token;
$client = newPredis\Client(
[["proto" => "tcp", "host" => "redis-cluster", "port" => 6379, "password" => $token]],
["cluster" => "redis", ["parameters" => ["password" => $token]]]
);
$client->set("tmp_test", "it works", "EX", 60);
echo$client->get("tmp_test");
Expected behavior
Connections instantiated by RedisCluster should take its password from $parameters["password"], or at least inherit the password attribute from the RedisCluster object itself.
Versions (please complete the following information):
Predis: 2.2.2
PHP 8.2.19
Redis Server 7.0.15 (according to redis-cli info, but it is GCP Memorystore)
Alpine Linux 3.19.1
The text was updated successfully, but these errors were encountered:
We're using GCP Memorystore Redis Cluster. The way this works is you know its main IP and connect on port 6379, but may be
MOVED
to another arbitrary IP/port. We don't know the members of the cluster up-front, and rely onCLUSTER SHARDS
to find the members of the cluster.This works fine with predis, unless we need to authenticate. It seems like whenever there's a
MOVED
response from the Redis server, the newly created connection loses its password attribute.To Reproduce
Expected behavior
Connections instantiated by
RedisCluster
should take its password from$parameters["password"]
, or at least inherit the password attribute from theRedisCluster
object itself.Versions (please complete the following information):
redis-cli info
, but it is GCP Memorystore)The text was updated successfully, but these errors were encountered: