{"record":{"id":"9b1d9015c58d6b86","repo":"gastownhall/beads","slug":"linear-authentication-not-configured-options-oa-9b1d90","errorCode":null,"errorMessage":"Linear authentication not configured\nOptions:\n  OAuth (for CI):  export LINEAR_OAUTH_CLIENT_ID=... LINEAR_OAUTH_CLIENT_SECRET=...\n  API key (devs):  export LINEAR_API_KEY=... or bd config set linear.api_key \"...\"","messagePattern":"Linear authentication not configured\nOptions:\n  OAuth \\(for CI\\):  export LINEAR_OAUTH_CLIENT_ID=\\.\\.\\. LINEAR_OAUTH_CLIENT_SECRET=\\.\\.\\.\n  API key \\(devs\\):  export LINEAR_API_KEY=\\.\\.\\. or bd config set linear\\.api_key \"\\.\\.\\.\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/linear.go","lineNumber":1183,"sourceCode":"\n// buildLinearClient resolves auth credentials and returns an appropriately\n// configured Linear client. OAuth takes precedence over API key.\nfunc buildLinearClient(ctx context.Context, teamID string) (*linear.Client, error) {\n\toauthClientID, _ := getLinearConfig(ctx, \"linear.oauth_client_id\")\n\toauthClientSecret, _ := getLinearConfig(ctx, \"linear.oauth_client_secret\")\n\n\tif oauthClientID != \"\" && oauthClientSecret != \"\" {\n\t\tdebug.Logf(\"Linear: using OAuth client-credentials authentication\")\n\t\toauthCfg := linear.OAuthConfig{\n\t\t\tClientID:     oauthClientID,\n\t\t\tClientSecret: oauthClientSecret,\n\t\t}\n\t\treturn linear.NewOAuthClient(oauthCfg, teamID), nil\n\t}\n\n\tapiKey, _ := getLinearConfig(ctx, \"linear.api_key\")\n\tif apiKey == \"\" {\n\t\treturn nil, fmt.Errorf(\"Linear authentication not configured\\n\" +\n\t\t\t\"Options:\\n\" +\n\t\t\t\"  OAuth (for CI):  export LINEAR_OAUTH_CLIENT_ID=... LINEAR_OAUTH_CLIENT_SECRET=...\\n\" +\n\t\t\t\"  API key (devs):  export LINEAR_API_KEY=... or bd config set linear.api_key \\\"...\\\"\")\n\t}\n\n\treturn linear.NewClient(apiKey, teamID), nil\n}\n\n// storeConfigLoader adapts the store to the linear.ConfigLoader interface.\ntype storeConfigLoader struct {\n\tctx context.Context\n}\n\nfunc (l *storeConfigLoader) GetAllConfig() (map[string]string, error) {\n\treturn store.GetAllConfig(l.ctx)\n}\n\n// loadLinearMappingConfig loads mapping configuration from beads config.","sourceCodeStart":1165,"sourceCodeEnd":1201,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/linear.go#L1165-L1201","documentation":"buildLinearClient constructs the Linear API client. It first tries OAuth config (env vars or linear.oauth_client_id/secret), then falls back to linear.api_key. If no API key is present and OAuth wasn't detected, it returns this authentication-not-configured error (note: unlike error 973, this message omits the `bd config set linear.api_key` hint variant with YOUR_API_KEY).","triggerScenarios":"Calling getLinearClient or runLinearTeams when neither LINEAR_OAUTH_CLIENT_ID+SECRET (nor config equivalents) nor LINEAR_API_KEY / linear.api_key are set.","commonSituations":"Fresh install; CI job secrets not exported to the bd process; user set only one of the two OAuth variables (both are required for hasOAuth); API key stored in the wrong config namespace.","solutions":["Export LINEAR_API_KEY or run `bd config set linear.api_key \"YOUR_API_KEY\"`","For CI, export both LINEAR_OAUTH_CLIENT_ID and LINEAR_OAUTH_CLIENT_SECRET (a single one is insufficient)","Confirm with `bd config list` / `env | grep LINEAR` that credentials are visible to the bd process"],"exampleFix":"// before\nexport LINEAR_OAUTH_CLIENT_ID=...   # secret missing\n// after\nexport LINEAR_OAUTH_CLIENT_ID=...\nexport LINEAR_OAUTH_CLIENT_SECRET=...","handlingStrategy":"validation","validationCode":"ok := (os.Getenv(\"LINEAR_OAUTH_CLIENT_ID\") != \"\" && os.Getenv(\"LINEAR_OAUTH_CLIENT_SECRET\") != \"\") ||\n\tos.Getenv(\"LINEAR_API_KEY\") != \"\"\nif !ok {\n\treturn errors.New(\"Linear credentials missing: export LINEAR_API_KEY or OAuth client id+secret\")\n}","typeGuard":null,"tryCatchPattern":"client, err := buildLinearClient(ctx, teamID)\nif err != nil && strings.Contains(err.Error(), \"authentication not configured\") {\n\treturn fmt.Errorf(\"export LINEAR_API_KEY (or both OAuth vars) and retry: %w\", err)\n}","preventionTips":["Export BOTH OAuth variables or use the single API key path","Verify credential visibility inside CI containers and daemon processes","Store the API key via `bd config set linear.api_key` as a persistent fallback"],"tags":["authentication","linear","env-var","configuration"],"backgroundTag":"missing-credentials","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}