{"record":{"id":"16ee82af96fa68d3","repo":"vercel/turborepo","slug":"skipping-automatic-task-caching-detected-network","errorCode":null,"errorMessage":"skipping automatic task caching - detected network access","messagePattern":"skipping automatic task caching - detected network access","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/turborepo-lib/src/run/task_access.rs","lineNumber":99,"sourceCode":"        let trace_file = trace_file_path(repo_root, task_hash);\n\n        let Ok(f) = trace_file.open() else {\n            return None;\n        };\n\n        match serde_json::from_reader(f) {\n            Ok(trace) => Some(trace),\n            Err(e) => {\n                warn!(\"failed to parse trace file {trace_file}: {e}\");\n                None\n            }\n        }\n    }\n\n    pub fn can_cache(&self, repo_root: &AbsoluteSystemPathBuf) -> bool {\n        // network\n        if self.accessed.network {\n            turborepo_log::warn(\n                turborepo_log::Source::turbo(turborepo_log::Subsystem::TaskAccess),\n                \"skipping automatic task caching - detected network access\",\n            )\n            .emit();\n            return false;\n        }\n\n        // file system\n        for unescaped_str in &self.accessed.file_paths {\n            match AbsoluteSystemPathBuf::new(unescaped_str.to_string()) {\n                Ok(path) => {\n                    let relation = path.relation_to_path(repo_root);\n                    // only paths within the repo can be automatically cached\n                    if relation == PathRelation::Parent || relation == PathRelation::Divergent {\n                        turborepo_log::warn(\n                            turborepo_log::Source::turbo(turborepo_log::Subsystem::TaskAccess),\n                            format!(\n                                \"skipping automatic task caching - file accessed outside of repo \\","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/vercel/turborepo/blob/f9245100cf0d31d96628804ead485f6bf226e55a/crates/turborepo-lib/src/run/task_access.rs#L81-L117","documentation":"When a task relies on automatic caching (no explicit inputs; turbo traces file/network access), TaskAccess::can_cache (crates/turborepo-lib/src/run/task_access.rs:89-99) refuses to cache a task whose trace recorded network activity, because a network-dependent task is not safely replayable from cache. The warning explains the automatic cache decision; the task still runs, just uncached.","triggerScenarios":"The task's access trace (produced by the tracing-based inference) has accessed.network == true — the task opened sockets or otherwise touched the network during a prior instrumented run. can_cache() emits this warning and returns false, so no cache entry is stored or restored.","commonSituations":"Build tasks that fetch dependencies at runtime (no lockfile-first install), telemetry/phone-home scripts, dev-time version checks, and download steps inside build scripts. Teams enabling automatic task caching see these tasks never hit cache.","solutions":["Move network-dependent work out of the cached task (pre-fetch artifacts in an earlier, non-cached task and consume files).","Give the task explicit `inputs`/`outputs` in turbo.json so it opts into deterministic caching instead of relying on automatic inference.","Make the task hermetic (vendor dependencies, pin downloads to a cached input) and re-run so the trace shows no network.","If network use is inherently required, mark the task cache: false to make the intent explicit and silence the mismatch."],"exampleFix":"// turbo.json — before: task relies on automatic caching but downloads at build time\n\"tasks\": { \"build\": {} }   // -> skipping automatic task caching - detected network access\n\n// after: fetch in a separate non-cached task, build stays hermetic\n\"tasks\": {\n  \"fetch-assets\": { \"cache\": false, \"outputs\": [\"assets/**\"] },\n  \"build\": { \"dependsOn\": [\"^fetch-assets\"], \"inputs\": [\"$TURBO_DEFAULT$\", \"assets/**\"], \"outputs\": [\"dist/**\"] }\n}","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# fail the pipeline when an automatically cached task touched the network\n# (inspect the emitted warnings after a probe run)\nturbo run build 2>&1 | tee /tmp/turbo.log\ngrep -q \"skipping automatic task caching - detected network access\" /tmp/turbo.log \\\n  && { echo \"non-hermetic task detected — declare inputs/outputs or prefetch\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare explicit inputs/outputs for tasks that must be cached instead of relying on tracing.","Prefetch all remote assets in a cache: false task and consume them as files.","Ban runtime network access in build scripts (hermetic toolchains) so traces stay clean."],"tags":["turborepo","caching","task-tracing","network","hermeticity"],"backgroundTag":"task-not-cacheable","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}