{"record":{"id":"4f4b9d74db946c78","repo":"nikivdev/code","slug":"scp-failed","errorCode":null,"errorMessage":"scp failed","messagePattern":"scp failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/deploy.rs","lineNumber":1922,"sourceCode":"    }\n    Ok(())\n}\n\n/// Copy file via scp.\nfn scp_file(local: &Path, conn: &HostConnection, remote: &str) -> Result<()> {\n    let dest = format!(\"{}:{}\", conn.ssh_target(), remote);\n    let status = Command::new(\"scp\")\n        .args([\n            \"-P\",\n            &conn.port.to_string(),\n            &local.display().to_string(),\n            &dest,\n        ])\n        .status()\n        .context(\"Failed to run scp\")?;\n\n    if !status.success() {\n        bail!(\"scp failed\");\n    }\n    Ok(())\n}\n\n/// Install the env-fetch script on the host.\n/// This script fetches env vars from cloud using a service token on startup.\nfn install_env_fetch_script(\n    conn: &HostConnection,\n    dest: &str,\n    service_token: &str,\n    api_base: &str,\n    project_name: &str,\n    environment: &str,\n    keys: &[String],\n) -> Result<()> {\n    // Build the keys query parameter\n    let keys_param = if keys.is_empty() {\n        String::new()","sourceCodeStart":1904,"sourceCodeEnd":1940,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/deploy.rs#L1904-L1940","documentation":"Error \"scp failed\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/deploy.rs:1922 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":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}