{"record":{"id":"cd1ba546ea592d26","repo":"abiosoft/colima","slug":"cannot-copy-config-to-new-profile-s-w","errorCode":null,"errorMessage":"cannot copy config to new profile '%s': %w","messagePattern":"cannot copy config to new profile '(.+?)': %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clone.go","lineNumber":63,"sourceCode":"\t\t\t\tfilepath.Join(from.LimaInstanceDir(), \"diffdisk\"),\n\t\t\t\tfilepath.Join(from.LimaInstanceDir(), \"cidata.iso\"),\n\t\t\t\tfilepath.Join(from.LimaInstanceDir(), \"lima.yaml\"),\n\t\t\t\tto.LimaInstanceDir(),\n\t\t\t).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error copying VM: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\t{\n\t\t\tlogrus.Info(\"copying config...\")\n\t\t\t// verify source config exists\n\t\t\tif _, err := os.Stat(from.LimaInstanceDir()); err != nil {\n\t\t\t\treturn fmt.Errorf(\"config missing for colima profile '%s': %w\", from.ShortName, err)\n\t\t\t}\n\n\t\t\t// ensure destination config directory\n\t\t\tif err := cli.Command(\"mkdir\", \"-p\", filepath.Dir(to.LimaInstanceDir())).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot copy config to new profile '%s': %w\", to.ShortName, err)\n\t\t\t}\n\n\t\t\tif err := cli.Command(\"cp\", from.LimaInstanceDir(), to.LimaInstanceDir()).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error copying VM config: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\tlogrus.Info(\"clone successful\")\n\t\tlogrus.Infof(\"run `colima start %s` to start the newly cloned profile\", to.ShortName)\n\t\treturn nil\n\t},\n}\n\nfunc init() {\n\troot.Cmd().AddCommand(cloneCmd)\n\tcloneCmd.Hidden = true\n\n}","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/clone.go#L45-L81","documentation":"Returned by `colima clone` (cmd/clone.go:63) when `mkdir -p` on filepath.Dir(to.LimaInstanceDir()) — the destination's parent directory inside the colima lima home — fails while preparing to copy config. The %s is the destination profile short name, the %w the mkdir error.","triggerScenarios":"The colima lima home (or the immediate parent of the new instance dir) is not writable, a regular file occupies a path component, or the disk is full. Same failure class as the 'error preparing to copy VM' step but hit at the config stage.","commonSituations":"Ownership of the lima home changed (root-owned after sudo use); partial clone state left behind by a failed prior attempt; out-of-space home volume.","solutions":["Fix ownership/permissions of the lima home: `sudo chown -R $(id -un) ~/.colima/_lima`","Remove any regular file occupying the parent path and clean partial destination dirs from failed attempts","Confirm free disk space with `df -h ~` and retry the clone"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight the parent dir of the destination before clone\nif err := os.MkdirAll(filepath.Dir(to.LimaInstanceDir()), 0755); err != nil {\n    return fmt.Errorf(\"destination parent not preparable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep ~/.colima user-owned and writable (no sudo-created artifacts)","Clean partial destinations from failed clones before retrying","Check `df -h ~` before clone operations"],"tags":["clone","filesystem","permissions","colima"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}