{"record":{"id":"29d06435db9af1c7","repo":"GoogleContainerTools/skaffold","slug":"writing-config-file-w-29d064","errorCode":null,"errorMessage":"writing config file: %w","messagePattern":"writing config file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/config/util.go","lineNumber":540,"sourceCode":"\tfullConfig.Global.CollectMetrics = &collectMetrics\n\terr = WriteFullConfig(configFile, fullConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn err\n}\n\nfunc WriteFullConfig(configFile string, cfg *GlobalConfig) error {\n\tcontents, err := yaml.Marshal(cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshaling config: %w\", err)\n\t}\n\tconfigFileOrDefault, err := ResolveConfigFile(configFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := os.WriteFile(configFileOrDefault, contents, 0644); err != nil {\n\t\treturn fmt.Errorf(\"writing config file: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc UpdateUserSurveyTaken(configFile string, id string) error {\n\tai := fmt.Sprintf(updateUserTaken, id)\n\taiErr := fmt.Errorf(\"could not automatically update the survey prompted timestamp - please run `%s`\", ai)\n\tconfigFile, err := ResolveConfigFile(configFile)\n\tif err != nil {\n\t\treturn aiErr\n\t}\n\tfullConfig, err := ReadConfigFile(configFile)\n\tif err != nil {\n\t\treturn aiErr\n\t}\n\tif fullConfig.Global == nil {\n\t\tfullConfig.Global = &ContextConfig{}\n\t}","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/config/util.go#L522-L558","documentation":"Fires in WriteFullConfig when os.WriteFile fails to persist the marshalled global config back to the config file (default ~/.skaffold/config). Typically a filesystem-level failure: permissions, read-only home, disk full, or the file being locked.","triggerScenarios":"Thrown at pkg/skaffold/config/util.go:540 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check write permissions on the config file and its directory: ls -l ~/.skaffold/config","Free disk space or remount the filesystem read-write if applicable","Remove or fix a corrupted/locked config file so skaffold can rewrite it"],"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"}