1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

'RedisException' with message 'Redis server went away' が出たときはそもそもRedisに接続できていない時もある

Posted at

以下のようなコードを書いていたら…

$redis = new Redis();
$redis->connect($host, $port);
$hoge_value = $redis_conn->get('hoge_value');

Redisから値を取得する3行目で次の例外が発生した
FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away'
いろいろ調べたんだが情報も少なくどういうわけで値が取れないのかわからなかった。
接続できているのに値を取ることができないってどういう場合か思いつかない…

が結局はRedisへ接続できていなかった。
$redis->connect($host, $port); の戻り値を調べたところ false が帰ってきており、接続ができていない。自分の場合はAWSのセキュリティグループの設定をミスっており、該当のRedisへ接続ができていなかった。セキュリティグループを見直したところあっさりつながった。

エラーメッセージ的に、接続できたけど接続がどっかいったみたいな言い方だったので解決に時間がかかってしまった。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?