{"record":{"id":"59da58f3b2d82572","repo":"astral-sh/uv","slug":"uv-sync-frozen-requires-a-script-lockfile-run","errorCode":null,"errorMessage":"`uv sync --frozen` requires a script lockfile; run `{}` to lock the script","messagePattern":"`uv sync --frozen` requires a script lockfile; run `(.+?)` to lock the script","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/project/sync.rs","lineNumber":230,"sourceCode":"        dry_run: dry_run.enabled(),\n        environment: EnvironmentReport::from(&environment),\n        action: SyncAction::from(&environment),\n        target: TargetName::from(&target),\n        changes: PackageChangesReport::default(),\n    };\n\n    // Show the intermediate results if relevant\n    if let Some(message) = sync_report.format(output_format) {\n        writeln!(printer.stderr(), \"{message}\")?;\n    }\n\n    // Special-case: we're syncing a script that doesn't have an associated lockfile. In that case,\n    // we don't create a lockfile, so the resolve-and-install semantics are different.\n    if let SyncTarget::Script(script) = &target {\n        let lockfile = LockTarget::from(script).lock_path();\n        if !lockfile.is_file() {\n            if frozen.is_some() {\n                return Err(anyhow::anyhow!(\n                    \"`uv sync --frozen` requires a script lockfile; run `{}` to lock the script\",\n                    format!(\"uv lock --script {}\", script.path.user_display()).green(),\n                ));\n            }\n\n            if let LockCheck::Enabled(lock_check) = lock_check {\n                return Err(anyhow::anyhow!(\n                    \"`uv sync {lock_check}` requires a script lockfile; run `{}` to lock the script\",\n                    format!(\"uv lock --script {}\", script.path.user_display()).green(),\n                ));\n            }\n\n            // Parse the requirements from the script.\n            let spec = script_specification(\n                script.into(),\n                &settings.resolver,\n                cache,\n                workspace_cache,","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/project/sync.rs#L212-L248","documentation":"Error \"`uv sync --frozen` requires a script lockfile; run `{}` to lock the script\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/project/sync.rs:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}