Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Diagnose and fix Lokalise common errors and exceptions. Use when encountering Lokalise errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "lokalise error", "fix lokalise", "lokalise not working", "debug lokalise", "lokalise 401", "lokalise 429".
.claude/skills/jeremylongshore-lokalise-common-errors/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 67% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 105% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 135% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 242% | 0% |
Every Lokalise API error returns a JSON body with a consistent structure. This skill covers the error response format, diagnosis of each HTTP status code (401, 400, 404, 429, 413, 500, 503), diagnostic curl commands for rapid troubleshooting, and a reusable error handling wrapper for the Node SDK.
curl available for diagnostic commands@lokalise/node-api SDK installed for the error wrapperLOKALISE_API_TOKEN environment variablejq installed for parsing JSON responses (optional but recommended)All Lokalise API errors return this structure:
json{ "error": { "message": "Human-readable error description", "code": 401 } }
The code field mirrors the HTTP status code. The message field provides specifics. When using the Node SDK, errors are thrown as exceptions with error.code, error.message, and error.headers properties.
json{"error": {"message": "Invalid `X-Api-Token` header", "code": 401}}
Causes:
X-Api-Token header missing from requestFix:
bash# Verify your token works curl -s -o /dev/null -w "%{http_code}" \ -H "X-Api-Token: ${LOKALISE_API_TOKEN}" \ "https://api.lokalise.com/api2/teams" # Expected: 200 # If 401: regenerate token at https://app.lokalise.com/profile#apitokens
bash# Check for whitespace in token echo -n "$LOKALISE_API_TOKEN" | xxd | head -2 # Look for 0a (newline) or 20 (space) at start/end
json{"error": {"message": "Invalid parameter `platform` - must be one of: ios, android, web, other", "code": 400}}
Common 400 causes:
project_id format (must be {number}.{alphanumeric})ios, android, web, or other)Fix:
bash# Validate project ID format curl -s -H "X-Api-Token: ${LOKALISE_API_TOKEN}" \ "https://api.lokalise.com/api2/projects/${PROJECT_ID}" | jq '.project_id' # List valid languages for a project curl -s -H "X-Api-Token: ${LOKALISE_API_TOKEN}" \ "https://api.lokalise.com/api2/projects/${PROJECT_ID}/languages" \ | jq '.languages[].lang_iso'
json{"error": {"message": "Project not found", "code": 404}}
Causes:
Fix:
bash# List all accessible projects to find the correct ID curl -s -H "X-Api-Token: ${LOKALISE_API_TOKEN}" \ "https://api.lokalise.com/api2/projects?limit=100" \ | jq '.projects[] | {project_id, name}' # Verify a specific key exists curl -s -H "X-Api-Token: ${LOKALISE_API_TOKEN}" \ "https://api.lokalise.com/api2/projects/${PROJECT_ID}/keys/${KEY_ID}" \ | jq '.key_id // .error'
json{"error": {"message": "Too many requests", "code": 429}}
The response includes a Retry-After header indicating seconds to wait.
Fix: See lokalise-rate-limits skill for full implementation. Quick recovery:
bash# Check current rate limit status on any request curl -s -D - -o /dev/null \ -H "X-Api-Token: ${LOKALISE_API_TOKEN}" \ "https://api.lokalise.com/api2/projects" 2>&1 \ | grep -i "x-ratelimit\|retry-after" # Output: # X-RateLimit-Limit: 6 # X-RateLimit-Remaining: 5 # X-RateLimit-Reset: 1700000001
json{"error": {"message": "Request entity too large", "code": 413}}
Causes:
Fix:
json{"error": {"message": "Internal server error", "code": 500}}
These are Lokalise-side issues. Do not retry immediately in a tight loop.
Fix:
bash# Check Lokalise status page curl -s "https://status.lokalise.com/api/v2/status.json" | jq '.status' # If status is operational, retry after 30 seconds # If status shows incident, wait for resolution
Retry strategy for 500/503: wait 30 seconds, retry up to 3 times, then alert.
Quick health check script to diagnose the most common issues in sequence:
bash#!/bin/bash # lokalise-diagnose.sh — Run against your environment TOKEN="${LOKALISE_API_TOKEN}" PROJECT="${LOKALISE_PROJECT_ID}" echo "=== 1. Token validation ===" STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ -H "X-Api-Token: $TOKEN" \ "https://api.lokalise.com/api2/teams") if [ "$STATUS" = "200" ]; then echo "Token: VALID" else echo "Token: INVALID (HTTP $STATUS)" exit 1 fi echo "=== 2. Project access ===" curl -s -H "X-Api-Token: $TOKEN" \ "https://api.lokalise.com/api2/projects/$PROJECT" \ | jq '{project_id: .project_id, name: .name, team_id: .team_id}' echo "=== 3. Rate limit status ===" curl -s -D /dev/stderr -o /dev/null \ -H "X-Api-Token: $TOKEN" \ "https://api.lokalise.com/api2/projects" 2>&1 \ | grep -i "x-ratelimit" echo "=== 4. Key count ===" curl -s -H "X-Api-Token: $TOKEN" \ "https://api.lokalise.com/api2/projects/$PROJECT/keys?limit=1" \ | jq '.project_id as $p | {project: $p, total_keys: .keys | length}'
Wrap all SDK calls with structured error handling:
typescriptimport { LokaliseApi } from "@lokalise/node-api"; interface LokaliseError { code: number; message: string; headers?: Record<string, string>; } function isLokaliseError(error: unknown): error is LokaliseError { return ( typeof error === "object" && error !== null && "code" in error && "message" in error ); } async function lokaliseCall<T>( fn: () => Promise<T>, context: string ): Promise<T> { try { return await fn(); } catch (error) { if (!isLokaliseError(error)) throw error; switch (error.code) { case 401: throw new Error( `[${context}] Authentication failed. ` + `Regenerate token at https://app.lokalise.com/profile#apitokens` ); case 400: throw new Error( `[${context}] Invalid request: ${error.message}. ` + `Check parameter values and required fields.` ); case 404: throw new Error( `[${context}] Resource not found: ${error.message}. ` + `Verify the project/key/resource ID exists and token has access.` ); case 429: console.warn(`[${context}] Rate limited. See lokalise-rate-limits.`); throw error; // Let the rate limit handler deal with retries case 413: throw new Error( `[${context}] Payload too large: ${error.message}. ` + `Split into smaller batches (max 500 items per request).` ); case 500: case 503: throw new Error( `[${context}] Lokalise server error (${error.code}). ` + `Check https://status.lokalise.com — retry after 30s.` ); default: throw new Error( `[${context}] Lokalise error ${error.code}: ${error.message}` ); } } } // Usage const lokalise = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! }); const keys = await lokaliseCall( () => lokalise.keys().list({ project_id: projectId, limit: 500 }), "listKeys" );
| Code | Error | Root Cause | Resolution | |------|-------|-----------|------------| | 401 | Invalid API Token | Token wrong, expired, or whitespace | Regenerate at Lokalise profile | | 400 | Bad Request | Invalid params, missing fields | Check API docs for required fields | | 404 | Not Found | Wrong ID or no access | List resources to find correct ID | | 429 | Rate Limited | Exceeded 6 req/sec | Honor Retry-After, use queue | | 413 | Payload Too Large | Body > 50 MB or > 500 items | Split into batches | | 500 | Internal Server Error | Lokalise-side failure | Check status page, retry after 30s | | 503 | Service Unavailable | Lokalise maintenance/outage | Check status page, wait |
bashcurl -s -H "X-Api-Token: $LOKALISE_API_TOKEN" \ "https://api.lokalise.com/api2/teams" | jq '.teams[0].name // "INVALID TOKEN"'
typescripttry { await lokalise.keys().list({ project_id: "invalid" }); } catch (e: any) { console.log("Code:", e.code); // 400 console.log("Message:", e.message); // "Invalid project ID format" console.log("Headers:", e.headers); // rate limit headers }
bash# Verify CLI token lokalise2 project list --token "$LOKALISE_API_TOKEN" --format json | jq '.[0].name' # Test with verbose output lokalise2 --debug file download \ --token "$LOKALISE_API_TOKEN" \ --project-id "$PROJECT_ID" \ --format json \ --dest ./locales/
For building resilient integrations that handle errors automatically, see lokalise-rate-limits. For debugging translation data issues, see lokalise-data-handling.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 29,468 | 25,438 | -14% | 1 | 1 | 0% | 3,695 | 6,494 | +76% | 0 | 0 | — |
case-02 | fail→pass | 25,144 | 21,809 | -13% | 1 | 1 | 0% | 4,065 | 6,785 | +67% | 0 | 0 | — |
case-03 | fail→pass | 21,872 | 19,939 | -9% | 1 | 1 | 0% | 3,203 | 6,174 | +93% | 0 | 0 | — |
case-04 | fail→fail | 20,145 | 17,840 | -11% | 1 | 1 | 0% | 2,820 | 5,720 | +103% | 0 | 0 | — |
case-05 | fail→fail | 33,186 | 28,901 | -13% | 1 | 1 | 0% | 5,001 | 8,007 | +60% | 0 | 0 | — |
case-06 | pass→pass | 16,786 | 17,793 | +6% | 1 | 1 | 0% | 2,230 | 5,549 | +149% | 0 | 0 | — |
case-07 | pass→pass | 11,525 | 8,520 | -26% | 1 | 1 | 0% | 1,076 | 3,812 | +254% | 0 | 0 | — |
case-08 | pass→pass | 13,859 | 11,645 | -16% | 1 | 1 | 0% | 1,462 | 4,428 | +203% | 0 | 0 | — |
case-09 | pass→pass | 7,826 | 9,161 | +17% | 1 | 1 | 0% | 1,174 | 3,766 | +221% | 0 | 0 | — |
case-10 | fail→pass | 16,499 | 10,575 | -36% | 1 | 1 | 0% | 2,101 | 4,309 | +105% | 0 | 0 | — |
case-11 | fail→fail | 17,067 | 15,928 | -7% | 1 | 1 | 0% | 2,090 | 5,208 | +149% | 0 | 0 | — |
case-12 | fail→pass | 11,198 | 13,238 | +18% | 1 | 1 | 0% | 2,005 | 4,703 | +135% | 0 | 0 | — |
case-13 | pass→pass | 13,941 | 10,115 | -27% | 1 | 1 | 0% | 1,440 | 4,373 | +204% | 0 | 0 | — |
case-14 | pass→pass | 13,536 | 13,683 | +1% | 1 | 1 | 0% | 2,385 | 4,491 | +88% | 0 | 0 | — |
case-15 | fail→pass | 14,394 | 7,881 | -45% | 1 | 1 | 0% | 1,283 | 4,383 | +242% | 0 | 0 | — |
case-16 | fail→pass | 25,638 | 4,842 | -81% | 1 | 1 | 0% | 2,236 | 4,175 | +87% | 0 | 0 | — |
case-17 | fail→pass | 5,798 | 2,159 | -63% | 1 | 1 | 0% | 1,122 | 3,597 | +221% | 0 | 0 | — |
case-18 | fail→pass | 9,640 | 7,788 | -19% | 1 | 1 | 0% | 1,459 | 4,294 | +194% | 0 | 0 | — |
case-19 | pass→pass | 14,114 | 12,861 | -9% | 1 | 1 | 0% | 1,825 | 4,780 | +162% | 0 | 0 | — |
case-20 | pass→pass | 22,724 | 10,622 | -53% | 1 | 1 | 0% | 2,578 | 4,276 | +66% | 0 | 0 | — |
case-21 | fail→fail | 14,882 | 12,238 | -18% | 1 | 1 | 0% | 2,223 | 4,334 | +95% | 0 | 0 | — |
case-22 | pass→pass | 9,892 | 8,148 | -18% | 1 | 1 | 0% | 630 | 3,611 | +473% | 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 +36 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.