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

Publish to AWS failed to load, shows error: Unable to start a deployment session: A task was canceled #427

Open
ratemo86 opened this issue Jun 11, 2024 · 26 comments
Labels
bug We can reproduce the issue and confirmed it is a bug. dotnet-deploy publish

Comments

@ratemo86
Copy link

ratemo86 commented Jun 11, 2024

I have been trying to publish to our staging site. The other 2 developers in my team are able to use the same set of credentials and deploy successfully. Could you advise me on how to resolve this issue?

Screenshot 2024-06-12 125235 Screenshot 2024-06-11 190014
@ratemo86 ratemo86 added the bug We can reproduce the issue and confirmed it is a bug. label Jun 11, 2024
@ScottDellinger
Copy link

I am one of the other developers @ratemo86 is referring to. We've been unable to set up his account properly. We use SSO authentication, but as you can see in the screen shot, he's got access to the resources in the AWS Explorer... but when he goes to Publish there are problems.

We've spent many hours trying to figure this out and some assistance would be most appreciated.

Thanks so much!

@awschristou
Copy link
Contributor

Hi @ratemo86 , can you please share your toolkit log from the session where you saw this issue? You can get to your logs by navigating to the Extensions / AWS Toolkit / View Toolkit Logs menu.

Also, we can try to rule out whether or not the underlying deploy tool is successfully downloaded:

  • check that %localappdata%\AWSToolkit\aws.deploy.tools \ (2019 or 2022 depending on your VS version) \ contains files. You might want to even delete that folder and re-launch Visual Studio in order to have the Toolkit attempt to re-download the tool
  • can you please check your NuGet sources, both in Visual Studio and on the command line with dotnet nuget list source ? You'll want to confirm that nuget.org (https://api.nuget.org/v3/index.json) is enabled and in your list.

@awschristou awschristou added the needs-response Waiting on additional info and feedback. Will move to `closing-soon` in 30 days label Jun 18, 2024
Copy link

This issue is missing required information and will be closed in 7 days. To keep the issue open, leave a comment.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 7 days unless further comments are made. label Jul 13, 2024
@github-actions github-actions bot added closed-for-staleness Issue closed due to staleness. and removed closing-soon This issue will automatically close in 7 days unless further comments are made. labels Jul 20, 2024
@dtechfish
Copy link

Has anyone been able to solve this? I'm having the same issue. Reinstalled VS, AWS Toolkit, rebuilt credentials, deleted toolkit folder... nothing seems to help. The AWS Extension seems to be using the credentials successfully for all other operations. Even the Legacy Publish works, but I can't get the "Publish to AWS" tool to load.

Publish to AWS GUI:
Unable to start a deployment session:
A task was canceled.

Output window: Amazon Web Services:

AWS Toolkit for Visual Studio
Toolkit Version: 1.58.0.0
Visual Studio: VS Professional 2022, Version: 17.11.3

Publish to AWS failed to load publish details using the current credentials:
Unable to start a deployment session:
A task was canceled.

Here's my log:

2024-09-16 17:07:45,366 [40] DEBUG Amazon.AWSToolkit.Publish.ViewModels.PublishToAwsDocumentViewModel - Starting a deployment session
2024-09-16 17:09:25,382 [82] ERROR Amazon.AWSToolkit.Publish.Views.PublishToAwsDocumentControl - Error refreshing publish state
Amazon.AWSToolkit.Publish.SessionException: Unable to start a deployment session:
A task was canceled. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AWS.Deploy.ServerMode.Client.RestAPIClient.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.AWSToolkit.Publish.ViewModels.DeployToolController.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.AWSToolkit.Publish.ViewModels.PublishToAwsDocumentViewModel.d__162.MoveNext()
--- End of inner exception stack trace ---
at Amazon.AWSToolkit.Publish.ViewModels.PublishToAwsDocumentViewModel.d__162.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.AWSToolkit.Publish.ViewModels.PublishToAwsDocumentViewModel.d__160.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.AWSToolkit.Publish.Views.PublishToAwsDocumentControl.d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Amazon.AWSToolkit.Publish.Views.PublishToAwsDocumentControl.d__27.MoveNext()

@nicklmiller
Copy link

@dtechfish Did you ever figure anything out for this? We are running into this exact same error, exact same exception in the logs.

@dtechfish
Copy link

dtechfish commented Nov 22, 2024 via email

@nicklmiller
Copy link

Ugh! Thanks for responding.

@awschristou awschristou changed the title Publish to AWS failed to load publish details using the current credentials: Error Publish to AWS failed to load, shows error: Unable to start a deployment session: A task was canceled Nov 27, 2024
@awschristou awschristou added publish dotnet-deploy and removed needs-response Waiting on additional info and feedback. Will move to `closing-soon` in 30 days closed-for-staleness Issue closed due to staleness. labels Nov 27, 2024
@awschristou
Copy link
Contributor

@dtechfish @nicklmiller we are interested in understanding more about this failure.

