{"record":{"id":"fb7392ee9b20c38d","repo":"abiosoft/colima","slug":"error-reading-embedded-file-w","errorCode":null,"errorMessage":"error reading embedded file: %w","messagePattern":"error reading embedded file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/template.go","lineNumber":33,"sourceCode":"\n// templateCmd represents the template command\nvar templateCmd = &cobra.Command{\n\tUse:     \"template\",\n\tAliases: []string{\"tmpl\", \"tpl\", \"t\"},\n\tShort:   \"edit the template for default configurations\",\n\tLong: `Edit the template for default configurations of new instances.\n`,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif templateCmdArgs.Print {\n\t\t\tfmt.Println(templateFile())\n\t\t\treturn nil\n\t\t}\n\t\t// there are unwarranted []byte to string overheads.\n\t\t// not a big deal in this case\n\n\t\tabort, err := embedded.ReadString(\"defaults/abort.yaml\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading embedded file: %w\", err)\n\t\t}\n\t\tinfo, err := embedded.ReadString(\"defaults/template.yaml\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading embedded file: %w\", err)\n\t\t}\n\t\ttemplate, err := templateFileOrDefault()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading template file: %w\", err)\n\t\t}\n\n\t\ttmpFile, err := waitForUserEdit(templateCmdArgs.Editor, []byte(abort+\"\\n\"+info+\"\\n\"+template))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error editing template file: %w\", err)\n\t\t}\n\t\tif tmpFile == \"\" {\n\t\t\treturn fmt.Errorf(\"empty file, template edit aborted\")\n\t\t}\n\t\tdefer func() {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/template.go#L15-L51","documentation":"Fatal error in `colima template`'s RunE when embedded.ReadString('defaults/abort.yaml') cannot read the abort header from the go:embed filesystem baked into the binary. Unlike the start --edit path (which only warns), the template command aborts. The embedded FS cannot fail at runtime for official binaries, so this indicates a broken or nonstandard build.","triggerScenarios":"Running `colima template` with a binary compiled from a tree where embedded/defaults/abort.yaml was removed/renamed without updating //go:embed; a corrupted binary. Not reproducible via user config.","commonSituations":"Local developer builds after moving embedded assets; third-party repackaged colima binaries.","solutions":["Reinstall colima from an official channel (brew, Nix, release binaries) to rule out a bad build","If building from source, ensure embedded/defaults/abort.yaml exists relative to the //go:embed directive in embedded/embed.go, then rebuild"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use official binaries; embedded assets only break in custom builds","Verify custom builds by running `colima template --print`-adjacent smoke tests before distributing"],"tags":["embedded-assets","build","template"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}