{"record":{"id":"3f74b1caf003014c","repo":"larksuite/cli","slug":"missing-sheet-id-for-sheet-title-r","errorCode":null,"errorMessage":"Missing sheet_id for sheet {title!r}","messagePattern":"Missing sheet_id for sheet (.+?)","errorType":"exception","errorClass":"LarkCliError","httpStatus":null,"severity":"error","filePath":"skills/lark-sheets/scripts/lark_chart_layout_check.py","lineNumber":286,"sourceCode":"    return {\"url\": target} if target.startswith((\"http://\", \"https://\")) else {\"spreadsheet_token\": target}\n\n\ndef _sheet_counts(sheet: dict[str, Any]) -> tuple[int, int]:\n    row_count = int(sheet.get(\"row_count\") or sheet.get(\"rowCount\") or 0)\n    column_count = int(sheet.get(\"column_count\") or sheet.get(\"columnCount\") or 0)\n    if row_count <= 0 or column_count <= 0:\n        raise LarkCliError(f\"Missing row_count/column_count for sheet {sheet_title(sheet)!r}\")\n    return row_count, column_count\n\n\ndef check_sheet(\n    locator: dict[str, str], sheet: dict[str, Any], *, timeout: int, sample_limit: int\n) -> dict[str, Any]:\n    sheet_id = sheet_identifier(sheet)\n    title = sheet_title(sheet)\n    row_count, column_count = _sheet_counts(sheet)\n    if not sheet_id:\n        raise LarkCliError(f\"Missing sheet_id for sheet {title!r}\")\n\n    structure_data = envelope_data(\n        run_sheets(\n            \"+sheet-info\",\n            **locator,\n            sheet_id=sheet_id,\n            flags={\"include\": \"row_heights,col_widths\"},\n            timeout=timeout,\n        )\n    )\n    row_edges, column_edges, warnings = build_layout(\n        extract_sheet_structure(structure_data), row_count, column_count\n    )\n    chart_data = envelope_data(\n        run_sheets(\"+chart-list\", **locator, sheet_id=sheet_id, timeout=timeout)\n    )\n    charts = extract_charts(chart_data, sheet_id, title)\n","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/skills/lark-sheets/scripts/lark_chart_layout_check.py#L268-L304","documentation":"Raised by the chart layout check when a worksheet in the spreadsheet's sheet list matches the requested title but carries no sheet_id, so later layout API calls have no target identifier. It fires when the metadata payload (title) and the identifier payload (sheet_id) disagree - typically a truncated or nonstandard sheets metadata response.","triggerScenarios":"Calling skillscheck.ParseLayout with a layout string other than \"separate\" or \"suite\" (e.g. \"combined\", \" Suites\" after trim fails, \"seperate\"), or passing a non-empty --layout flag value from updateRun/runSkillsAndState/ResolveLayout.","commonSituations":"Typing the layout flag value wrong on the command line; a config/state file with a hand-edited layout field; scripts passing a stale layout name after the enum shrank to two values.","solutions":["Use exactly \"separate\" or \"suite\" as the layout value (empty string is allowed and means default/effective).","Check the configured value with `lark-cli skills` docs or --help for the accepted flag values and correct the spelling.","If the value comes from a saved SkillsState, fix or delete the stale layout field so EffectiveLayout falls back to \"separate\"."],"exampleFix":"// before\nlayout, err := skillscheck.ParseLayout(\"seperate\") // typo\n// after\nlayout, err := skillscheck.ParseLayout(\"separate\")\nif err != nil { return err }","handlingStrategy":"validation","validationCode":"func validLayout(v string) bool {\n    switch skillscheck.Layout(strings.TrimSpace(v)) {\n    case \"\", skillscheck.LayoutSeparate, skillscheck.LayoutSuite:\n        return true\n    }\n    return false\n}","typeGuard":"func asLayout(v string) (skillscheck.Layout, bool) {\n    l, err := skillscheck.ParseLayout(v)\n    return l, err == nil\n}","tryCatchPattern":"layout, err := skillscheck.ParseLayout(flagValue)\nif err != nil {\n    return fmt.Errorf(\"--layout must be 'separate' or 'suite'\")\n}","preventionTips":["Expose layout as a constrained flag/enum in the UI rather than free text.","Scrub stale layout fields from saved SkillsState files when upgrading.","Check --help for accepted values before scripting the skills commands."],"tags":["go","validation","cli-flags","skills"],"backgroundTag":"invalid-enum-value","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}