kubernetes/kops · error
error parsing configuration %q: %v
Error message
error parsing configuration %q: %v
What it means
After successfully reading the boot config bytes, nodeup parses them into nodeup.BootConfig with utils.YamlUnmarshal. This error means the file was fetched but is not valid YAML or does not match the BootConfig schema (e.g. wrong type for a field, truncated file, HTML error page saved instead of YAML).
Source
Thrown at upup/pkg/fi/nodeup/command.go:97
CacheDir string
ConfigLocation string
Target string
}
// Run is responsible for perform the nodeup process
func (c *NodeUpCommand) Run(out io.Writer) error {
ctx := context.Background()
var bootConfig nodeup.BootConfig
if c.ConfigLocation != "" {
b, err := vfs.Context.ReadFile(c.ConfigLocation)
if err != nil {
return fmt.Errorf("error loading configuration %q: %v", c.ConfigLocation, err)
}
err = utils.YamlUnmarshal(b, &bootConfig)
if err != nil {
return fmt.Errorf("error parsing configuration %q: %v", c.ConfigLocation, err)
}
} else {
return fmt.Errorf("ConfigLocation is required")
}
if c.CacheDir == "" {
return fmt.Errorf("CacheDir is required")
}
region, err := getRegion(ctx, &bootConfig)
if err != nil {
return err
}
var configBase vfs.Path
// If we're using a config server instead of vfs, nodeConfig will hold our configuration
var nodeConfig *nodeup.NodeConfigView on GitHub (pinned to 4c8573c808)
Solutions
- Run the file through a YAML validator / 'yamllint' and fix syntax errors
- Check field names and types against the nodeup.BootConfig struct for your kops version
- Re-download or re-generate the config file (kubectl kops get cluster --cloudonly / redeploy) to rule out truncation
- Ensure the kops version that created the config matches the nodeup binary version
Example fix
// before (nodeupconfig) configServer: servers: - url 443 // after configServer: servers: - url: "https://api.internal.cluster.example.com:443"
Defensive patterns
Strategy: validation
Validate before calling
// validate the YAML parses into BootConfig before running
b, _ := os.ReadFile(localCopy)
var bc nodeup.BootConfig
if err := yaml.Unmarshal(b, &bc); err != nil {
return fmt.Errorf("nodeup config invalid: %w", err)
} Type guard
func isValidYAML(b []byte) bool {
var v interface{}
return yaml.Unmarshal(b, &v) == nil
} Try / catch
if err := cmd.Run(os.Stdout); err != nil {
if strings.HasPrefix(err.Error(), "error parsing configuration") {
klog.Errorf("nodeup config is malformed YAML or wrong schema: %v", err)
os.Exit(1)
}
return err
} Prevention
- Never hand-edit the generated nodeup config; regenerate it with kops tooling
- Validate YAML with yamllint before uploading to the state store
- Keep nodeup and kops versions in lockstep to avoid BootConfig schema drift
When it happens
Trigger: NodeUpCommand.Run where utils.YamlUnmarshal fails on the bytes read from ConfigLocation: malformed YAML syntax, a field with the wrong type, an empty/corrupted file, or a non-config file at the path.
Common situations: Hand-edited nodeupconfig with YAML indentation errors; S3 object written truncated; a proxy/error page stored at the path; using a config format from an incompatible kops version (schema drift).
Related errors
- unsupported cloud provider for authenticator %q
- parsing path for kops-channels manifest %s: %w
- parsing kops-channels manifest: %w
- unable to parse KubernetesVersion %q: %w
- error building kubelet config: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/12323c4aef70ff18.
Report an issue: GitHub.