aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.5k stars 427 forks source link

amazon q: authentication fails (ECONNREFUSED) #5869

Open 7uxifer opened 2 hours ago

7uxifer commented 2 hours ago

Problem

Steps to reproduce the issue

  1. Open VS Code
  2. Click on Amazon Q icon on bottom (or chose from the sidebar)
  3. Click "Use for Free with BuilderID"
  4. Error popup: "Webview error" with the following trace: 2024-10-25 14:36:32.891 [warning] telemetry: invalid Metric: "aws_reportPluginIssue" emitted without the result property, which is always required. Consider using .run() instead of .emit(), which will set these properties automatically. See https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md#guidelines 2024-10-25 14:38:36.457 [info] selected AWS ID sign in 2024-10-25 14:38:36.457 [info] auth: Updating connection state of 14e<--obfuscated-->5e8 to authenticating 2024-10-25 14:38:36.457 [info] codewhisperer: connection changed to authenticating: 14e<--obfuscated-->5e8 2024-10-25 14:38:36.458 [info] current client registration id=undefined expires at undefined key = 14e<--obfuscated-->5e8 2024-10-25 14:38:36.478 [error] API response (localhost /client/register): { code: 'ECONNREFUSED' } 2024-10-25 14:38:36.494 [error] API response (localhost /client/register): { code: 'ECONNREFUSED' } 2024-10-25 14:38:36.599 [error] API response (localhost /client/register): { code: 'ECONNREFUSED' } 2024-10-25 14:38:36.602 [error] ssoSetup encountered an error: Error: Failed to connect to AWS Builder ID [FailedToConnect] -> AggregateError: [ECONNREFUSED] 2024-10-25 14:38:36.602 [error] webviewId="aws.amazonq.AmazonCommonAuth": Error: Webview error -> Error: Webview backend command failed: "startCodeWhispererBuilderIdSetup()" -> Error: Failed to connect to AWS Builder ID [FailedToConnect] -> AggregateError: [ECONNREFUSED]

Expected behavior

Q connects successfully. It did this previously.

System details (run AWS: About and/or Amazon Q: About)

$ uname -a Linux horus.lycopersicum.local 6.11.4-101.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 20 15:02:40 UTC 2024 x86_64 GNU/Linux $ aws --version aws-cli/2.18.2 Python/3.12.6 Linux/6.11.4-101.fc39.x86_64 exe/x86_64.fedora.39 $ code --version 1.94.2 384ff7382de624fb94dbaf6da11977bba1ecd427 x64 Amazon Q version 1.30.0

justinmk3 commented 2 hours ago

2024-10-25 14:38:36.478 [error] API response (localhost /client/register): { code: 'ECONNREFUSED' }

That looks like a network issue. Are you behind a proxy?

justinmk3 commented 2 hours ago

If you are using vscode in any kind of "remote" scenario ("tunnel" feature, remote-ssh, devcontainer), then https://github.com/aws/aws-toolkit-vscode/pull/5847 may help. Please try the test build from https://github.com/aws/aws-toolkit-vscode/releases/tag/prerelease

7uxifer commented 2 hours ago

2024-10-25 14:38:36.478 [error] API response (localhost /client/register): { code: 'ECONNREFUSED' }

That looks like a network issue. Are you behind a proxy?

No proxy, or remote in any way. I have an open browser that connects fine to AWS, and all my accounts. the AWS plugin connects using my profile. A terminal inside VS Code can do aws sso login successfully. Other VSCode plugins work fine. Tried removing and reinstalling, no change.

7uxifer commented 2 hours ago

If you are using vscode in any kind of "remote" scenario ("tunnel" feature, remote-ssh, devcontainer), then #5847 may help. Please try the test build from https://github.com/aws/aws-toolkit-vscode/releases/tag/prerelease

I tried this build. Same error.