{"record":{"id":"cccbc0bca6d5a904","repo":"jax-ml/jax","slug":"error-writing-persistent-compilation-cache-entry-f","errorCode":null,"errorMessage":"Error writing persistent compilation cache entry for '{module_name}': {type(ex).__name__}: {ex}","messagePattern":"Error writing persistent compilation cache entry for '(.+?)': (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"jax/_src/compiler.py","lineNumber":863,"sourceCode":"  if compile_time_secs < min_compile_time:\n    logger.log(\n        log_priority,\n        \"Not writing persistent cache entry for '%s' because it took < %.2f \"\n        \"seconds to compile (%.2fs)\", module_name, min_compile_time,\n        compile_time_secs)\n    return\n  else:\n    logger.debug(\n        \"'%s' took at least %.2f seconds to compile (%.2fs)\",\n        module_name, min_compile_time, compile_time_secs)\n\n  try:\n    compilation_cache.put_executable_and_time(\n        cache_key, module_name, executable, backend, int(compile_time_secs))\n  except Exception as ex:\n    if _should_raise_persistent_cache_error(ex):\n      raise\n    warnings.warn(\n        f\"Error writing persistent compilation cache entry for \"\n        f\"'{module_name}': {type(ex).__name__}: {ex}\")\n","sourceCodeStart":845,"sourceCodeEnd":866,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/compiler.py#L845-L866","documentation":"After successfully compiling a function, JAX failed to write the executable into the persistent compilation cache (put_executable_and_time raised). The computation still runs; only cache persistence is lost, so future runs will recompile.","triggerScenarios":"jit compilation completes but the cache write fails: disk full, read-only directory, missing cloud-storage write permissions, or serialization errors when storing the executable.","commonSituations":"Cache dir on a full ephemeral disk in containers; missing WRITE scope on a GCS service account; NFS mount mounted read-only; cache quota exceeded.","solutions":["Check free space and write permissions on the cache directory/bucket.","Grant the writer identity write access to the cache location.","Point the cache at a writable local path (e.g. JAX_COMPILATION_CACHE_DIR=/tmp/jax-cache) if remote writes are unreliable.","Set jax_raise_persistent_cache_errors=True to get the full traceback for diagnosis."],"exampleFix":"# before\nJAX_COMPILATION_CACHE_DIR=/read-only-mount/cache  # write fails\n# after\nJAX_COMPILATION_CACHE_DIR=/scratch/jax-cache\nchmod -R u+w /scratch/jax-cache","handlingStrategy":"validation","validationCode":"import os, tempfile\ndef cache_writable(d):\n    try:\n        os.makedirs(d, exist_ok=True)\n        t = os.path.join(d, '.probe')\n        open(t, 'w').close(); os.remove(t)\n        return True\n    except OSError:\n        return False\nassert cache_writable(os.environ['JAX_COMPILATION_CACHE_DIR'])","typeGuard":null,"tryCatchPattern":"with warnings.catch_warnings(record=True) as caught:\n    warnings.simplefilter('always')\n    jitted_fn(x)\nwrite_failures = [c for c in caught if 'writing persistent compilation cache' in str(c.message)]","preventionTips":["Provision cache on local NVMe/scratch with adequate space.","Verify write permissions on remote buckets before job submission.","Alert on this warning: it means every run pays full compile cost."],"tags":["jax","compilation-cache","io","permissions"],"backgroundTag":"cache-write-failure","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}