kubernetes/kops · critical
creating client for Scaleway Cloud: %w
Error message
creating client for Scaleway Cloud: %w
What it means
NewScwCloud wraps any failure from scaleway-sdk-go's scw.NewClient (which builds an API client from a validated profile) with the message "creating client for Scaleway Cloud: %w". NewClient itself validates the resolved profile and fails on malformed credentials or invalid configuration fields. This error means kOps could not even construct the Scaleway API client, before any network call is made.
Source
Thrown at upup/pkg/fi/cloudup/scaleway/cloud.go:136
var err error
if profileName := os.Getenv("SCW_PROFILE"); profileName == "REDACTED" {
// If the profile is REDACTED, we're running integration tests so no need for authentication
scwClient, err = scw.NewClient(scw.WithoutAuth())
if err != nil {
return nil, err
}
} else {
profile, err := scalewaymetadata.CreateValidScalewayProfile()
if err != nil {
return nil, err
}
scwClient, err = scw.NewClient(
scw.WithProfile(profile),
scw.WithUserAgent(KopsUserAgentPrefix+kopsv.Version),
)
if err != nil {
return nil, fmt.Errorf("creating client for Scaleway Cloud: %w", err)
}
region = scw.Region(fi.ValueOf(profile.DefaultRegion))
zone = scw.Zone(fi.ValueOf(profile.DefaultZone))
}
if tags != nil {
region, err = scw.ParseRegion(tags["region"])
if err != nil {
return nil, err
}
zone, err = scw.ParseZone(tags["zone"])
if err != nil {
return nil, err
}
}
return &scwCloudImplementation{
client: scwClient,View on GitHub (pinned to 4c8573c808)
Solutions
- Inspect the wrapped error from the Scaleway SDK to see which profile field failed validation.
- Run `scw init` or correct ~/.config/scw/config.yaml so the profile is valid (valid project/organization UUIDs, non-empty keys).
- Unset conflicting env vars (SCW_DEFAULT_PROJECT_ID, SCW_ACCESS_KEY, SCW_SECRET_KEY) and set them to correct values.
- Update github.com/scaleway/scaleway-sdk-go to a version matching your config format.
Example fix
// before: broken config // ~/.config/scw/config.yaml: access_key: "" // after // ~/.config/scw/config.yaml: // access_key: SCWXXXXXXXXXXXXXXXXX // secret_key: <uuid> // default_project_id: <uuid> // default_region: fr-par // default_zone: fr-par-1
Defensive patterns
Strategy: validation
Validate before calling
import (
"os"
"github.com/scaleway/scaleway-sdk-go/scw"
)
func validateScalewayProfile() error {
cfg, err := scw.LoadConfig()
if err != nil {
return fmt.Errorf("cannot load scw config: %w", err)
}
profile, _ := cfg.GetActiveProfile()
if profile.AccessKey == nil || profile.SecretKey == nil {
return fmt.Errorf("SCW_ACCESS_KEY/SCW_SECRET_KEY not set")
}
if profile.DefaultProjectID == nil {
return fmt.Errorf("SCW_DEFAULT_PROJECT_ID not set")
}
return nil
} Prevention
- Run `scw init` once and validate with `scw config dump` before deploying kOps.
- Keep profile fields (access key, secret key, project ID) in env vars or a complete config file, never partially set.
- Pin the scaleway-sdk-go version and regenerate config after SDK upgrades.
When it happens
Trigger: scw.NewClient(scw.WithProfile(profile), scw.WithUserAgent(...)) returns an error — i.e. the profile produced by CreateValidScalewayProfile contains invalid/missing required fields (e.g. malformed default organization ID, invalid config file content) that the client constructor validates.
Common situations: Malformed entries in ~/.config/scw/config.yaml, an invalid SCW_DEFAULT_PROJECT_ID or SCW_DEFAULT_ORGANIZATION_ID env var, corrupted SCW_ACCESS_KEY/SCW_SECRET_KEY values containing illegal characters, or a Scaleway CLI config file written by an incompatible sdk version.
Related errors
- building kubernetes client for node labeler: %w
- building kubernetes client: %w
- invalid base channel location: %q
- cannot find subnet %q (declared in instance group %q, not fo
- error parsing configuration: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/78121b79632848ec.
Report an issue: GitHub.