kubernetes/kops · error
SCW_ACCESS_KEY has to be set
Error message
SCW_ACCESS_KEY has to be set
What it means
Validation error from checkCredentials: after merging the SCW_PROFILE-based profile with environment overrides, the access key is still empty. It flags the missing SCW_ACCESS_KEY input specifically; it is aggregated with any other missing-credential errors before being returned.
Source
Thrown at upup/pkg/fi/cloudup/scaleway/scalewaymetadata/profile.go:47
scwProfileName := os.Getenv("SCW_PROFILE")
if scwProfileName == "" {
return nil, nil
}
config, err := scw.LoadConfig()
if err != nil {
return nil, fmt.Errorf("loading Scaleway config file: %w", err)
}
profile, ok := config.Profiles[scwProfileName]
if !ok {
return nil, fmt.Errorf("could not find Scaleway profile %q", scwProfileName)
}
return profile, nil
}
func checkCredentials(accessKey, secretKey, projectID string) []error {
errList := []error(nil)
if accessKey == "" {
errList = append(errList, fmt.Errorf("SCW_ACCESS_KEY has to be set"))
}
if secretKey == "" {
errList = append(errList, fmt.Errorf("SCW_SECRET_KEY has to be set"))
}
if projectID == "" {
errList = append(errList, fmt.Errorf("SCW_DEFAULT_PROJECT_ID has to be set"))
}
return errList
}
func CreateValidScalewayProfile() (*scw.Profile, error) {
var profile scw.Profile
// If the profile is REDACTED, we're running integration tests so no need to return any credentials
if profileName := os.Getenv("SCW_PROFILE"); profileName == "REDACTED" {
return &profile, nil
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Set SCW_ACCESS_KEY (or add AccessKey to the named profile in the config file)
- Find the access key in the Scaleway console under credentials
- Run 'scw init' to generate a complete config
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/scaleway/scalewaymetadata/profile.go:47 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/afb5074203e1c483.
Report an issue: GitHub.