Aws-sdk-net: AmazonClientException when trying to obtain current region using FallbackRegionFactory

Created on 14 Mar 2017  路  14Comments  路  Source: aws/aws-sdk-net

We updated AWSSDK.Core to version 3.3.9 today and are now experiencing issues using the FallbackRegionFactory once we deploy our application to Elastic Beanstalk. An exception of type AmazonClientException (The encrypted store is not available on this platform.) is thrown when calling the method GetRegionEndpoint. The same applies for FallbackCredentialsFactory. Obviously the instantiation of NetSDKCredentialsFile => SettingsManager => EnsureAvailable() leads to the fail.

Attached call stacks from the occurring issue using both FallbackRegionFactory and FallbackCredentialsFactory.

[AmazonClientException: The encrypted store is not available on this platform.]
   Amazon.Util.Internal.SettingsManager.EnsureAvailable() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Util\Internal\_bcl+coreclr\SettingsManager.cs:213
   Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile..ctor() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\CredentialManagement\_bcl+coreclr\NetSDKCredentialsFile.cs:79
   Amazon.Runtime.FallbackRegionFactory..cctor() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\AWSRegion.cs:168

[TypeInitializationException: The type initializer for 'Amazon.Runtime.FallbackRegionFactory' threw an exception.]
   Amazon.Runtime.FallbackRegionFactory.GetRegionEndpoint() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\AWSRegion.cs:213
[AmazonClientException: The encrypted store is not available on this platform.]
   Amazon.Util.Internal.SettingsManager.EnsureAvailable() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Util\Internal\_bcl+coreclr\SettingsManager.cs:213
   Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile..ctor() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\CredentialManagement\_bcl+coreclr\NetSDKCredentialsFile.cs:79
   Amazon.Runtime.FallbackCredentialsFactory..cctor() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Credentials\FallbackCredentialsFactory.cs:33

[TypeInitializationException: The type initializer for 'Amazon.Runtime.FallbackCredentialsFactory' threw an exception.]
   Amazon.Runtime.FallbackCredentialsFactory.GetCredentials() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Credentials\FallbackCredentialsFactory.cs:102
   Amazon.SecurityToken.AmazonSecurityTokenServiceClient..ctor() in E:\JenkinsWorkspaces\v3-stage-release\AWSDotNetPublic\sdk\src\Services\SecurityToken\Generated\_bcl45\AmazonSecurityTokenServiceClient.cs:123

The issue is currently blocking the deployment of our new version, so we would be very happy if you could look into the issue ASAP.

Thanks and best regards,
Ronald

bug

All 14 comments

+1. We get the same error

I got the issue attempting to connect to a local db and using the "Getting Started in .NET" tutorial.
http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.NET.html

using AWSSDK.DynamoDBv2 version 3.3.4.1

The problem has been identified and we're working on a fix now.

The fix for this issue is released in AWSSDK.Core 3.3.10 at https://www.nuget.org/packages/AWSSDK.Core/. Please let us know if you have any further problems.

Hi we are running into the same issue with those versions (we had the same problem before upddating. In other words, it never worked on our devloppement server).

AWSSDK.Core 3.3.14
AWSSDK.SimpleNotificationService 3.3.0.17

  • This is the versions that nuget tells us, because if we go and check the references directly in the project, they both are at 3.3.0.0

  • This is on our devloppement server. Localy I was able to create my credential.

this line

NetSDKCredentialsFile netSDKFile = new NetSDKCredentialsFile();

raise this error

at Amazon.Util.Internal.SettingsManager.EnsureAvailable()
at Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile..ctor()
at SmsNotification.AmazonSmsService.Authenticate()
at SmsNotification.AmazonSmsService..ctor(Boolean live)

@devlora,
Your problem is different, although the exception is the same. The FallbackCredentialsFactory was fixed to skip the NetSDKCredentialsFile if SettingsManager.EnsureAvailable() throws an exception. In your case you're intsatntiating NetSDKCredentialsFile directly so there's no way to avoid this.
My guess is that you're running with the system account. The encryption API, and in turn the NetSDKCredentialsFile, is not available to that user. If this is the case you should use SharedCredentialsFile to store and retrieve credentials on the server. Better yet, if you use CredentialProfileStoreChain you can share code in development and on the server. CredentialProfileStoreChain will check both files, similar to the FallbackCredentialsFactory.
Check out http://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html for help using the classes I mentioned.

@vellozzi ,
thank you it works great. Is there anyway I could have found the issue myself? Any logging that would have pointed me to that issue? If so, feel free to show me the way I hate waiting for answers.. Being autonomous with this sdk would be great.

thanks again

I don't see any way you could have known that.
We've changed the error message to mention that the account may not support encryption. So it will be easier for others in the future.

OK, good thing that you answer quick then ;)

thank you again!

The StoreProfileAWSCredentials class allowed me to use the SDK store when I was running as the IIS Application user, but now I can't, why was this removed in NetSDKCredentialsFile? My organization won't approve a system that stores credentials in plaintext on the file system. Can we get this back?

We're investigating this now.

any update on this issue.?

There was a fix released for this issue in AWSSDK.Core 3.3.10. If you've upgraded and you're still seeing this exception please open a new issue with your specific details.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

genifycom picture genifycom  路  4Comments

jefhai picture jefhai  路  5Comments

ShahriatHossain picture ShahriatHossain  路  4Comments

Lapeno94 picture Lapeno94  路  4Comments

jc1001 picture jc1001  路  4Comments