{"record":{"id":"7abafc0d8d9e4fff","repo":"abiosoft/colima","slug":"colima-profile-s-does-not-exist","errorCode":null,"errorMessage":"colima profile '%s' does not exist","messagePattern":"colima profile '(.+?)' does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clone.go","lineNumber":29,"sourceCode":"\t\"github.com/sirupsen/logrus\"\n\t\"github.com/spf13/cobra\"\n)\n\n// stopCmd represents the stop command\nvar cloneCmd = &cobra.Command{\n\tUse:   \"clone <profile> <new-profile>\",\n\tShort: \"clone Colima profile\",\n\tLong:  `Clone the Colima profile.`,\n\tArgs:  cobra.ExactArgs(2),\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tfrom := config.ProfileFromName(args[0])\n\t\tto := config.ProfileFromName(args[1])\n\n\t\tlogrus.Infof(\"preparing to clone %s...\", from.DisplayName)\n\t\t{\n\t\t\t// verify source profile exists\n\t\t\tif stat, err := os.Stat(from.LimaInstanceDir()); err != nil || !stat.IsDir() {\n\t\t\t\treturn fmt.Errorf(\"colima profile '%s' does not exist\", from.ShortName)\n\t\t\t}\n\n\t\t\t// verify destination profile does not exists\n\t\t\tif stat, err := os.Stat(to.LimaInstanceDir()); err == nil && stat.IsDir() {\n\t\t\t\treturn fmt.Errorf(\"colima profile '%s' already exists, delete with `colima delete %s` and try again\", to.ShortName, to.ShortName)\n\t\t\t}\n\n\t\t\t// copy source to destination\n\t\t\tlogrus.Info(\"cloning virtual machine...\")\n\t\t\tif err := cli.Command(\"mkdir\", \"-p\", to.LimaInstanceDir()).Run(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error preparing to copy VM: %w\", err)\n\t\t\t}\n\n\t\t\tif err := cli.Command(\"cp\",\n\t\t\t\tfilepath.Join(from.LimaInstanceDir(), \"basedisk\"),\n\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\"),","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/clone.go#L11-L47","documentation":"Returned by the hidden `colima clone <profile> <new-profile>` command (cmd/clone.go:29) when os.Stat on the source profile's Lima instance directory (config.Profile.LimaInstanceDir(), config/profile.go:68 — <lima-home>/<profile-id>) fails or the path is not a directory. The clone cannot proceed because there is no VM to copy from.","triggerScenarios":"Running `colima clone foo bar` when profile 'foo' has never been created, was deleted, has a misspelled name, or its Lima instance directory was removed manually.","commonSituations":"Typo in the source profile name; cloning after `colima delete`; profile exists in ~/.colima but its Lima instance dir under the lima home (~/.colima/_lima by default) was wiped.","solutions":["List existing profiles with `colima list` (or `colima list -a`) and use the exact profile name","If the profile does not exist yet, create it first: `colima start -p <profile>`","If it should exist, verify the Lima instance dir is present (colima list output paths) and re-create the profile if its files are gone"],"exampleFix":"# before\ncolima clone tpyo newprofile   # colima profile 'tpyo' does not exist\n\n# after\ncolima list                    # confirm the real name, e.g. 'typo'\ncolima clone typo newprofile","handlingStrategy":"validation","validationCode":"// Verify the source profile exists before cloning\nfrom := config.ProfileFromName(srcName)\nif stat, err := os.Stat(from.LimaInstanceDir()); err != nil || !stat.IsDir() {\n    return fmt.Errorf(\"source profile '%s' missing; create it first with `colima start -p %s`\", srcName, srcName)\n}","typeGuard":null,"tryCatchPattern":"if err := runClone(src, dst); err != nil {\n    if strings.Contains(err.Error(), \"does not exist\") {\n        // bad source name: list profiles (colima list) and correct the argument\n    }\n    return err\n}","preventionTips":["Always cross-check profile names against `colima list` before clone/delete commands","Remember profiles are created by `colima start -p <name>`, not by clone alone","Quote profile names in scripts to avoid shell mangling"],"tags":["clone","profile","validation","colima"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}