When trying to call the AmazonS3Client constructor I receive a crash saying "Access to the path 'C:WINDOWSsystem32configsystemprofile' is denied."
When manually adding persmission to the IIS User on the folder, the crash does not happen.
I run with nuget AWSSDK.S3 package version 3.3.110.29 on a .net core project.
I run on Windows 10 through IIS.
This does not happen on production when running on Windows Server.
Any help please?
I have the same issue.
It seems that running on IIS with ApplicationPoolIdentity does not have permission for that location.
I also use the constructor specifying the AccessKey, secret and region. Why does this constructor go to this folder?
This issue occurs on 3.3.110.x but not on 3.3.109.x or earlier versions.
I'm using dotnet core 3.1
I have the same issue with AWSSDK.S3 version 3.3.110.50.
Error message:
System.TypeInitializationException: The type initializer for 'Amazon.Runtime.Internal.FallbackInternalConfigurationFactory' threw an exception.
---> System.TypeInitializationException: The type initializer for 'Amazon.Runtime.Internal.Settings.PersistenceManager' threw an exception.
---> System.UnauthorizedAccessException: Access to the path 'C:Windowssystem32configsystemprofile' is denied.
at System.IO.FileSystem.CreateDirectory(String fullPath, Byte[] securityDescriptor)
at System.IO.Directory.CreateDirectory(String path)
at Amazon.Runtime.Internal.Settings.PersistenceManager..cctor()
--- End of inner exception stack trace ---
at Amazon.Runtime.Internal.Settings.PersistenceManager.get_Instance()
at Amazon.Util.Internal.SettingsManager.GetSettings()
at Amazon.Util.Internal.SettingsManager.TryGetObjectByProperty(String propertyName, String value, String& uniqueKey, Dictionary2& properties)
at Amazon.Util.Internal.NamedSettingsManager.TryGetObject(String displayName, String& uniqueKey, Dictionary2& properties)
at Amazon.Runtime.CredentialManagement.NetSDKCredentialsFile.TryGetProfile(String profileName, CredentialProfile& profile)
at Amazon.Runtime.CredentialManagement.CredentialProfileStoreChain.TryGetProfile(String profileName, CredentialProfile& profile)
at Amazon.Runtime.Internal.ProfileInternalConfiguration.Setup(ICredentialProfileSource source, String profileName)
at Amazon.Runtime.Internal.ProfileInternalConfiguration..ctor(ICredentialProfileSource source)
at Amazon.Runtime.Internal.FallbackInternalConfigurationFactory.Reset()
at Amazon.Runtime.Internal.FallbackInternalConfigurationFactory..cctor()
--- End of inner exception stack trace ---
at Amazon.Runtime.Internal.FallbackInternalConfigurationFactory.get_RetryMode()
at Amazon.Runtime.ClientConfig.get_RetryMode()
at Amazon.Runtime.AmazonServiceClient.BuildRuntimePipeline()
at Amazon.Runtime.AmazonServiceClient..ctor(AWSCredentials credentials, ClientConfig config)
at Amazon.Runtime.AmazonServiceClient..ctor(String awsAccessKeyId, String awsSecretAccessKey, ClientConfig config)
at Amazon.S3.AmazonS3Client..ctor(String awsAccessKeyId, String awsSecretAccessKey, AmazonS3Config clientConfig)
at AmazonStorage.AmazonStorageService.GetAmazonS3Client()
I'm using .NET Core 3.1.
Are there any workarounds for this issue?
Thank you!
Just for reference, this is the code that I'm using:
var amazonS3Config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1
};
var amazonClient = new AmazonS3Client(_options.AwsAccessKeyId, _options.AwsSecretAccess, amazonS3Config)
I have the same issue, getting this error though I am manually inputting the credentials to the clients constructor
using (var client = new AmazonS3Client("XXXXX", "XXXXX", RegionEndpoint.smth))
System.TypeInitializationException: 'The type initializer for 'Amazon.Runtime.Internal.FallbackInternalConfigurationFactory' threw an exception.'
UnauthorizedAccessException: Access to the path 'C:WINDOWSsystem32configsystemprofile' is denied.
Also running into this issue.
Hi @nomz0101,
Good morning.
As noted in the issue #1490, the issue should be fixed in the latest AWS .NET SDK version. Please upgrade to the latest AWS .NET SDK version and confirm if the issue is now resolved for you.
Thanks,
Ashish