{"record":{"id":"855079687ffa1922","repo":"gastownhall/beads","slug":"linear-team-id-not-configured-set-linear-team-id","errorCode":null,"errorMessage":"Linear team ID not configured (set linear.team_id, linear.team_ids, or LINEAR_TEAM_ID)","messagePattern":"Linear team ID not configured \\(set linear\\.team_id, linear\\.team_ids, or LINEAR_TEAM_ID\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/linear/tracker.go","lineNumber":69,"sourceCode":"\n\tvar apiKey string\n\tif !hasOAuth {\n\t\tapiKey, _ = t.getConfig(ctx, \"linear.api_key\", \"LINEAR_API_KEY\")\n\t\tif apiKey == \"\" {\n\t\t\treturn fmt.Errorf(\"Linear authentication not configured\\n\" +\n\t\t\t\t\"Options:\\n\" +\n\t\t\t\t\"  OAuth (for CI):  export LINEAR_OAUTH_CLIENT_ID=... LINEAR_OAUTH_CLIENT_SECRET=...\\n\" +\n\t\t\t\t\"  API key (devs):  export LINEAR_API_KEY=... or bd config set linear.api_key \\\"YOUR_API_KEY\\\"\")\n\t\t}\n\t}\n\n\t// Resolve team IDs: use pre-set IDs (from CLI), or fall back to config.\n\tif len(t.teamIDs) == 0 {\n\t\tpluralVal, _ := t.getConfig(ctx, \"linear.team_ids\", \"LINEAR_TEAM_IDS\")\n\t\tsingularVal, _ := t.getConfig(ctx, \"linear.team_id\", \"LINEAR_TEAM_ID\")\n\t\tt.teamIDs = tracker.ResolveProjectIDs(nil, pluralVal, singularVal)\n\t\tif len(t.teamIDs) == 0 {\n\t\t\treturn fmt.Errorf(\"Linear team ID not configured (set linear.team_id, linear.team_ids, or LINEAR_TEAM_ID)\")\n\t\t}\n\t}\n\n\t// Read optional endpoint and project ID.\n\tvar endpoint, projectID string\n\tif store != nil {\n\t\tendpoint, _ = store.GetConfig(ctx, \"linear.api_endpoint\")\n\t\tprojectID, _ = store.GetConfig(ctx, \"linear.project_id\")\n\t\tif projectID != \"\" {\n\t\t\tt.projectID = projectID\n\t\t}\n\t}\n\n\t// Read optional rate-limit floor (LINEAR_RATE_LIMIT_FLOOR env or linear.rate_limit_floor config).\n\tvar rateLimitFloor int\n\tif floorStr, _ := t.getConfig(ctx, \"linear.rate_limit_floor\", \"LINEAR_RATE_LIMIT_FLOOR\"); floorStr != \"\" {\n\t\tif v, err := strconv.Atoi(strings.TrimSpace(floorStr)); err == nil && v >= 0 {\n\t\t\trateLimitFloor = v","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/linear/tracker.go#L51-L87","documentation":"After authentication, Tracker.Init resolves which Linear team(s) to sync. It uses team IDs set via SetTeamIDs (CLI --team flag) if present; otherwise it reads linear.team_ids / LINEAR_TEAM_IDS and linear.team_id / LINEAR_TEAM_ID and passes them through ResolveProjectIDs. If the resolved list is empty, Init fails with this error and no clients are created.","triggerScenarios":"Calling Init with no --team flag and none of linear.team_id, linear.team_ids, LINEAR_TEAM_ID, LINEAR_TEAM_IDS set to a non-empty value.","commonSituations":"New workspace where the team key was never configured; CI environment lacking LINEAR_TEAM_ID; setting the value under the wrong config prefix (e.g. team_id without the linear. prefix); passing only LINEAR_TEAM_IDS where the config loader expected singular (or vice versa) with the other empty.","solutions":["Set the team key: `bd config set linear.team_id \"TEAM_KEY\"` or export LINEAR_TEAM_ID=TEAM_KEY","For multiple teams, set linear.team_ids (comma-separated) or LINEAR_TEAM_IDS","Or pass the team explicitly on the command line with --team","Verify with `bd config get linear.team_id` that the value resolves and has no typos"],"exampleFix":"// before\nexport LINEAR_API_KEY=lin_api_xxx\n// after: add team config\nexport LINEAR_API_KEY=lin_api_xxx\nexport LINEAR_TEAM_ID=ENG\n# or multiple teams\nexport LINEAR_TEAM_IDS=ENG,OPS","handlingStrategy":"validation","validationCode":"// Pre-flight: team must be configured before invoking tracker commands\nif os.Getenv(\"LINEAR_TEAM_ID\") == \"\" && os.Getenv(\"LINEAR_TEAM_IDS\") == \"\" {\n    return fmt.Errorf(\"set linear.team_id / linear.team_ids or pass --team\")\n}","typeGuard":null,"tryCatchPattern":"if err := tr.Init(ctx, store); err != nil {\n    if strings.Contains(err.Error(), \"team ID not configured\") {\n        fmt.Fprintln(os.Stderr, \"Run: bd config set linear.team_id <TEAM_KEY> (or export LINEAR_TEAM_ID)\")\n        os.Exit(2)\n    }\n    return err\n}","preventionTips":["Configure linear.team_id (or team_ids) once per workspace via bd config set","Prefer the --team CLI flag for one-off runs to bypass config","In CI, export LINEAR_TEAM_ID alongside credentials","Verify config resolution with bd config get linear.team_id before debugging deeper"],"tags":["configuration","linear","env-var","sync"],"backgroundTag":"missing-env-var","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}