2017-03-21 19 views
1

Ich habe diesen Fehler nach dem Aktualisieren des SDK-Kerns auf Version 3.3.10.2 in meiner Produktionsumgebung gestartet. Ich stelle eine .net API auf 4 ec2 Instanzen in einem Load Balancer bereit. Alle Windows Server 2012 R2.AmazonServiceException: Anmeldeinformationen konnten nicht gefunden werden

Der seltsame Teil, und wirklich der Teil, der mich verrückt macht, ist die Anwendung läuft ohne Problem, wenn ich es in VS 2015 debuggen und es läuft gut, wenn ich die Anwendung auf meinem lokalen IIS veröffentlichen. Wenn ich die Anwendung auf einer unserer Produktionsmaschinen bereitstellen, tritt der Fehler auf.

Ich verwende:

<add key="AWSProfileName" value="{profile name}" /> 
<add key="AWSProfilesLocation" value="{file location}" /> 

zusammen mit einem Berechtigungsnachweis-Datei mit den entsprechenden Daten enthält.

Bevor jemand fragt, hat diese Anwendung für die letzten 6 Monate in genau dieser Konfiguration mit AWS S3 und Null Fehler in Bezug auf Anmeldeinformationen oder etwas ähnliches gearbeitet.

Was schlimmer ist, ist, dass, selbst wenn ich versuche, die aws sdk zurück auf eine andere Version zurückzusetzen, der Fehler weiterhin besteht. Ich habe absolut keine Ahnung, woher der Fehler kam oder wie er behoben wurde. Bitte helfen Sie. Hier

ist der Stack-Trace:

[AmazonServiceException: 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.<Reset>b__8_0() 
    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.<Reset>b__8_2() 
    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.<GetAvailableRoles>d__10.MoveNext() 
    at Amazon.Runtime.InstanceProfileAWSCredentials.GetFirstRole() 
    at Amazon.Runtime.FallbackCredentialsFactory.ECSEC2CredentialsWrapper() 
    at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous) 

] 
    Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous) +718 
    Amazon.S3.AmazonS3Client..ctor(RegionEndpoint region) +59 
    MGX_2.Models.S3Connection.Read() +83 
    MGX_2.Models.S3Connection.ReadToString(String k) +43 
    MGX_2.MgxConfig.Update() +118 
    MGX_2.MgxConfig.Init() +11 
    MGX_2.WebApiApplication.Application_Start() +302 

[HttpException (0x80004005): 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.<Reset>b__8_0() 
    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.<Reset>b__8_2() 
    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.<GetAvailableRoles>d__10.MoveNext() 
    at Amazon.Runtime.InstanceProfileAWSCredentials.GetFirstRole() 
    at Amazon.Runtime.FallbackCredentialsFactory.ECSEC2CredentialsWrapper() 
    at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous) 

] 
    System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +544 
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186 
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172 
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402 
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343 

[HttpException (0x80004005): 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.<Reset>b__8_0() 
    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.<Reset>b__8_2() 
    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.<GetAvailableRoles>d__10.MoveNext() 
    at Amazon.Runtime.InstanceProfileAWSCredentials.GetFirstRole() 
    at Amazon.Runtime.FallbackCredentialsFactory.ECSEC2CredentialsWrapper() 
    at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous) 

] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712 

Antwort

1

Das war also offenbar ein Fehler in der AWSSDK. Nach dem Update 3.3.10.3 ist das Problem nicht mehr vorhanden. Danke für die zahlreichen Antworten!

Verwandte Themen