{"record":{"id":"4e61d7f7755baca5","repo":"GoogleContainerTools/skaffold","slug":"image-is-missing-buildpacks-metadata-perhaps-buil","errorCode":null,"errorMessage":"image is missing buildpacks metadata; perhaps built with older lifecycle?","messagePattern":"image is missing buildpacks metadata; perhaps built with older lifecycle\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/debug/cnb.go","lineNumber":116,"sourceCode":"//     process is launched.\n//     2. If the first argument is `--` then the remaining arguments are treated as a _direct exec_.\n//     3. Otherwise the first argument is treated as a shell script launch with the first\n//     argument as the script and remaining arguments are positional arguments to the script.\n//     2. If there are no arguments, a process type is taken from the `CNB_PROCESS_TYPE`\n//     environment variable, defaulting to `web`.\n//   - In Platform API 0.4 (pack 0.13 / lifecycle 0.9) the process types are turned into executables\n//     found in `/cnb/process/`, and the image entrypoint is set to the corresponding executable for\n//     the default process type.  `CNB_PROCESS_TYPE` is ignored in this situation.  A different process\n//     can be used by overriding the image entrypoint.  Direct and script launches are supported by\n//     setting the entrypoint to `/cnb/lifecycle/launcher` and providing the appropriate arguments.\nfunc updateForCNBImage(adapter types.ContainerAdapter, ic ImageConfiguration, transformer func(adapter types.ContainerAdapter, ic ImageConfiguration) (types.ContainerDebugConfiguration, string, error)) (types.ContainerDebugConfiguration, string, error) {\n\t// buildpacks/lifecycle 0.6.0 embeds the process definitions into a special image label.\n\t// The build metadata isn't absolutely required as the image args could be\n\t// a command line (e.g., `python xxx`) but it likely indicates the\n\t// image was built with an older lifecycle.\n\tmetadataJSON, found := ic.Labels[\"io.buildpacks.build.metadata\"]\n\tif !found {\n\t\treturn types.ContainerDebugConfiguration{}, \"\", fmt.Errorf(\"image is missing buildpacks metadata; perhaps built with older lifecycle?\")\n\t}\n\tm := cnb.BuildMetadata{}\n\tif err := json.Unmarshal([]byte(metadataJSON), &m); err != nil {\n\t\treturn types.ContainerDebugConfiguration{}, \"\", fmt.Errorf(\"unable to parse image buildpacks metadata\")\n\t}\n\tif len(m.Processes) == 0 {\n\t\treturn types.ContainerDebugConfiguration{}, \"\", fmt.Errorf(\"buildpacks metadata has no processes\")\n\t}\n\n\tneedsCnbLauncher := ic.Entrypoint[0] != cnbLauncher\n\t// Rewrites the command-line with cnbLauncher as the entrypoint\n\tic, rewriter := adjustCommandLine(m, ic)\n\n\t// The CNB launcher uses CNB_APP_DIR (defaults to /workspace) and ignores the image's working directory.\n\tif appDir := ic.Env[\"CNB_APP_DIR\"]; appDir != \"\" {\n\t\tic.WorkingDir = appDir\n\t} else {\n\t\tic.WorkingDir = \"/workspace\"","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/debug/cnb.go#L98-L134","documentation":"Fires in updateForCNBImage when transforming a Cloud Native Buildpacks (CNB) container for debugging: the image lacks the buildpacks metadata label expected on the image config, usually because it was built with an older Cloud Native Buildpacks lifecycle version that did not emit the metadata label.","triggerScenarios":"Thrown at pkg/skaffold/debug/cnb.go:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rebuild the image with a recent pack/lifecycle version so buildpacks metadata is embedded","If debugging support isn't needed for this image, disable the debug transform or skip `skaffold debug` for it","Pin compatible builder/lifecycle versions in the buildpack build config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}