kubernetes/kops · critical

error loading configuration %q: %v

Error message

error loading configuration %q: %v

What it means

nodeup's Run reads its boot configuration file from ConfigLocation via vfs.Context.ReadFile before doing anything else. This error wraps any failure to fetch that file: nonexistent path, unreadable object store, bad credentials, or network failure reaching the VFS location. nodeup cannot proceed without the boot config, so it aborts immediately.

Source

Thrown at upup/pkg/fi/nodeup/command.go:92

// MaxTaskDuration is the amount of time to keep trying for; we retry for a long time - there is not really any great fallback
const MaxTaskDuration = 365 * 24 * time.Hour

// NodeUpCommand is the configuration for nodeup
type NodeUpCommand struct {
	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
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the file exists at the ConfigLocation path (e.g. aws s3 ls s3://<bucket>/<path>)
  2. Check the node's IAM instance profile grants read access to the state store location
  3. Correct the --config flag / ConfigLocation value in the nodeup invocation or launch template
  4. Confirm network connectivity from the node to the object store endpoint (VPC endpoints, proxy settings)

Example fix

// before
ConfigLocation: "s3://old-bucket/cluster.example.com/config/nodeupconfig"
// after
ConfigLocation: "s3://correct-state-bucket/cluster.example.com/config/nodeupconfig"
Defensive patterns

Strategy: validation

Validate before calling

// before starting nodeup, confirm the config is readable
if err := exec.Command("aws", "s3", "cp", configLocation, "/dev/null").Run(); err != nil {
  return fmt.Errorf("config %s unreadable: %w", configLocation, err)
}

Type guard

func hasConfigLocation(cmd *NodeUpCommand) bool { return cmd.ConfigLocation != "" }

Try / catch

if err := cmd.Run(os.Stdout); err != nil {
  if strings.HasPrefix(err.Error(), "error loading configuration") {
    klog.Errorf("cannot fetch boot config at %s; check path, IAM perms and network: %v", cmd.ConfigLocation, err)
    os.Exit(1)
  }
  return err
}

Prevention

When it happens

Trigger: NodeUpCommand.Run with c.ConfigLocation set but the VFS path does not exist, points to a wrong bucket/cluster name, the instance lacks IAM permission to read it, or the S3/object-store endpoint is unreachable.

Common situations: Misconfigured nodeup systemd unit or ASG launch template passing a stale --config path; cluster state moved to a different S3 bucket; IAM instance profile missing s3:GetObject on the state bucket; DNS/proxy issues on a private network blocking S3.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/227033641952e9d4. Report an issue: GitHub.