{"record":{"id":"78121b79632848ec","repo":"kubernetes/kops","slug":"creating-client-for-scaleway-cloud-w","errorCode":null,"errorMessage":"creating client for Scaleway Cloud: %w","messagePattern":"creating client for Scaleway Cloud: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"upup/pkg/fi/cloudup/scaleway/cloud.go","lineNumber":136,"sourceCode":"\tvar err error\n\n\tif profileName := os.Getenv(\"SCW_PROFILE\"); profileName == \"REDACTED\" {\n\t\t// If the profile is REDACTED, we're running integration tests so no need for authentication\n\t\tscwClient, err = scw.NewClient(scw.WithoutAuth())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tprofile, err := scalewaymetadata.CreateValidScalewayProfile()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tscwClient, err = scw.NewClient(\n\t\t\tscw.WithProfile(profile),\n\t\t\tscw.WithUserAgent(KopsUserAgentPrefix+kopsv.Version),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"creating client for Scaleway Cloud: %w\", err)\n\t\t}\n\t\tregion = scw.Region(fi.ValueOf(profile.DefaultRegion))\n\t\tzone = scw.Zone(fi.ValueOf(profile.DefaultZone))\n\t}\n\n\tif tags != nil {\n\t\tregion, err = scw.ParseRegion(tags[\"region\"])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tzone, err = scw.ParseZone(tags[\"zone\"])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn &scwCloudImplementation{\n\t\tclient:         scwClient,","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scaleway/cloud.go#L118-L154","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: broken config\n// ~/.config/scw/config.yaml: access_key: \"\"\n// after\n// ~/.config/scw/config.yaml:\n//   access_key: SCWXXXXXXXXXXXXXXXXX\n//   secret_key: <uuid>\n//   default_project_id: <uuid>\n//   default_region: fr-par\n//   default_zone: fr-par-1","handlingStrategy":"validation","validationCode":"import (\n  \"os\"\n  \"github.com/scaleway/scaleway-sdk-go/scw\"\n)\n\nfunc validateScalewayProfile() error {\n  cfg, err := scw.LoadConfig()\n  if err != nil {\n    return fmt.Errorf(\"cannot load scw config: %w\", err)\n  }\n  profile, _ := cfg.GetActiveProfile()\n  if profile.AccessKey == nil || profile.SecretKey == nil {\n    return fmt.Errorf(\"SCW_ACCESS_KEY/SCW_SECRET_KEY not set\")\n  }\n  if profile.DefaultProjectID == nil {\n    return fmt.Errorf(\"SCW_DEFAULT_PROJECT_ID not set\")\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["scaleway","client-init","configuration","kops"],"backgroundTag":"invalid-cloud-credentials-config","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}