{"record":{"id":"dc3cc0befad64a62","repo":"kubernetes/kops","slug":"loading-scaleway-config-file-w","errorCode":null,"errorMessage":"loading Scaleway config file: %w","messagePattern":"loading Scaleway config file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scaleway/scalewaymetadata/profile.go","lineNumber":35,"sourceCode":"package scalewaymetadata\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/scaleway/scaleway-sdk-go/scw\"\n\tk8serrors \"k8s.io/apimachinery/pkg/util/errors\"\n\t\"k8s.io/kops/upup/pkg/fi\"\n)\n\nfunc getScalewayProfile() (*scw.Profile, error) {\n\tscwProfileName := os.Getenv(\"SCW_PROFILE\")\n\tif scwProfileName == \"\" {\n\t\treturn nil, nil\n\t}\n\tconfig, err := scw.LoadConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loading Scaleway config file: %w\", err)\n\t}\n\tprofile, ok := config.Profiles[scwProfileName]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"could not find Scaleway profile %q\", scwProfileName)\n\t}\n\treturn profile, nil\n}\n\nfunc checkCredentials(accessKey, secretKey, projectID string) []error {\n\terrList := []error(nil)\n\tif accessKey == \"\" {\n\t\terrList = append(errList, fmt.Errorf(\"SCW_ACCESS_KEY has to be set\"))\n\t}\n\tif secretKey == \"\" {\n\t\terrList = append(errList, fmt.Errorf(\"SCW_SECRET_KEY has to be set\"))\n\t}\n\tif projectID == \"\" {\n\t\terrList = append(errList, fmt.Errorf(\"SCW_DEFAULT_PROJECT_ID has to be set\"))","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scaleway/scalewaymetadata/profile.go#L17-L53","documentation":"In getScalewayProfile, scw.LoadConfig failed while trying to honor a non-empty SCW_PROFILE environment variable. The Scaleway SDK could not read/parse ~/.config/scw/config.yaml — the file is missing, unreadable, or malformed YAML. This only fires when SCW_PROFILE is set; otherwise the function returns nil early.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scaleway/scalewaymetadata/profile.go:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'scw init' or otherwise create a valid Scaleway config file","Check the file's YAML syntax and permissions","Unset SCW_PROFILE if you intend to rely on environment variables only"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}