{"record":{"id":"ee0577831422b514","repo":"abiosoft/colima","slug":"instance-s-does-not-exist","errorCode":null,"errorMessage":"instance '%s' does not exist","messagePattern":"instance '(.+?)' does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/vm/lima/limautil/instance.go","lineNumber":61,"sourceCode":"\n// Lima statuses\nconst (\n\tlimaStatusRunning = \"Running\"\n)\n\nfunc getInstance(profileID string) (InstanceInfo, error) {\n\tvar i InstanceInfo\n\tvar buf bytes.Buffer\n\tcmd := Limactl(\"list\", profileID, \"--json\")\n\tcmd.Stderr = nil\n\tcmd.Stdout = &buf\n\n\tif err := cmd.Run(); err != nil {\n\t\treturn i, fmt.Errorf(\"error retrieving instance: %w\", err)\n\t}\n\n\tif buf.Len() == 0 {\n\t\treturn i, fmt.Errorf(\"instance '%s' does not exist\", config.ProfileFromName(profileID).DisplayName)\n\t}\n\n\tif err := json.Unmarshal(buf.Bytes(), &i); err != nil {\n\t\treturn i, fmt.Errorf(\"error retrieving instance: %w\", err)\n\t}\n\n\tif conf, err := i.Config(); err == nil {\n\t\tif conf.Disk > 0 {\n\t\t\ti.Disk = config.Disk(conf.Disk).Int()\n\t\t}\n\t}\n\treturn i, nil\n}\n\n// Instances returns Lima instances created by colima.\nfunc Instances(ids ...string) ([]InstanceInfo, error) {\n\tlimaIDs := make([]string, len(ids))\n\tfor i := range ids {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/limautil/instance.go#L43-L79","documentation":"Error returned by getInstance when 'limactl list <profileID> --json' succeeds but prints nothing (buf.Len() == 0), which Lima signals for a non-existent instance. The message renders the human-facing profile display name.","triggerScenarios":"Querying a profile that was never created, was removed via 'colima delete', or whose Lima instance directory under ~/.lima was manually deleted.","commonSituations":"Running docker/ssh commands after 'colima delete'; wrong COLIMA_DEFAULT_PROFILE or a typo'd 'colima start -p name' where the profile exists in colima metadata but not in Lima; fresh machine where start never completed.","solutions":["Create the VM first: 'colima start -p <profile>'","Check what exists: 'colima list' and 'limactl list'","Fix the profile name / COLIMA_DEFAULT_PROFILE environment variable","If metadata and Lima disagree, 'colima delete -p <profile>' then start fresh"],"exampleFix":"# before: 'instance colima does not exist'\ncolima ssh -p work\n# after\ncolima start -p work && colima ssh -p work","handlingStrategy":"validation","validationCode":"// existence check before touching an instance\nfunc instanceExists(profileID string) bool {\n    _, err := limautil.Instance() // or limactl list <id> --json | grep .\n    return err == nil && !strings.Contains(err.Error(), \"does not exist\")\n}","typeGuard":null,"tryCatchPattern":"In Go: if _, err := limautil.GetInstance(...); err != nil { if strings.Contains(err.Error(), \"does not exist\") { /* create then retry */ } else { return err } }.","preventionTips":["Script order matters: 'colima start' before any ssh/docker usage","Double-check -p flags and COLIMA_DEFAULT_PROFILE in automation"],"tags":["instance","profile","not-found","lifecycle"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}