{"record":{"id":"5b63ac346e1e1d36","repo":"vercel/turborepo","slug":"error-writing-run-summary-err","errorCode":null,"errorMessage":"Error writing run summary: {err}","messagePattern":"Error writing run summary: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/turborepo-run-summary/src/tracker.rs","lineNumber":430,"sourceCode":"        // cleanup even when metrics are not being emitted.\n        // Note: shutdown respects the configured timeout_ms (default 10s) to prevent\n        // hanging indefinitely on network issues.\n        if let Some(handle) = self.observability_handle.take() {\n            // Only record metrics for actual runs, not dry runs\n            if !matches!(self.run_type, RunType::DryJson | RunType::DryText) {\n                handle.record(&self);\n            }\n            handle.shutdown();\n        }\n\n        if matches!(self.run_type, RunType::DryJson | RunType::DryText) {\n            return self.close_dry_run(pkg_dep_graph, ui);\n        }\n\n        if self.should_save\n            && let Err(err) = self.save().await\n        {\n            turborepo_log::warn(\n                turborepo_log::Source::turbo(turborepo_log::Subsystem::Summary),\n                format!(\"Error writing run summary: {err}\"),\n            )\n            .emit()\n        }\n\n        if !is_watch && let Some(execution) = &self.execution {\n            let path = self.get_path();\n            let failed_tasks = self.get_failed_tasks();\n            execution.print(ui, path, failed_tasks, incremental_cache);\n        }\n\n        Ok(())\n    }\n\n    #[allow(dead_code)]\n    fn print_errors(errors: &[Error]) {\n        if errors.is_empty() {","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/vercel/turborepo/blob/7fe373bc270adb30db3c184c55069f77feb1a6d6/crates/turborepo-run-summary/src/tracker.rs#L412-L448","documentation":"After a (non-dry) run, the tracker persists the run summary to disk when should_save is set. If that save fails, turbo logs this warning with the underlying IO error and still prints the execution summary afterwards; the run's exit status is unaffected. It means the persisted run-tracking metadata under .turbo could not be written.","triggerScenarios":"`self.save()` fails while closing the tracker: the .turbo directory or its run metadata files are not writable (permissions, read-only mount), the disk is full, or the path is owned by a different user — common after running turbo once as root in a container.","commonSituations":"CI containers with read-only workspaces; Docker volumes with mismatched UIDs; a root-created .turbo later used by a non-root user; full disks in ephemeral runners.","solutions":["Fix ownership/permissions of the repo's .turbo directory (e.g. `sudo chown -R $(id -u):$(id -g) .turbo`)","Delete stale metadata and let turbo recreate it: `rm -rf .turbo`","Ensure the workspace is writable and the disk has space in CI","If running in Docker, execute turbo as the same UID that owns the checkout"],"exampleFix":"# before: .turbo owned by root after a docker run\nsudo turbo run build\n\n# after: run as the repo owner\nturbo run build   # fix ownership first: sudo chown -R $USER .turbo","handlingStrategy":"validation","validationCode":"# Ensure turbo can persist run summaries before running\nmkdir -p .turbo && touch .turbo/.write-test && rm .turbo/.write-test \\\n  || { echo '.turbo is not writable'; exit 1; }\nturbo run build","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never mix UIDs: in Docker, run turbo as the user that owns the checkout","Wipe .turbo in ephemeral CI workspaces to avoid stale root-owned metadata","Monitor disk space — full disks turn summary writes into warnings","Remember the warning is non-fatal: run results and the exit code are unaffected"],"tags":["run-summary","filesystem","io","turborepo"],"backgroundTag":"file-write-permission-denied","analyzedSha":"7fe373bc270adb30db3c184c55069f77feb1a6d6","analyzedAt":"2026-08-17T10:46:15.696Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}