{"record":{"id":"2ef6796a6853549f","repo":"GoogleContainerTools/skaffold","slug":"marshaling-config-w","errorCode":null,"errorMessage":"marshaling config: %w","messagePattern":"marshaling config: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/cmd/config/list.go","lineNumber":40,"sourceCode":"\t\"io\"\n\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/config\"\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/yaml\"\n)\n\nfunc List(ctx context.Context, out io.Writer) error {\n\tvar configYaml []byte\n\tif showAll {\n\t\tcfg, err := config.ReadConfigFile(configFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif cfg == nil || (cfg.Global == nil && len(cfg.ContextConfigs) == 0) { // empty config\n\t\t\treturn nil\n\t\t}\n\t\tconfigYaml, err = yaml.Marshal(&cfg)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"marshaling config: %w\", err)\n\t\t}\n\t} else {\n\t\tcontextConfig, err := getConfigForKubectx()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif contextConfig == nil {\n\t\t\tfmt.Fprintf(out, \"No config found for сurrent context %q\\n\", kubecontext)\n\t\t\treturn nil\n\t\t}\n\t\tconfigYaml, err = yaml.Marshal(&contextConfig)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"marshaling config: %w\", err)\n\t\t}\n\t}\n\n\tfmt.Fprintf(out, \"skaffold config: %s\\n\", configFile)\n\tout.Write(configYaml)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/cmd/config/list.go#L22-L58","documentation":"Fires when the in-memory global/context config object cannot be serialized to YAML by skaffold's yaml.Marshal while preparing output for `skaffold config list`. This indicates the config struct contains a value the YAML marshaller cannot handle, not a bad config file on disk.","triggerScenarios":"Thrown at cmd/skaffold/app/cmd/config/list.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run `skaffold config list` to rule out transient state; inspect the config file for unusual or manually injected values","Check the skaffold config file (~/.skaffold/config) for corrupted entries and fix or delete them","If reproducible, report the issue with the config contents (redacted) to the skaffold maintainers, as this is an internal marshalling failure"],"exampleFix":null,"handlingStrategy":"try-catch","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"}