{"record":{"id":"10c466621827ccc3","repo":"abiosoft/colima","slug":"error-reading-embedded-flannel-config-w","errorCode":null,"errorMessage":"error reading embedded flannel config: %w","messagePattern":"error reading embedded flannel config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/container/kubernetes/cni.go","lineNumber":24,"sourceCode":"\t\"path/filepath\"\n\n\t\"github.com/abiosoft/colima/cli\"\n\t\"github.com/abiosoft/colima/embedded\"\n\t\"github.com/abiosoft/colima/environment\"\n)\n\nfunc installCniConfig(guest environment.GuestActions, a *cli.ActiveCommandChain) {\n\t// fix cni config\n\ta.Add(func() error {\n\t\tflannelFile := \"/etc/cni/net.d/10-flannel.conflist\"\n\t\tcniConfDir := filepath.Dir(flannelFile)\n\t\tif err := guest.Run(\"sudo\", \"mkdir\", \"-p\", cniConfDir); err != nil {\n\t\t\treturn fmt.Errorf(\"error creating cni config dir: %w\", err)\n\t\t}\n\n\t\tflannel, err := embedded.Read(\"k3s/flannel.json\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading embedded flannel config: %w\", err)\n\t\t}\n\t\treturn guest.Write(flannelFile, flannel)\n\t})\n}\n","sourceCodeStart":6,"sourceCodeEnd":29,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/container/kubernetes/cni.go#L6-L29","documentation":"Colima reads the flannel CNI config embedded at build time via go:embed (embedded.Read('k3s/flannel.json')) and the read failed. Since embedded assets are compiled into the binary, failure indicates a broken build or packaging where the asset was absent — effectively a developer/packaging bug, not a runtime condition.","triggerScenarios":"embedded.Read cannot locate/decrypt 'k3s/flannel.json': asset missing from the embed FS at build time, binary built from a partial checkout, or an embedded-filesystem path typo in a fork/patch.","commonSituations":"Building colima from a dirty or shallow checkout, third-party forks that moved embedded files, distribution packages that strip embedded resources.","solutions":["Use an official colima release binary","For source builds, verify embedded/k3s/flannel.json exists, then 'go clean -cache && go build'","Run 'colima version' and file an issue including the build source — this should never fail in a correct build"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// startup self-check for embedded assets (release builds should pass)\nif _, err := embedded.Read(\"k3s/flannel.json\"); err != nil {\n    return fmt.Errorf(\"colima build is missing embedded assets; reinstall: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"flannel, err := embedded.Read(\"k3s/flannel.json\")\nif err != nil {\n    return fmt.Errorf(\"error reading embedded flannel config: %w\", err)\n    // not retryable at runtime — the binary must be rebuilt/reinstalled with assets present\n}","preventionTips":["Ship colima as an official binary or clean 'go build' from a full checkout","Add a test asserting embedded.Read succeeds for every referenced asset","Do not strip embedded files when packaging (no UPX --strip or file pruning)"],"tags":["kubernetes","embedded","build","flannel"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}