What is interesting in the logs is there seems to be a gap of about two minutes between the "Starting a deployment session" entry and the "Unable to start a deployment session: A task was canceled" entry. If this isn't consistent in your logs, please let us know.

Can you share some details about your development environment:

  • what region is selected in your AWS Explorer before you try to launch Publish to AWS? (for example, is it a region on the other side of the world, is the region a newer opt-in region, is the region in a different partition like Govcloud or China)
  • what type of credentials do you have set up? (is it a typical access key-secret key pair? is it SSO based? some other type?)

The Publish to AWS experience is powered by the AWS Deploy Tool for .NET, which is a CLI tool. If you can try to deploy the same project with that tool, it would be helpful for us to know if that deployment succeeds for you, and if it doesn't, what failure output it displays.

@awschristou awschristou reopened this Nov 27, 2024
@awschristou awschristou added the needs-response Waiting on additional info and feedback. Will move to `closing-soon` in 30 days label Nov 27, 2024
@cceccles99
Copy link

I am also seeing the same problem. The legacy tool works fine.

@nicklmiller
Copy link

@awschristou

This occurred with US West (Oregon) selected, and the computer was in Florida.

It was with an access key/secret pair.

We are actually able to open AWS Explorer and interact with the Elastic Beanstalk environment there, doing commands like rebuild and restart, but just get this error when trying to publish. You are right that it hangs for a while before the error happens.

I'll see if I can get it published via CLI.

@awschristou
Copy link
Contributor

@nicklmiller thank you for the details, looking forward to hearing about your results with the CLI.

@cceccles99 , please see #427 (comment) to share useful details that can help us diagnose the problem.

@awschristou
Copy link
Contributor

@nicklmiller how many Beanstalk environments (and applications) do you currently have in the Oregon region? Were all of those deployed through the Toolkit, or were some of them created through other means, for example using CDK, Terraform, or directly in the web console?

@github-actions github-actions bot removed the needs-response Waiting on additional info and feedback. Will move to `closing-soon` in 30 days label Dec 4, 2024
@nicklmiller
Copy link

@awschristou We have 2 applications, with 2 environments per application, all in Oregon. They were all created initially through the web console.

Additionally, I'm not sure if I mentioned this already, but publishing used to work, it just stopped one day. One thing that did change on our end was that we previously had 2 applications with only 1 environment each. I spun up an additional environment on each application, and shortly after was when the error started occurring. It could just be a coincidence, but thought I should share.

@normj
Copy link
Member

normj commented Dec 4, 2024

@nicklmiller Any chance you have the toolkit configured to use a proxy? Toolkit proxies are configured in the Tools -> Options - AWS Toolkit menu. Or are there any proxies setup in your network environment?

@cceccles99
Copy link

@nicklmiller thank you for the details, looking forward to hearing about your results with the CLI.

@cceccles99 , please see #427 (comment) to share useful details that can help us diagnose the problem.

I was using London region with access from the UK (about 250 miles from London).
I'm using SSO with EntraId.
There are 6 beanstalk environments.
Also I noticed that it seems to be some kind of timeout as there is a delay of about 1 minute 40 seconds with nothing happening before the error message appears.
If I use the legacy tool with the same credentials it works with no problems.

@normj
Copy link
Member

normj commented Jan 23, 2025

@cceccles99 Can you confirm if you have a proxy configured in the toolkit or anywhere else in your networking environment? A timeout seems likely and I'm wondering if we are skipping a proxy when making service requests.

@cceccles99
Copy link

cceccles99 commented Jan 23, 2025 via email

@dtechfish
Copy link

dtechfish commented Jan 23, 2025 via email

@cceccles99
Copy link

cceccles99 commented Jan 23, 2025 via email

@nicklmiller
Copy link

@cceccles99 That sort of matches my experience. It stopped working around the time I added a second EBS application.

@normj
Copy link
Member

normj commented Jan 24, 2025

And these were all Elastic Beanstalk applications deployed with this newer deployment tooling or the legacy wizard?

@nicklmiller
Copy link

My applications and environments were all created through the web console, but all publishing was done with the new tooling.

@normj
Copy link
Member

normj commented Jan 25, 2025

While you are waiting for it to timeout can you see if in your task manager you have a dotnet-aws.exe process running?

@cceccles99
Copy link

cceccles99 commented Jan 27, 2025 via email

@normj
Copy link
Member

normj commented Jan 29, 2025

@cceccles99 Same question I asked @nicklmiller, do you see the dotnet-aws.exe process running in the task manager while you are waiting for the timeout?

@Reynolds80
Copy link

Reynolds80 commented Feb 10, 2025

I have had this same issue multiple times, I have never got to the bottom of it. I've had to use the "Deploy to Elastic Beanstalk (Legacy)" option. After a few weeks the new version suddenly works again, have no clue why. And the cycle continues.

Would love to know what the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug. dotnet-deploy publish
Projects
None yet
Development

No branches or pull requests

8 participants