{"record":{"id":"2d200eafafdd01ad","repo":"kubernetes/kops","slug":"configlocation-is-required","errorCode":null,"errorMessage":"ConfigLocation is required","messagePattern":"ConfigLocation is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/command.go","lineNumber":100,"sourceCode":"}\n\n// Run is responsible for perform the nodeup process\nfunc (c *NodeUpCommand) Run(out io.Writer) error {\n\tctx := context.Background()\n\n\tvar bootConfig nodeup.BootConfig\n\tif c.ConfigLocation != \"\" {\n\t\tb, err := vfs.Context.ReadFile(c.ConfigLocation)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error loading configuration %q: %v\", c.ConfigLocation, err)\n\t\t}\n\n\t\terr = utils.YamlUnmarshal(b, &bootConfig)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error parsing configuration %q: %v\", c.ConfigLocation, err)\n\t\t}\n\t} else {\n\t\treturn fmt.Errorf(\"ConfigLocation is required\")\n\t}\n\n\tif c.CacheDir == \"\" {\n\t\treturn fmt.Errorf(\"CacheDir is required\")\n\t}\n\n\tregion, err := getRegion(ctx, &bootConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar configBase vfs.Path\n\n\t// If we're using a config server instead of vfs, nodeConfig will hold our configuration\n\tvar nodeConfig *nodeup.NodeConfig\n\n\tif bootConfig.ConfigServer != nil && len(bootConfig.ConfigServer.Servers) > 0 {\n\t\tresponse, err := getNodeConfigFromServers(ctx, &bootConfig, region)","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/command.go#L82-L118","documentation":"NodeUpCommand requires a ConfigLocation pointing at its boot config file; without it there is no way to obtain the BootConfig (there is no default path). Run returns this immediately when the ConfigLocation field is empty. It is a programmer/CLI-usage error, not an environmental one.","triggerScenarios":"Invoking nodeup without the --config flag, or constructing NodeUpCommand in code without setting ConfigLocation.","commonSituations":"Hand-written systemd unit or launch-template user-data omitting the --config argument; custom tooling building NodeUpCommand structurally and forgetting the field; a regression in the code that renders nodeup's user-data.","solutions":["Pass --config <vfs-path-to-nodeupconfig> when invoking the nodeup binary","Set NodeUpCommand.ConfigLocation in code before calling Run","If you author user-data, ensure the templated config path is populated (not empty) at instance launch","Verify the generated launch configuration/user-data includes the config argument"],"exampleFix":"// before\nnodeup location=... (no --config flag)\n// after\nnodeup --config s3://bucket/cluster.example.com/config/nodeupconfig --cachedir /var/cache/nodeup","handlingStrategy":"validation","validationCode":"if cfg.ConfigLocation == \"\" {\n  return errors.New(\"nodeup requires --config pointing at the nodeupconfig VFS path\")\n}","typeGuard":"func configReady(cmd *NodeUpCommand) bool { return cmd.ConfigLocation != \"\" }","tryCatchPattern":"if err := cmd.Run(os.Stdout); err != nil {\n  if err.Error() == \"ConfigLocation is required\" {\n    klog.Error(\"nodeup invoked without --config; fix the user-data/systemd unit\")\n    os.Exit(2)\n  }\n  return err\n}","preventionTips":["Always include --config in nodeup invocation templates","Add a startup check in user-data that the config argument is non-empty","Version-control the user-data template so omissions are caught in review"],"tags":["nodeup","configuration","missing-argument"],"backgroundTag":"missing-required-flag","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}