{"record":{"id":"522ac45a674cbc01","repo":"crewAIInc/crewAI","slug":"failed-to-download-skill-ref-get-response-stat","errorCode":null,"errorMessage":"Failed to download skill {ref}: {get_response.status_code}","messagePattern":"Failed to download skill (.+?): (.+?)","errorType":"http","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/skills/main.py","lineNumber":124,"sourceCode":"                \"non-empty path segments (no slashes, no '..').[/red]\"\n            )\n            raise SystemExit(1)\n\n        self._print_current_organization()\n        console.print(f\"[bold blue]Downloading skill {ref}...[/bold blue]\")\n\n        get_response = self.plus_api_client.get_skill(org, name)\n\n        if get_response.status_code == 404:\n            console.print(\n                f\"[red]Skill {ref} not found. Ensure it has been published and you have access.[/red]\"\n            )\n            raise SystemExit(1)\n        if get_response.status_code != 200:\n            console.print(\n                f\"[red]Failed to download skill {ref}: {get_response.status_code}[/red]\"\n            )\n            raise SystemExit(1)\n\n        data = get_response.json()\n        version = data.get(\"latest_version\") or data.get(\"version\")\n\n        download_url = data.get(\"download_url\")\n        if download_url:\n            import httpx\n\n            dl_response = httpx.get(download_url, follow_redirects=True)\n            dl_response.raise_for_status()\n            archive_bytes = dl_response.content\n        else:\n            encoded = data.get(\"file\", \"\")\n            if \",\" in encoded:\n                encoded = encoded.split(\",\", 1)[1]\n            archive_bytes = base64.b64decode(encoded)\n\n        in_project = os.path.isfile(\"pyproject.toml\")","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/skills/main.py#L106-L142","documentation":"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).","triggerScenarios":"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.","commonSituations":"Stale login after rotating API keys; corporate proxies returning 407/502; registry incidents; hitting rate limits in CI loops that install many skills.","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."],"exampleFix":"# before\ncrewai skill install @org/tool   # Failed to download skill @org/tool: 401\n# after\ncrewai org switch <org_id>   # refresh auth/token\ncrewai skill install @org/tool","handlingStrategy":"retry","validationCode":"import httpx\n\ndef registry_reachable(base_url: str) -> bool:\n    try:\n        return httpx.get(base_url, timeout=5).status_code < 500\n    except httpx.HTTPError:\n        return False","typeGuard":null,"tryCatchPattern":"import subprocess, time\n\nfor attempt in range(3):\n    proc = subprocess.run([\"crewai\", \"skill\", \"install\", ref], capture_output=True, text=True)\n    if proc.returncode == 0:\n        break\n    if \"401\" in proc.stderr or \"403\" in proc.stderr:  # auth: retrying won't help\n        subprocess.run([\"crewai\", \"org\", \"switch\", org_id], check=True)\n        continue\n    if attempt < 2:\n        time.sleep(2 ** attempt)  # backoff for 429/5xx\nelse:\n    raise RuntimeError(f\"skill install failed: {proc.stderr}\")","preventionTips":["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."],"tags":["cli","network","registry","http-error","skill"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}