{"record":{"id":"ffd3e43e935e1b5b","repo":"kubernetes/kops","slug":"creating-client-for-scaleway-nodeidentifier-w","errorCode":null,"errorMessage":"creating client for Scaleway NodeIdentifier: %w","messagePattern":"creating client for Scaleway NodeIdentifier: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/scaleway/identify.go","lineNumber":61,"sourceCode":"// nodeIdentifier identifies a node from Scaleway\ntype nodeIdentifier struct {\n\tclient       *scw.Client\n\tcache        expirationcache.Store\n\tcacheEnabled bool\n}\n\n// New creates and returns a nodeidentity.Identifier for Nodes running on Scaleway\nfunc New(cacheNodeidentityInfo bool) (nodeidentity.Identifier, error) {\n\tprofile, err := scalewaymetadata.CreateValidScalewayProfile()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tscwClient, err := scw.NewClient(\n\t\tscw.WithProfile(profile),\n\t\tscw.WithUserAgent(scaleway.KopsUserAgentPrefix+kopsv.Version),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating client for Scaleway NodeIdentifier: %w\", err)\n\t}\n\n\treturn &nodeIdentifier{\n\t\tclient:       scwClient,\n\t\tcache:        expirationcache.NewTTLStore(stringKeyFunc, cacheTTL),\n\t\tcacheEnabled: cacheNodeidentityInfo,\n\t}, nil\n}\n\n// IdentifyNode queries Scaleway for the node identify information\nfunc (i *nodeIdentifier) IdentifyNode(ctx context.Context, node *corev1.Node) (*nodeidentity.Info, error) {\n\tproviderID := node.Spec.ProviderID\n\tif providerID == \"\" {\n\t\treturn nil, fmt.Errorf(\"providerID not set for node %s\", node.Name)\n\t}\n\tif !strings.HasPrefix(providerID, \"scaleway://\") {\n\t\treturn nil, fmt.Errorf(\"providerID %q not recognized for node %s\", providerID, node.Name)\n\t}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/scaleway/identify.go#L43-L79","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nexport SCW_ACCESS_KEY=\"not-a-uuid\"\n// after\nexport SCW_ACCESS_KEY=\"SCWXXXXXXXXXXXXXXXXX\"\nexport SCW_SECRET_KEY=\"<valid-secret>\"\nexport SCW_DEFAULT_PROJECT_ID=\"<project-uuid>\"","handlingStrategy":"try-catch","validationCode":"// Preflight scaleway env/config before New()\nfor _, k := range []string{\"SCW_ACCESS_KEY\", \"SCW_SECRET_KEY\"} {\n    if os.Getenv(k) == \"\" {\n        return fmt.Errorf(\"%s must be set before creating the scaleway nodeidentifier\", k)\n    }\n}","typeGuard":null,"tryCatchPattern":"id, err := scaleway.New()\nif err != nil && strings.Contains(err.Error(), \"creating client for Scaleway NodeIdentifier\") {\n    return fmt.Errorf(\"scaleway client init failed; check SCW_* credentials/config: %w\", err)\n}","preventionTips":["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"],"tags":["scaleway","node-identity","api-client","configuration"],"backgroundTag":"client-creation-failed","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"}