kubernetes/kops · error
creating client for Scaleway NodeIdentifier: %w
Error message
creating client for Scaleway NodeIdentifier: %w
What it means
New() for the Scaleway nodeidentifier creates a Scaleway API client (scw.NewClient) using a profile derived from environment/config, plus the kOps user agent. This error wraps any failure instantiating that client, such as malformed configuration or an invalid credential profile.
Source
Thrown at pkg/nodeidentity/scaleway/identify.go:61
// nodeIdentifier identifies a node from Scaleway
type nodeIdentifier struct {
client *scw.Client
cache expirationcache.Store
cacheEnabled bool
}
// New creates and returns a nodeidentity.Identifier for Nodes running on Scaleway
func New(cacheNodeidentityInfo bool) (nodeidentity.Identifier, error) {
profile, err := scalewaymetadata.CreateValidScalewayProfile()
if err != nil {
return nil, err
}
scwClient, err := scw.NewClient(
scw.WithProfile(profile),
scw.WithUserAgent(scaleway.KopsUserAgentPrefix+kopsv.Version),
)
if err != nil {
return nil, fmt.Errorf("creating client for Scaleway NodeIdentifier: %w", err)
}
return &nodeIdentifier{
client: scwClient,
cache: expirationcache.NewTTLStore(stringKeyFunc, cacheTTL),
cacheEnabled: cacheNodeidentityInfo,
}, nil
}
// IdentifyNode queries Scaleway for the node identify information
func (i *nodeIdentifier) IdentifyNode(ctx context.Context, node *corev1.Node) (*nodeidentity.Info, error) {
providerID := node.Spec.ProviderID
if providerID == "" {
return nil, fmt.Errorf("providerID not set for node %s", node.Name)
}
if !strings.HasPrefix(providerID, "scaleway://") {
return nil, fmt.Errorf("providerID %q not recognized for node %s", providerID, node.Name)
}View on GitHub (pinned to 4c8573c808)
Solutions
- Verify Scaleway credentials: SCW_ACCESS_KEY, SCW_SECRET_KEY and SCW_DEFAULT_PROJECT_ID are set and well-formed
- Check/repair the Scaleway CLI config ('scw init' or 'scw config dump') that feeds the profile
- Ensure credentials are valid and have the right IAM permissions by testing with the Scaleway CLI/API
Example fix
// before export SCW_ACCESS_KEY="not-a-uuid" // after export SCW_ACCESS_KEY="SCWXXXXXXXXXXXXXXXXX" export SCW_SECRET_KEY="<valid-secret>" export SCW_DEFAULT_PROJECT_ID="<project-uuid>"
Defensive patterns
Strategy: try-catch
Validate before calling
// Preflight scaleway env/config before New()
for _, k := range []string{"SCW_ACCESS_KEY", "SCW_SECRET_KEY"} {
if os.Getenv(k) == "" {
return fmt.Errorf("%s must be set before creating the scaleway nodeidentifier", k)
}
} Try / catch
id, err := scaleway.New()
if err != nil && strings.Contains(err.Error(), "creating client for Scaleway NodeIdentifier") {
return fmt.Errorf("scaleway client init failed; check SCW_* credentials/config: %w", err)
} Prevention
- Run 'scw config dump' / 'scw init' to validate credentials and profile before startup
- Set SCW_ACCESS_KEY, SCW_SECRET_KEY and SCW_DEFAULT_PROJECT_ID in the pod/deployment env
- Keep the scaleway-sdk-go dependency updated to match credential format expectations
When it happens
Trigger: scw.NewClient fails while building the client from the Scaleway profile — invalid SCW_* environment variables, malformed config file, bad credentials format, or conflicting options (e.g. both access key and deprecated fields set incorrectly).
Common situations: Missing or malformed SCW_ACCESS_KEY / SCW_SECRET_KEY / SCW_DEFAULT_PROJECT_ID, a corrupted ~/.config/scaleway/config.yaml, or an incompatible scaleway-sdk-go profile setup.
Related errors
- providerID %q did not match our project %q
- error building nova client: %v
- providerID not set for node %s
- providerID %q not recognized for node %s
- found server %s (%s) with unexpected state: %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/ffd3e43e935e1b5b.
Report an issue: GitHub.