{"record":{"id":"711b23059b4876a2","repo":"affaan-m/ECC","slug":"fal-upload-failed-provider-details-omitted-711b23","errorCode":null,"errorMessage":"fal upload failed; provider details omitted","messagePattern":"fal upload failed; provider details omitted","errorType":"exception","errorClass":"FalError","httpStatus":null,"severity":"error","filePath":"skills/taste-distillation/scripts/taste/falapi.py","lineNumber":317,"sourceCode":"    if not p.exists():\n        raise FalError(f\"cannot upload, file does not exist: {p}\")\n\n    key = _cache_key(p)\n    with _UPLOAD_LOCK:\n        hit = _UPLOAD_CACHE.get(key)\n    if hit and (is_dry_run() == hit.startswith(DRY_RUN_HOST + \"/\")):\n        log.debug(\"upload cache hit: %s\", p.name)\n        return hit\n\n    if is_dry_run():\n        url = f\"{DRY_RUN_HOST}/uploads/{_digest(str(key))}/{p.name}\"\n        log.info(\"[dry-run] would upload %s (%d bytes) -> %s\", p, key[2], url)\n    else:\n        api_key()\n        try:\n            url = _fal().upload_file(str(p))\n        except Exception:\n            raise FalError(\"fal upload failed; provider details omitted\") from None\n        log.info(\"uploaded %s -> %s\", p.name, safe_url(url))\n\n    with _UPLOAD_LOCK:\n        _UPLOAD_CACHE[key] = url\n    return url\n\n\ndef upload_many(paths: Iterable[str | Path]) -> list[str]:\n    return [upload(p) for p in paths]\n\n\ndef clear_upload_cache() -> None:\n    with _UPLOAD_LOCK:\n        _UPLOAD_CACHE.clear()\n\n\n# ---------------------------------------------------------------------------\n# response parsing","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-distillation/scripts/taste/falapi.py#L299-L335","documentation":"FalError raised by upload() when _fal().upload_file() throws. Provider details are deliberately omitted (`from None`) because fal exceptions can embed signed URLs and keys. The upload cache is not populated on failure, so a later retry re-attempts the POST.","triggerScenarios":"upload() in live mode: api_key() succeeds, then `_fal().upload_file(str(p))` raises — network failure, provider 4xx/5xx, oversized file, or expired credentials.","commonSituations":"Unstable network during multi-megabyte image upload; fal.ai incident/outage; uploading a very large asset that the provider rejects; invalid FAL_KEY.","solutions":["Retry the upload — failure details are hidden, so first check general connectivity and fal.ai status","Validate FAL_KEY is still valid (an auth rejection surfaces as this generic error)","Try a smaller/compressed file if the asset is very large","Re-run with dry-run disabled but network logging enabled outside the library to capture the underlying cause"],"exampleFix":"// before\nurl = falapi.upload(path)  # FalError: fal upload failed; provider details omitted\n// after\nimport time\nfor attempt in range(3):\n    try:\n        url = falapi.upload(path)\n        break\n    except falapi.FalError:\n        time.sleep(2 ** attempt)\nelse:\n    raise RuntimeError(f\"upload failed after retries: {path}\")","handlingStrategy":"retry","validationCode":"from pathlib import Path\np = Path(path)\nif not p.is_file() or p.stat().st_size == 0:\n    raise FileNotFoundError(f\"bad upload source: {p}\")","typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(3):\n    try:\n        url = falapi.upload(path)\n        break\n    except falapi.FalError:\n        if attempt == 2:\n            raise\n        time.sleep(2 ** attempt)","preventionTips":["Retry uploads with exponential backoff — failures are often transient","Compress large images before uploading to reduce failure odds","Verify FAL_KEY validity; auth failures appear here without details","Check fal.ai status page when uploads fail in bursts"],"tags":["python","network","upload","api"],"backgroundTag":"api-request-failed","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}