{
  "id": "nginx/name-too-long-buffer-overflow",
  "signature": "nginx: [emerg] the \"server_names_hash_bucket_size\" directive value is too small",
  "signature_zh": "服务器名称哈希桶大小配置值过小",
  "regex": "server_names_hash_bucket_size.*too small",
  "domain": "nginx",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The configured server_names_hash_bucket_size is insufficient for the length of server names defined, causing hash table bucket overflow.",
  "root_cause_type": "generic",
  "root_cause_zh": "配置的 server_names_hash_bucket_size 不足以容纳定义的服务器名称长度，导致哈希表桶溢出。",
  "versions": [
    {
      "version": "nginx/1.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx/1.20.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx/1.24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "nginx/1.26.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "server_names_hash_max_size sets the total hash size, while bucket size controls per-bucket alignment; max_size without increasing bucket_size still causes overflow for long names.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is configuration-specific; removing names only avoids the symptom, not the root cause, and names must be re-added eventually.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The value must be a power of two (e.g., 32, 64, 128, 256) to align with CPU cache lines; non-power-of-two values are ignored or cause other errors.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase server_names_hash_bucket_size to at least 128 in the http block: `http { server_names_hash_bucket_size 128; ... }`",
      "success_rate": 0.9,
      "how": "Increase server_names_hash_bucket_size to at least 128 in the http block: `http { server_names_hash_bucket_size 128; ... }`",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the error persists, double the value (e.g., 256) and reload: `http { server_names_hash_bucket_size 256; }`",
      "success_rate": 0.85,
      "how": "If the error persists, double the value (e.g., 256) and reload: `http { server_names_hash_bucket_size 256; }`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Shorten long server names or use wildcards (e.g., *.example.com instead of very-long-subdomain.example.com) to reduce name length.",
      "success_rate": 0.75,
      "how": "Shorten long server names or use wildcards (e.g., *.example.com instead of very-long-subdomain.example.com) to reduce name length.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 http 块中将 server_names_hash_bucket_size 增加到至少 128：`http { server_names_hash_bucket_size 128; ... }`",
    "如果错误仍然存在，将值加倍（例如 256）并重新加载：`http { server_names_hash_bucket_size 256; }`",
    "缩短长服务器名称或使用通配符（例如 *.example.com 替代 very-long-subdomain.example.com）以减少名称长度。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nginx.org/en/docs/http/ngx_http_core_module.html#server_names_hash_bucket_size",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}