Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ElasticBeanstalk tools different response to "Unable to find credentials" between 3.0.0 and 3.0.1 #53

Open
JessePerry opened this issue Jan 13, 2019 · 2 comments
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued

Comments

@JessePerry
Copy link

I'm playing with Elastic Beanstalk for the first time and tried to mistakenly run the deploy command before setting up the AWS credentials.

On Amazon.ElasticBeanstalk.Tools --version 3.0.0 if you try to run the deploy command immediately after installing:
dotnet eb deploy-environment --publish-options "--runtime win-x64"
Then answer the prompts for Application Name, Environment, and Region. You get a message and 3 exceptions:

Unknown error executing command: Unable to find credentials

Exception 1 of 3:
Amazon.Runtime.AmazonClientException: Unable to find the 'default' profile in CredentialProfileStoreChain.
   at Amazon.Runtime.FallbackCredentialsFactory.GetAWSCredentials(ICredentialProfileSource source)
   at Amazon.Runtime.FallbackCredentialsFactory.GetCredentials(Boolean fallbackToAnonymous)

Exception 2 of 3:
System.InvalidOperationException: The environment variables AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN were not set with AWS credentials.

Exception 3 of 3:
System.Net.Http.HttpRequestException: No route to host ---> System.Net.Sockets.SocketException: No route to host

This is great and informative! But not the same for v 3.0.1.

Doing the same thing command without setting up AWS creds with Amazon.ElasticBeanstalk.Tools --version 3.0.1 results in this:

Unknown error executing command: Host is down
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at System.Net.Http.HttpClient.GetStringAsyncCore(Task`1 getTask)
   at Amazon.Runtime.Internal.Util.AsyncHelpers.<>c__DisplayClass1_1`1.<<RunSync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Amazon.Runtime.Internal.Util.AsyncHelpers.ExclusiveSynchronizationContext.BeginMessageLoop()
   at Amazon.Runtime.Internal.Util.AsyncHelpers.RunSync[T](Func`1 task)
   at Amazon.Util.AWSSDKUtils.DownloadStringContent(Uri uri, TimeSpan timeout, IWebProxy proxy)
   at Amazon.Util.EC2InstanceMetadata.GetItems(String relativeOrAbsolutePath, Int32 tries, Boolean slurp)
   at Amazon.Util.EC2InstanceMetadata.get_IAMSecurityCredentials()
   at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.FetchCredentials()
   at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentials()
   at Amazon.Runtime.DefaultInstanceProfileAWSCredentials.GetCredentialsAsync()
   at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)
   at Amazon.ElasticBeanstalk.Tools.Commands.DeployEnvironmentCommand.DoesApplicationExist(String applicationName) in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.ElasticBeanstalk.Tools\Commands\DeployEnvironmentCommand.cs:line 414
   at Amazon.ElasticBeanstalk.Tools.Commands.DeployEnvironmentCommand.PerformActionAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.ElasticBeanstalk.Tools\Commands\DeployEnvironmentCommand.cs:line 104
   at Amazon.Common.DotNetCli.Tools.Commands.BaseCommand`1.ExecuteAsync() in E:\JenkinsWorkspaces\aws-extensions-for-dotnet-cli\src\Amazon.Common.DotNetCli.Tools\Commands\BaseCommand.cs:line 44

Which is misleading. You can see in the exception itself that get_IAMSecurityCredentials is a source for the exception, but what happened to the helpful message in 3.0.0? Unable to find credentials?
I also think an instruction to set up the AWS keys/creds would be welcome in the readme.md

@klaytaybai klaytaybai added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Jan 16, 2019
@jpedryc
Copy link

jpedryc commented Sep 1, 2019

Playing for the first time with dotnet core - just had the above issue. More information in Readme would be welcome.

@klaytaybai klaytaybai removed the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Feb 24, 2020
@ashishdhingra ashishdhingra added feature-request A feature should be added or improved. module/cli-ext needs-triage This issue or PR still needs to be triaged. labels Aug 7, 2020
@github-actions
Copy link

github-actions bot commented Aug 8, 2021

We have noticed this issue has not recieved attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 8, 2021
@ashishdhingra ashishdhingra added needs-review and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 10, 2021
@ashishdhingra ashishdhingra removed the needs-triage This issue or PR still needs to be triaged. label Sep 24, 2021
@hunanniu hunanniu added the A label Mar 31, 2022
@ashishdhingra ashishdhingra added p2 This is a standard priority issue and removed A labels Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/cli-ext p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

5 participants