{
  "id": "kubernetes/statefulset-pvc-template-name",
  "signature": "Error: StatefulSet.apps \"my-statefulset\" is invalid: spec.volumeClaimTemplates[0].metadata.name: Invalid value: \"my-pvc\": must be a DNS label (at most 63 characters, matching regex [a-z0-9]([-a-z0-9]*[a-z0-9])?)",
  "signature_zh": "错误：StatefulSet.apps \"my-statefulset\" 无效：spec.volumeClaimTemplates[0].metadata.name：无效值：\"my-pvc\"：必须是 DNS 标签（最多 63 个字符，匹配正则 [a-z0-9]([-a-z0-9]*[a-z0-9])?）",
  "regex": "spec\\.volumeClaimTemplates\\[\\d+\\]\\.metadata\\.name.*Invalid value.*must be a DNS label",
  "domain": "kubernetes",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The volumeClaimTemplate name in a StatefulSet contains uppercase letters, underscores, or starts with a non-alphanumeric character, violating DNS label rules.",
  "root_cause_type": "generic",
  "root_cause_zh": "StatefulSet 中的 volumeClaimTemplate 名称包含大写字母、下划线或以非字母数字字符开头，违反了 DNS 标签规则。",
  "versions": [
    {
      "version": "Kubernetes 1.24",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.25",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.26",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Changing the PVC name in the template to include underscores or hyphens in wrong positions",
      "why_fails": "DNS 标签不允许下划线，连字符不能在开头或结尾",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding a random suffix like '-pvc' to the name",
      "why_fails": "如果原名称已经无效，添加后缀不会修复根本问题",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignoring the error and reapplying the same YAML",
      "why_fails": "错误是确定性的，重新应用不会改变验证逻辑",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use only lowercase letters, numbers, and hyphens: rename 'My_PVC-1' to 'my-pvc-1' and reapply: kubectl apply -f statefulset.yaml",
      "success_rate": 0.95,
      "how": "Use only lowercase letters, numbers, and hyphens: rename 'My_PVC-1' to 'my-pvc-1' and reapply: kubectl apply -f statefulset.yaml",
      "condition": "",
      "sources": []
    },
    {
      "action": "Validate name before applying: echo 'my-pvc' | grep -E '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'",
      "success_rate": 0.9,
      "how": "Validate name before applying: echo 'my-pvc' | grep -E '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use only lowercase letters, numbers, and hyphens: rename 'My_PVC-1' to 'my-pvc-1' and reapply: kubectl apply -f statefulset.yaml",
    "Validate name before applying: echo 'my-pvc' | grep -E '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#volume-claim-templates",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.93,
  "resolvable": "true",
  "first_seen": "2023-07-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}