{"record":{"id":"4aa93cbbe7408ce3","repo":"abiosoft/colima","slug":"error-recovering-storage-pool-w","errorCode":null,"errorMessage":"error recovering storage pool: %w","messagePattern":"error recovering storage pool: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/container/incus/incus.go","lineNumber":463,"sourceCode":"\n\tdisks = strings.Fields(str)\n\tif len(disks) == 0 {\n\t\treturn fmt.Errorf(\"no existing storage pool disks found\")\n\t}\n\n\tlog := c.Logger(ctx)\n\n\tlog.Println()\n\tlog.Println(\"Running 'incus admin recover' ...\")\n\tlog.Println()\n\tlog.Println(fmt.Sprintf(\"Found %d storage pool source(s):\", len(disks)))\n\tfor _, disk := range disks {\n\t\tlog.Println(\"  \" + poolDisksDir + \"/\" + disk)\n\t}\n\tlog.Println()\n\n\tif err := c.guest.RunInteractive(\"sudo\", \"incus\", \"admin\", \"recover\"); err != nil {\n\t\treturn fmt.Errorf(\"error recovering storage pool: %w\", err)\n\t}\n\n\tout, err := c.guest.RunOutput(\"sudo\", \"incus\", \"storage\", \"list\", \"name=\"+poolName, \"-c\", \"n\", \"--format\", \"compact,noheader\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif out != poolName {\n\t\treturn fmt.Errorf(\"default storage pool recovery failure\")\n\t}\n\n\treturn nil\n}\n\nfunc (c *incusRuntime) wipeDisk(size int) error {\n\t// prepare by deleting relevant files/directories\n\tdeleteScript := strings.NewReplacer(\n\t\t\"{disk_file}\", poolDiskFile,","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/container/incus/incus.go#L445-L481","documentation":"The interactive 'sudo incus admin recover' command inside the guest exited non-zero while colima was replaying answers to recover the existing zfs pool. The wrapped error carries incus's own message; typical causes are corrupted pool data or unexpected prompts the automation did not anticipate.","triggerScenarios":"guest.RunInteractive('sudo','incus','admin','recover') fails: zfs pool metadata corrupt, disk image truncated, incus recover asks an unexpected question and the answer stream ends, or the incus version changed prompt order.","commonSituations":"VM stopped abruptly during pool write (zfs intent log issues), resized/moved disk image, incus version upgrade between the backup and the recovery attempt.","solutions":["Let colima retry the recovery (answer 'yes' at the prompt) — transient zfs import failures often clear","Run recovery manually to see the real prompt/error: 'colima ssh -- sudo incus admin recover'","If the pool is unrecoverable, answer 'no' to discard the disk and create a fresh pool (restore data from backup afterwards)","Ensure incus in the guest matches the version that created the pool before retrying"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := c.recoverDisk(ctx); err != nil {\n    log.Warnln(err)\n    if cli.Prompt(\"recovery failed for default storage pool, try again\") {\n        continue // retry loop already built in\n    }\n    log.Warnln(\"discarding disk, creating new storage pool\")\n    return c.wipeDisk(conf.Disk)\n}","preventionTips":["Keep guest incus at the version that created the pool when recovering","Avoid hard-killing the VM during heavy pool writes","Test recovery restores on a copy of the disk image first"],"tags":["incus","zfs","storage","recovery","interactive"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}