Hi -
After upgrading AWSSDK.Core from 3.3.8.2 to 3.3.10.2 and AWSSDK.Kinesis from 3.3.1.4 to 3.3.1.7 default credentials in ~/.aws/credentials are no longer retrieved (on OS X or Linux, with mono 4.8 and the net45 NuGet package):
Unhandled Exception:
System.TypeInitializationException: The type initializer for '<StartupCode$app>.$AwsAccess$fsx' threw an exception. ---> Amazon.Runtime.AmazonServiceException: Unable to find credentials
Exception 1 of 4:
System.InvalidOperationException: The app.config/web.config files for the application did not contain credential information
at Amazon.Runtime.AppConfigAWSCredentials..ctor () [0x000de] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory+<>c.<Reset>b__8_0 () [0x00000] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials (System.Boolean fallbackToAnonymous) [0x00028] in <79d2e617e6ca439ca5375e902f5fcf94>:0
Exception 2 of 4:
System.TypeInitializationException: The type initializer for 'Amazon.Runtime.CredentialManagement.AWSCredentialsFactory' threw an exception. ---> Amazon.Runtime.AmazonClientException: The encrypted store is not available on this platform.
at Amazon.Util.Internal.SettingsManager.EnsureAvailable () [0x00011] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Util.Internal.SettingsManager..ctor (System.String settingsType) [0x00006] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Util.Internal.NamedSettingsManager..ctor (System.String settingsType) [0x00006] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.CredentialManagement.SAMLEndpointManager..ctor () [0x00006] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.CredentialManagement.AWSCredentialsFactory..cctor () [0x00022] in <79d2e617e6ca439ca5375e902f5fcf94>:0
--- End of inner exception stack trace ---
at Amazon.Runtime.CredentialManagement.CredentialProfile.GetAWSCredentials (Amazon.Runtime.CredentialManagement.ICredentialProfileSource profileSource, System.Boolean nonCallbackOnly) [0x00000] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetAWSCredentials (Amazon.Runtime.CredentialManagement.ICredentialProfileSource source, System.String defaultProfileName) [0x0000b] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory+<>c.<Reset>b__8_1 () [0x00000] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials (System.Boolean fallbackToAnonymous) [0x00028] in <79d2e617e6ca439ca5375e902f5fcf94>:0
Exception 3 of 4:
System.InvalidOperationException: The environment variables AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN were not set with AWS credentials.
at Amazon.Runtime.EnvironmentVariablesAWSCredentials.FetchCredentials () [0x00094] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.EnvironmentVariablesAWSCredentials..ctor () [0x0001b] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory+<>c.<Reset>b__8_2 () [0x00000] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials (System.Boolean fallbackToAnonymous) [0x00028] in <79d2e617e6ca439ca5375e902f5fcf94>:0
Exception 4 of 4:
Amazon.Runtime.AmazonServiceException: Unable to reach credentials server
at Amazon.Runtime.URIBasedRefreshingCredentialHelper.GetContents (System.Uri uri) [0x00014] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.InstanceProfileAWSCredentials+<GetAvailableRoles>d__10.MoveNext () [0x0001c] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.InstanceProfileAWSCredentials.GetFirstRole () [0x00016] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.InstanceProfileAWSCredentials..ctor () [0x00000] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.ECSEC2CredentialsWrapper () [0x00046] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials (System.Boolean fallbackToAnonymous) [0x00028] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials (System.Boolean fallbackToAnonymous) [0x000f9] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials () [0x00000] in <79d2e617e6ca439ca5375e902f5fcf94>:0
at Amazon.Kinesis.AmazonKinesisClient..ctor (Amazon.RegionEndpoint region) [0x00000] in <b725eb336b4f4556801d9e7f24979ada>:0
at <StartupCode$app>.$AwsAccess$fsx..cctor () [0x00000] in <58d0131d8383fb1ca74503831d13d058>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr)
at <StartupCode$app>.$App$fsx.main@ () [0x0000c] in <58d0131d8383fb1ca74503831d13d058>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for '<StartupCode$app>.$AwsAccess$fsx' threw an exception. ---> Amazon.Runtime.AmazonServiceException: Unable to find credentials
We've identified the problem and will have a fix out as soon as we can.
The fix for this issue was released in version 3.3.69.0.
Hi @vellozzi , commenting here on the closed issue as I'm not sure whether it is the identical one or if a new should be opened.
My question: Could this affect Cognito as well? I'm trying to deploy an Asp.net 4.5 app to our Windows Server 2016 Datacenter EC2 Stating instance, and getting the exactly same error message.
~~~~
30 Unable to find credentials
Exception 1 of 4:
System.TypeInitializationException: The type initializer for 'Amazon.Runtime.CredentialManagement.AWSCredentialsFactory' threw an exception. ---> Amazon.Runtime.AmazonClientException: The encrypted store is not available on this platform.
at Amazon.Util.Internal.SettingsManager.EnsureAvailable()
at Amazon.Runtime.CredentialManagement.SAMLEndpointManager..ctor()
at Amazon.Runtime.CredentialManagement.AWSCredentialsFactory..cctor()
--- End of inner exception stack trace ---
at Amazon.Runtime.CredentialManagement.AWSCredentialsFactory.IsCallbackRequired(Nullable`1 profileType)
at Amazon.Runtime.CredentialManagement.AWSCredentialsFactory.GetAWSCredentials(String profileName, ICredentialProfileSource profileSource, CredentialProfileOptions options, RegionEndpoint stsRegion, Boolean nonCallbackOnly)
at Amazon.Runtime.CredentialManagement.AWSCredentialsFactory.GetAWSCredentials(CredentialProfile profile, ICredentialProfileSource profileSource, Boolean nonCallbackOnly)
at Amazon.Runtime.AppConfigAWSCredentials..ctor()
at Amazon.Runtime.FallbackCredentialsFactory.<>c.
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous)
Exception 2 of 4:
Amazon.Runtime.AmazonClientException: Unable to find a default profile in CredentialProfileStoreChain.
at Amazon.Runtime.FallbackCredentialsFactory.GetAWSCredentials(ICredentialProfileSource source, String defaultProfileName)
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous)
Exception 3 of 4:
System.InvalidOperationException: The environment variables AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN were not set with AWS credentials.
at Amazon.Runtime.EnvironmentVariablesAWSCredentials.FetchCredentials()
at Amazon.Runtime.FallbackCredentialsFactory.<>c.
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous)
Exception 4 of 4:
Amazon.Runtime.AmazonServiceException: Unable to reach credentials server
at Amazon.Runtime.URIBasedRefreshingCredentialHelper.GetContents(Uri uri)
at Amazon.Runtime.InstanceProfileAWSCredentials.
at Amazon.Runtime.InstanceProfileAWSCredentials.GetFirstRole()
at Amazon.Runtime.FallbackCredentialsFactory.ECSEC2CredentialsWrapper()
at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous)
~~~~
The project is on 4.5.1, and I just checked the two packages are latest version from Nuget .
~~~~
~
The credentials file specified in the web.config file can definitely be seen; e.g. if I change the profile name then it'll fail saying the file doesn't contain credentials.
<aws region="ap-southeast-2" profileName="Staging" profilesLocation="C:\Directory\.aws\credentials" />
Changing to different section I get:
Exception 1 of 4: System.InvalidOperationException: The app.config/web.config files for the application did not contain credential information
Also the credentials are correct, verified in Dev (Windows 10) where it works just fine. 443 is open in and out.
Looking at https://www.nuget.org/packages/AWSSDK.Core/ I see that it's on 3.3.10.2 which is definitely a lot older than 3.3.69.0. If this is the same issue, then how would I go about incorporating 3.3.69.0 into my build? Any pointers would be greatly appreciated. :-)
Thanks!
The original problem from this issue is the same problem you're seeing.
The fix was mistakenly not released to NuGet, but it's in GitHub. We'll update the AWSSDK.Core NuGet package with the fix as soon as we can.
Also, 3.3.69.0 is the product version. The current version of the AWSSDK.Core NuGet package is 3.3.10.2.
@vellozzi Thanks so much. Have been hitting refresh ... and the update just came through on NUGET. I was successfully able to deploy my app to our staging server; it worked straight away with the updated libraries.
Really appreciate the quick response time, so: Big kudos to you and your team! 馃憤 馃憤 馃憤
No problem @JorgenSmith
The fix for this issue was released in NuGet package AWSSDK.Core 3.3.10.3.