Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Diagnose and fix common Glean API errors including indexing failures, search issues, and permission problems. Trigger: "glean error", "glean not indexing", "glean search empty", "debug glean".
.claude/skills/jeremylongshore-glean-common-errors/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 174% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 20% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 1% | 0% |
Glean provides enterprise search across connected data sources with AI-powered results. API integrations involve two distinct token types (indexing vs. client) and a custom datasource model for pushing content. Common errors stem from token type mismatches, permission misconfiguration that silently hides documents from search results, and bulk indexing failures caused by duplicate upload IDs or oversized documents. Stale results are a frequent complaint -- Glean indexes asynchronously, so newly pushed documents may take 1-5 minutes to appear in search. This reference covers authentication, indexing pipeline, and search-time issues.
| Code | Message | Cause | Fix | |------|---------|-------|-----| | 401 | Unauthorized | Invalid or expired API token | Regenerate at Admin > Settings > API Tokens | | 403 | Wrong token type | Using indexing token for search API | Indexing API needs indexing token; Client API needs client token with X-Glean-Auth-Type: BEARER | | 400 | uploadId already used | Duplicate bulk upload identifier | Generate a unique UUID per upload run | | 400 | document too large | Document body exceeds 100KB limit | Truncate or split content before indexing | | 400 | invalid datasource | Datasource not registered | Create datasource first via adddatasource endpoint | | 400 | missing required field | Document lacks id or title | Ensure every document has both id and title fields | | 403 | Permission denied | Document visibility restricted | Set allowAnonymousAccess: true or add user/group to permissions | | 429 | Rate limit exceeded | Too many API requests | Implement exponential backoff; batch indexing calls |
typescriptinterface GleanError { code: number; message: string; category: "auth" | "rate_limit" | "indexing" | "permission"; } function classifyGleanError(status: number, body: string): GleanError { if (status === 401) { return { code: 401, message: body, category: "auth" }; } if (status === 429) { return { code: 429, message: "Rate limit exceeded", category: "rate_limit" }; } if (status === 403 && body.includes("permission")) { return { code: 403, message: body, category: "permission" }; } if (status === 400) { return { code: 400, message: body, category: "indexing" }; } return { code: status, message: body, category: "auth" }; }
Glean uses two distinct token types. Indexing tokens authenticate bulk document uploads. Client tokens authenticate search queries and require the X-Glean-Auth-Type: BEARER header. Using the wrong token type returns 403, not 401 -- check the token type first.
Glean enforces per-token rate limits. Indexing operations should batch documents (up to 100 per request). Search queries are rate-limited per client token. Use Retry-After header when present and implement exponential backoff starting at 2 seconds.
Bulk index uploads require a unique uploadId per run -- reusing an ID silently drops the upload. Documents must include both id and title fields. Content bodies over 100KB are rejected; truncate or split large documents. New datasources must be registered via adddatasource before any documents can be indexed against them. The datasource field in each document must exactly match the registered datasource name (case-sensitive).
| Scenario | Pattern | Recovery | |----------|---------|----------| | No search results after indexing | Processing delay (1-5 min) | Wait 5 minutes, then verify with direct document lookup | | Stale results returned | Index not refreshed | Trigger re-index; check datasource sync schedule | | Permission mismatch | User lacks document access | Add user/group to document permissions or enable anonymous access | | Bulk upload silently dropped | Duplicate uploadId | Always generate fresh UUID per upload run | | Token type confusion | 403 on search or index | Verify correct token type for the API being called |
bash# Verify client token connectivity curl -s -o /dev/null -w "%{http_code}" \ -H "Authorization: Bearer $GLEAN_API_KEY" \ -H "X-Glean-Auth-Type: BEARER" \ https://your-domain.glean.com/api/v1/search
See glean-debug-bundle.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 16,905 | 16,083 | -5% | 1 | 1 | 0% | 2,261 | 3,285 | +45% | 0 | 0 | — |
case-02 | pass→pass | 15,663 | 9,904 | -37% | 1 | 1 | 0% | 1,737 | 2,907 | +67% | 0 | 0 | — |
case-03 | pass→pass | 17,642 | 11,817 | -33% | 1 | 1 | 0% | 2,229 | 3,478 | +56% | 0 | 0 | — |
case-04 | fail→pass | 15,406 | 15,472 | +0% | 1 | 1 | 0% | 3,320 | 3,434 | +3% | 0 | 0 | — |
case-05 | fail→pass | 20,559 | 11,924 | -42% | 1 | 1 | 0% | 2,627 | 3,363 | +28% | 0 | 0 | — |
case-06 | fail→pass | 9,347 | 6,241 | -33% | 1 | 1 | 0% | 877 | 2,407 | +174% | 0 | 0 | — |
case-07 | fail→pass | 11,036 | 5,080 | -54% | 1 | 1 | 0% | 1,815 | 2,184 | +20% | 0 | 0 | — |
case-08 | fail→pass | 19,545 | 12,803 | -34% | 1 | 1 | 0% | 2,707 | 2,741 | +1% | 0 | 0 | — |
case-09 | pass→pass | 9,947 | 8,866 | -11% | 1 | 1 | 0% | 1,922 | 1,974 | +3% | 0 | 0 | — |
case-10 | fail→pass | 15,800 | 10,457 | -34% | 1 | 1 | 0% | 1,982 | 2,238 | +13% | 0 | 0 | — |
case-11 | pass→pass | 16,093 | 5,592 | -65% | 1 | 1 | 0% | 2,361 | 2,072 | -12% | 0 | 0 | — |
case-12 | fail→pass | 10,514 | 2,902 | -72% | 1 | 1 | 0% | 1,134 | 1,810 | +60% | 0 | 0 | — |
case-13 | fail→pass | 16,116 | 10,145 | -37% | 1 | 1 | 0% | 2,428 | 2,247 | -7% | 0 | 0 | — |
case-14 | pass→pass | 12,951 | 8,040 | -38% | 1 | 1 | 0% | 1,543 | 1,767 | +15% | 0 | 0 | — |
case-15 | fail→pass | 12,119 | 6,704 | -45% | 1 | 1 | 0% | 2,398 | 2,549 | +6% | 0 | 0 | — |
case-16 | pass→pass | 12,522 | 11,701 | -7% | 1 | 1 | 0% | 2,209 | 2,394 | +8% | 0 | 0 | — |
case-17 | pass→pass | 8,163 | 4,009 | -51% | 1 | 1 | 0% | 1,302 | 1,897 | +46% | 0 | 0 | — |
case-18 | pass→pass | 14,992 | 12,543 | -16% | 1 | 1 | 0% | 1,585 | 2,642 | +67% | 0 | 0 | — |
case-19 | fail→pass | 13,539 | 3,108 | -77% | 1 | 1 | 0% | 1,409 | 1,784 | +27% | 0 | 0 | — |
case-20 | pass→pass | 16,806 | 12,294 | -27% | 1 | 1 | 0% | 1,937 | 2,508 | +29% | 0 | 0 | — |
case-21 | fail→pass | 14,308 | 4,020 | -72% | 1 | 1 | 0% | 1,588 | 1,801 | +13% | 0 | 0 | — |
case-22 | pass→pass | 11,062 | 11,342 | +3% | 1 | 1 | 0% | 1,741 | 2,298 | +32% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +50 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.