{"record":{"id":"bd181bcb07e34de7","repo":"abpframework/abp","slug":"not-found-aws-credentials","errorCode":null,"errorMessage":"Not found aws credentials","messagePattern":"Not found aws credentials","errorType":"exception","errorClass":"AmazonS3Exception","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/DefaultAmazonS3ClientFactory.cs","lineNumber":104,"sourceCode":"        return Task.FromResult(clientConfig);\n    }\n\n    protected virtual AWSCredentials? GetAwsCredentials(\n        AwsBlobProviderConfiguration configuration)\n    {\n        if (configuration.ProfileName.IsNullOrWhiteSpace())\n        {\n            return null;\n        }\n\n        var chain = new CredentialProfileStoreChain(configuration.ProfilesLocation);\n\n        if (chain.TryGetAWSCredentials(configuration.ProfileName, out var awsCredentials))\n        {\n            return awsCredentials;\n        }\n\n        throw new AmazonS3Exception(\"Not found aws credentials\");\n    }\n\n    protected virtual async Task<SessionAWSCredentials> GetTemporaryCredentialsAsync(\n        AwsBlobProviderConfiguration configuration)\n    {\n        var temporaryCredentialsCache = await Cache.GetAsync(configuration.TemporaryCredentialsCacheKey!);\n\n        if (temporaryCredentialsCache == null)\n        {\n            AmazonSecurityTokenServiceClient stsClient;\n\n            if (!configuration.AccessKeyId.IsNullOrEmpty() && !configuration.SecretAccessKey.IsNullOrEmpty())\n            {\n                stsClient = new AmazonSecurityTokenServiceClient(configuration.AccessKeyId,\n                    configuration.SecretAccessKey);\n            }\n            else\n            {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/DefaultAmazonS3ClientFactory.cs#L86-L122","documentation":"Thrown by DefaultAmazonS3ClientFactory.GetAwsCredentials when UseCredentials is enabled and a ProfileName is configured, but CredentialProfileStoreChain.TryGetAWSCredentials cannot resolve that profile. It surfaces as an AmazonS3Exception because the explicitly-requested named profile was not found in the credential store (SDK credentials file / ProfilesLocation).","triggerScenarios":"AwsBlobProviderConfiguration.UseCredentials=true with a non-empty ProfileName, where the profile does not exist in the AWS credentials file at ProfilesLocation (or the default location when ProfilesLocation is null). The factory throws instead of falling back to the default credential chain.","commonSituations":"Deploying to a server/container that lacks the ~/.aws/credentials file, misspelling the profile name, pointing ProfilesLocation at the wrong path, or running under an identity whose home directory has no credentials file.","solutions":["Verify the profile exists in the credentials file (aws configure list-profiles) and the name matches ProfileName exactly.","Set ProfilesLocation to the absolute path of the credentials file when running in a non-default environment (container/service).","If you do not need a named profile, clear ProfileName so the factory returns null and the SDK default credential chain is used.","Alternatively switch to explicit AccessKeyId/SecretAccessKey or temporary credentials."],"exampleFix":"// before\n\"Aws\": {\n  \"UseCredentials\": true,\n  \"ProfileName\": \"prod\"\n}\n\n// after (explicit profile path)\n\"Aws\": {\n  \"UseCredentials\": true,\n  \"ProfileName\": \"prod\",\n  \"ProfilesLocation\": \"/var/app/.aws/credentials\"\n}\n\n// after (drop named profile, use default chain)\n\"Aws\": {\n  \"UseCredentials\": true\n}","handlingStrategy":"validation","validationCode":"if (!cfg.ProfileName.IsNullOrWhiteSpace())\n{\n    var chain = new CredentialProfileStoreChain(cfg.ProfilesLocation);\n    if (!chain.TryGetAWSCredentials(cfg.ProfileName, out _))\n        throw new InvalidOperationException($\"AWS profile '{cfg.ProfileName}' not found at '{cfg.ProfilesLocation}'.\");\n}","typeGuard":"bool profileResolves =\n    cfg.ProfileName.IsNullOrWhiteSpace() ||\n    new CredentialProfileStoreChain(cfg.ProfilesLocation).TryGetAWSCredentials(cfg.ProfileName, out _);","tryCatchPattern":"try { await container.SaveAsync(name, stream); }\ncatch (AmazonS3Exception ex) when (ex.Message == \"Not found aws credentials\")\n{ /* install/fix the named profile or drop ProfileName */ }","preventionTips":["Run 'aws configure list-profiles' to confirm the profile exists.","Set ProfilesLocation explicitly in containers/services where the home dir differs.","Prefer IAM roles / environment credentials in production over named profiles."],"tags":["aws","credentials","configuration","iam","abp"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}