This is a migrated thread and some comments may be shown as answers.

AWSProfilesLocation in appSettings breaks CloudUpload

2 Answers 262 Views
CloudUpload
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 07 Jul 2020, 04:16 PM

I have been trying to diagnose some annoying intermittent errors I see thrown by AWSSDK, which include it trying to locate my AWSSDK profile/credentials files.
I used this guide to create them:  https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html

To fix this, I created the profiles and credentials in a flat file and put references to them in <appSettings>:
<add key="AWSProfilesLocation" value="C:\Users\Administrator\.aws\credentials" />
<add key="AWSProfileName" value="default" />
<add key="AWSAccessKey" value="ABC123" />
<add key="AWSSecretKey" value="DEFG6789" />
<add key="AWSBucketName" value="media.mysite.com" />


This addition works well in projects I use that do not have CloudUploaders, such as WebAPIs and services. Unfortunately, if I add these lines to a project with CloudUploader, it makes it so the uploader barks on every single upload, as if all files are invalidated or errored when attempting to select one. The project doesn't spit out a useful error so I'm not 100% sure whats happening.

2 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 07 Jul 2020, 06:29 PM
For reference the error(s) I was getting that caused me to dive down this rabbit hole were:

System.IO.__Error.WinIOError
POST-/telerik.web.ui.webresource.axd
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\system32\config\systemprofile\.aws\credentials'.
at System.IO.__Error.WinIOError
at System.IO.FileStream.Init
at System.IO.FileStream..ctor
at System.IO.StreamReader..ctor
at System.IO.File.InternalReadAllText
at System.IO.File.ReadAllText
at Amazon.Runtime.Internal.Util.OptimisticLockedTextFile.Read
at System.IO.__Error.WinIOError
at System.IO.FileStream.Init
at System.IO.FileStream..ctor
at System.IO.StreamReader..ctor
at System.IO.File.InternalReadAllText
at System.IO.File.ReadAllText
at Amazon.Runtime.Internal.Util.OptimisticLockedTextFile.Read
0
Peter Milchev
Telerik team
answered on 10 Jul 2020, 12:44 PM

Hello Alex,

The first thing that I can see is that you set C:\users\administrator while the error is trying to read C:\Windows\system32\config\systemprofile\ folder for the credentials. 

You can see that there is an open issue for the AWS SDK in github with the same error:

There are some other links addressing similar issue that might be fixed with a later version of the SDK:

Please check how an upgrade of the Amazon SDK would affect the scenario.

Regards,
Peter Milchev
Progress Telerik

Tags
CloudUpload
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or