crewAIInc/crewAI · error · SystemExit
Failed to download skill {ref}: {get_response.status_code}
Error message
Failed to download skill {ref}: {get_response.status_code} What it means
The registry API `get_skill` call returned a non-200, non-404 status code (e.g. 401, 403, 429, 500, 502). The CLI surfaces the raw status number because it cannot infer the specific cause, and exits with SystemExit(1).
Source
Thrown at lib/cli/src/crewai_cli/skills/main.py:124
"non-empty path segments (no slashes, no '..').[/red]"
)
raise SystemExit(1)
self._print_current_organization()
console.print(f"[bold blue]Downloading skill {ref}...[/bold blue]")
get_response = self.plus_api_client.get_skill(org, name)
if get_response.status_code == 404:
console.print(
f"[red]Skill {ref} not found. Ensure it has been published and you have access.[/red]"
)
raise SystemExit(1)
if get_response.status_code != 200:
console.print(
f"[red]Failed to download skill {ref}: {get_response.status_code}[/red]"
)
raise SystemExit(1)
data = get_response.json()
version = data.get("latest_version") or data.get("version")
download_url = data.get("download_url")
if download_url:
import httpx
dl_response = httpx.get(download_url, follow_redirects=True)
dl_response.raise_for_status()
archive_bytes = dl_response.content
else:
encoded = data.get("file", "")
if "," in encoded:
encoded = encoded.split(",", 1)[1]
archive_bytes = base64.b64decode(encoded)
in_project = os.path.isfile("pyproject.toml")View on GitHub (pinned to 754d7323be)
Solutions
- Re-authenticate (`crewai org switch` / re-login) and retry — 401/403 are the most common non-404 failures.
- Check the CrewAI registry status page or retry after a short delay for 5xx/429 responses.
- If behind a corporate proxy, verify HTTPS_PROXY/NO_PROXY settings allow api calls to the registry host.
Example fix
# before crewai skill install @org/tool # Failed to download skill @org/tool: 401 # after crewai org switch <org_id> # refresh auth/token crewai skill install @org/tool
Defensive patterns
Strategy: retry
Validate before calling
import httpx
def registry_reachable(base_url: str) -> bool:
try:
return httpx.get(base_url, timeout=5).status_code < 500
except httpx.HTTPError:
return False Try / catch
import subprocess, time
for attempt in range(3):
proc = subprocess.run(["crewai", "skill", "install", ref], capture_output=True, text=True)
if proc.returncode == 0:
break
if "401" in proc.stderr or "403" in proc.stderr: # auth: retrying won't help
subprocess.run(["crewai", "org", "switch", org_id], check=True)
continue
if attempt < 2:
time.sleep(2 ** attempt) # backoff for 429/5xx
else:
raise RuntimeError(f"skill install failed: {proc.stderr}") Prevention
- Re-authenticate before batch installs so 401s never occur mid-run.
- Add exponential backoff around the CLI for 429/5xx; do not retry auth errors blindly.
- Pin registry connectivity checks in CI before installing skills.
When it happens
Trigger: Expired or invalid auth token (401), rate limiting (429), registry outage or maintenance (5xx), or proxy/firewall intercepting the request with an unexpected status — any `get_response.status_code` outside {200, 404} on the `get_skill(org, name)` call.
Common situations: Stale login after rotating API keys; corporate proxies returning 407/502; registry incidents; hitting rate limits in CI loops that install many skills.
Related errors
- Skill {ref} not found. Ensure it has been published and you
- Project name '{name}' would generate invalid Python module n
- Failed to switch organization: {e!s}
- Directory {skill_dir} already exists.
- Invalid skill reference. Use the format @org/name.
AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15).
Data as JSON: /api/errors/522ac45a674cbc01.
Report an issue: GitHub.