{"record":{"id":"b30fa516aaead606","repo":"lima-vm/lima","slug":"failed-to-sync-back-the-changes-from-guest-instanc-b30fa5","errorCode":null,"errorMessage":"failed to sync back the changes from guest instance to host temporary directory: %w","messagePattern":"failed to sync back the changes from guest instance to host temporary directory: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/shell.go","lineNumber":638,"sourceCode":"\t\t\treturn rsyncBack()\n\t\tcase 1: // No\n\t\t\tcleanupGuestWorkdir = true\n\t\t\tlogrus.Info(\"Skipping syncing back the changes to host.\")\n\t\t\treturn nil\n\t\tcase 2: // View the changed contents\n\t\t\tvar diffCmd *exec.Cmd\n\t\t\tif _, err := exec.LookPath(\"diff\"); err != nil {\n\t\t\t\tlogrus.WithError(err).Warn(\"`diff` not found; showing rsync dry-run output only\")\n\t\t\t} else {\n\t\t\t\tdiffCmd = exec.CommandContext(ctx, \"diff\", \"-ruN\", \"--color=always\", hostCurrentDir, hostTmpDest)\n\t\t\t\tif !rsyncToTempDir {\n\t\t\t\t\tpaths := []string{\n\t\t\t\t\t\tremoteSource,\n\t\t\t\t\t\thostTmpDest,\n\t\t\t\t\t}\n\n\t\t\t\t\tif err := rsyncDirectory(ctx, cmd, rsync, paths); err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"failed to sync back the changes from guest instance to host temporary directory: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t\trsyncToTempDir = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpagerArgs := pagerCommand()\n\t\t\tlessCmd := exec.CommandContext(ctx, pagerArgs[0], pagerArgs[1:]...)\n\n\t\t\tpipeIn, err := lessCmd.StdinPipe()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to create pipe for less: %w\", err)\n\t\t\t}\n\t\t\tif diffCmd != nil {\n\t\t\t\tdiffCmd.Stdout = pipeIn\n\t\t\t}\n\t\t\tlessCmd.Stdout = cmd.OutOrStdout()\n\t\t\tlessCmd.Stderr = cmd.OutOrStderr()\n","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/shell.go#L620-L656","documentation":"When the user chooses \"View the changed contents\", limactl first rsyncs the guest workdir into the temporary staging directory so `diff` can compare it against the host directory. This error wraps a failure of that guest->temp-dir rsync. The guest synced workdir is preserved because cleanup only happens after a successful sync-back decision.","triggerScenarios":"Selecting \"View the changed contents\" in the post-shell prompt, and rsyncDirectory from `instance:destRsyncDir` to hostTmpDest fails: SSH connection dropped after a long shell session, large change set exceeding disk space in temp, or rsync/ssh binary problems.","commonSituations":"Long-running shell sessions whose SSH control master expired; guest VM stopped while the prompt was pending; temp filesystem too small for a big workdir; rsync interrupted by Ctrl-C during transfer.","solutions":["Choose \"Yes\" at the prompt to sync back directly (or rerun and accept), bypassing the diff staging step.","Verify the instance is still RUNNING (`limactl list`) — if it was stopped, restart it and manually copy files from destRsyncDir.","Free space on the temp filesystem and retry.","Inspect the wrapped rsync stderr printed by rsyncDirectory for the root cause.","Fall back to manual recovery: `limactl shell <instance> rsync -av <destRsyncDir>/ .` from within the guest or scp from `instance:destRsyncDir`."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"limactl list | grep -q 'RUNNING' && df --output=avail \"${TMPDIR:-/tmp}\" | tail -1 || echo 'instance stopped or temp fs full: preview unavailable'","typeGuard":null,"tryCatchPattern":"// on preview failure, fall back to direct sync-back decision\nlimactl shell default || limactl shell default < /dev/null   # non-tty run syncs back unconditionally","preventionTips":["Keep the instance running until the rsync-back prompt is answered.","Ensure ample temp space for a second copy of large changed workdirs.","Avoid leaving shell sessions idle long enough for SSH control masters to expire.","Use Yes/No directly when the change set is large and preview isn't essential."],"tags":["rsync","ssh","diff","file-sync"],"backgroundTag":"rsync-transfer-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}