{
  "id": "terraform/invalid-terraform-workspace-name",
  "signature": "Error: Invalid workspace name: Workspace names must start with a letter and may contain only letters, digits, underscores, and hyphens. Name \"my workspace\" is invalid.",
  "signature_zh": "错误：无效的工作区名称：工作区名称必须以字母开头，且只能包含字母、数字、下划线和连字符。名称 \"my workspace\" 无效。",
  "regex": "Error: Invalid workspace name: Workspace names must start with a letter and may contain only letters, digits, underscores, and hyphens\\. Name \".*\" is invalid\\.",
  "domain": "terraform",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The workspace name contains spaces or special characters that violate Terraform's naming rules for workspaces.",
  "root_cause_type": "generic",
  "root_cause_zh": "工作区名称包含空格或特殊字符，违反了 Terraform 对工作区的命名规则。",
  "versions": [
    {
      "version": "Terraform v1.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Shell escaping doesn't change the workspace name stored in Terraform; the name itself is invalid regardless of how it's passed.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Quotes only prevent shell splitting; Terraform still validates the name and rejects spaces.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The environment variable is used to select an existing workspace, not to create one. The name validation still applies.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use underscore or hyphen instead of space: 'terraform workspace new my_workspace' or 'terraform workspace new my-workspace'. This is the only valid approach.",
      "success_rate": 1.0,
      "how": "Use underscore or hyphen instead of space: 'terraform workspace new my_workspace' or 'terraform workspace new my-workspace'. This is the only valid approach.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use underscore or hyphen instead of space: 'terraform workspace new my_workspace' or 'terraform workspace new my-workspace'. This is the only valid approach."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/cli/commands/workspace/new",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 1.0,
  "resolvable": "true",
  "first_seen": "2023-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}