vercel/turborepo · warning

skipping automatic task caching - detected network access

Error message

skipping automatic task caching - detected network access

What it means

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.

Source

Thrown at crates/turborepo-lib/src/run/task_access.rs:99

        let trace_file = trace_file_path(repo_root, task_hash);

        let Ok(f) = trace_file.open() else {
            return None;
        };

        match serde_json::from_reader(f) {
            Ok(trace) => Some(trace),
            Err(e) => {
                warn!("failed to parse trace file {trace_file}: {e}");
                None
            }
        }
    }

    pub fn can_cache(&self, repo_root: &AbsoluteSystemPathBuf) -> bool {
        // network
        if self.accessed.network {
            turborepo_log::warn(
                turborepo_log::Source::turbo(turborepo_log::Subsystem::TaskAccess),
                "skipping automatic task caching - detected network access",
            )
            .emit();
            return false;
        }

        // file system
        for unescaped_str in &self.accessed.file_paths {
            match AbsoluteSystemPathBuf::new(unescaped_str.to_string()) {
                Ok(path) => {
                    let relation = path.relation_to_path(repo_root);
                    // only paths within the repo can be automatically cached
                    if relation == PathRelation::Parent || relation == PathRelation::Divergent {
                        turborepo_log::warn(
                            turborepo_log::Source::turbo(turborepo_log::Subsystem::TaskAccess),
                            format!(
                                "skipping automatic task caching - file accessed outside of repo \

View on GitHub (pinned to f9245100cf)

Solutions

  1. Move network-dependent work out of the cached task (pre-fetch artifacts in an earlier, non-cached task and consume files).
  2. Give the task explicit `inputs`/`outputs` in turbo.json so it opts into deterministic caching instead of relying on automatic inference.
  3. Make the task hermetic (vendor dependencies, pin downloads to a cached input) and re-run so the trace shows no network.
  4. If network use is inherently required, mark the task cache: false to make the intent explicit and silence the mismatch.

Example fix

// turbo.json — before: task relies on automatic caching but downloads at build time
"tasks": { "build": {} }   // -> skipping automatic task caching - detected network access

// after: fetch in a separate non-cached task, build stays hermetic
"tasks": {
  "fetch-assets": { "cache": false, "outputs": ["assets/**"] },
  "build": { "dependsOn": ["^fetch-assets"], "inputs": ["$TURBO_DEFAULT$", "assets/**"], "outputs": ["dist/**"] }
}
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
# fail the pipeline when an automatically cached task touched the network
# (inspect the emitted warnings after a probe run)
turbo run build 2>&1 | tee /tmp/turbo.log
grep -q "skipping automatic task caching - detected network access" /tmp/turbo.log \
  && { echo "non-hermetic task detected — declare inputs/outputs or prefetch" >&2; exit 1; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17). Data as JSON: /api/errors/16ee82af96fa68d3. Report an issue: GitHub.