{
  "id": "php/redis-connection-read-error",
  "signature": "RedisException: read error on connection to 127.0.0.1:6379 in /var/www/app/src/Cache/RedisCache.php:15",
  "signature_zh": "RedisException：连接到 127.0.0.1:6379 时读取错误，位于 /var/www/app/src/Cache/RedisCache.php 第 15 行",
  "regex": "RedisException:\\s*read\\s*error\\s*on\\s*connection\\s*to\\s*\\d+\\.\\d+\\.\\d+\\.\\d+:\\d+",
  "domain": "php",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The Redis server closed the connection abruptly, often due to timeout settings, memory pressure, or network instability.",
  "root_cause_type": "generic",
  "root_cause_zh": "Redis 服务器突然关闭了连接，通常是由于超时设置、内存压力或网络不稳定。",
  "versions": [
    {
      "version": "PHP 8.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 6.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing PHP's default_socket_timeout in php.ini does not affect Redis socket timeouts, which are handled separately.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting only PHP-FPM without restarting Redis may not help if the Redis server itself is overloaded or has a high memory usage.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling persistence (redis.persistent) may reduce the frequency but does not address the root cause of connection drops.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the Redis server's timeout setting (timeout 0) in redis.conf to prevent idle connections from being closed.",
      "success_rate": 0.85,
      "how": "Increase the Redis server's timeout setting (timeout 0) in redis.conf to prevent idle connections from being closed.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement a retry mechanism in PHP with exponential backoff when a RedisException is caught.",
      "success_rate": 0.8,
      "how": "Implement a retry mechanism in PHP with exponential backoff when a RedisException is caught.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the Redis server's timeout setting (timeout 0) in redis.conf to prevent idle connections from being closed.",
    "Implement a retry mechanism in PHP with exponential backoff when a RedisException is caught."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://github.com/phpredis/phpredis#readme",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}