kubernetes/kops · error

error building nova client: %v

Error message

error building nova client: %v

What it means

Thrown by NewOpenstackVerifier when gos.NewComputeV2 fails to construct a Nova (Compute V2) client for the resolved region. The provider client was created, but selecting/discovering the compute endpoint in the service catalog for that region failed.

Source

Thrown at upup/pkg/fi/cloudup/openstack/verifier.go:86

	ua := gophercloud.UserAgent{}
	ua.Prepend("kops/kopscontrollerverifier")
	provider.UserAgent = ua
	klog.V(4).Infof("Using user-agent %s", ua.Join())

	// node-controller should be able to renew it tokens against OpenStack API
	env.AllowReauth = true

	err = gos.Authenticate(context.TODO(), provider, env)
	if err != nil {
		return nil, err
	}

	novaClient, err := gos.NewComputeV2(provider, gophercloud.EndpointOpts{
		Type:   "compute",
		Region: region,
	})
	if err != nil {
		return nil, fmt.Errorf("error building nova client: %v", err)
	}

	kubeClient, err := newClientSet()
	if err != nil {
		return nil, fmt.Errorf("error building kubernetes client: %w", err)
	}

	return &openstackVerifier{
		novaClient: novaClient,
		kubeClient: kubeClient,
	}, nil
}

func stringInSlice(a string, list []string) bool {
	for _, b := range list {
		if b == a {
			return true
		}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the region string and that nova appears in `openstack catalog list` for that region.
  2. Re-authenticate with a fresh RC file/token and confirm the compute endpoint is reachable.
  3. Check that your project has access to the compute service (admin may need to grant it).
  4. Inspect the wrapped %v error for the exact endpoint URL/CA problem and fix endpoint configuration.

Example fix

// before
novaClient, err := gos.NewComputeV2(provider, gophercloud.EndpointOpts{Type: "compute", Region: region})
if err != nil {
    return nil, fmt.Errorf("error building nova client: %v", err)
}
// after
novaClient, err := gos.NewComputeV2(provider, gophercloud.EndpointOpts{Type: "compute", Region: region})
if err != nil {
    return nil, fmt.Errorf("error building nova client (region=%s): %w", region, err)
}
Defensive patterns

Strategy: fallback

Validate before calling

catalog, err := providerClient.GetServiceCatalog(ctx)
if err != nil || !hasComputeEndpoint(catalog, region) {
    return errors.New("no compute endpoint for region " + region)
}

Try / catch

novaClient, err := gos.NewComputeV2(provider, gophercloud.EndpointOpts{Type: "compute", Region: region})
if err != nil {
    return nil, fmt.Errorf("error building nova client: %w", err)
}

Prevention

When it happens

Trigger: NewOpenstackVerifier calls gos.NewComputeV2 with EndpointOpts{Type:"compute", Region:region}; it errors when the keystone catalog has no compute service for the region, the endpoint URL is invalid, or endpoint discovery fails.

Common situations: Region typo or a region without a nova service; project lacking a compute endpoint in its catalog; expired/insufficiently scoped token; keystone catalog corruption after upgrades; wrong OS_INTERFACE selection.

Related errors


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