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.51k stars 436 forks source link

Amazon Q doesn't work with vscode tunnel: "127.0.0.1 refused to connect" #5563

Closed TPreece101 closed 2 weeks ago

TPreece101 commented 2 months ago

Problem

When I try to sign in to the Amazon Q VSCode extension via VSCode Web I get an "invalid_grant" error Screenshot 2024-09-09 at 12 03 58

And when I try to sign in when using tunnelling via the VSCode CLI the OAuth seems to try to direct me to a local URL Screenshot 2024-09-09 at 12 05 00

Steps to reproduce the issue

Expected behavior

I would expect it to work as it does when I'm just developing locally (that works fine)

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

azhar22k commented 2 months ago

I have same issue too

justinmk3 commented 3 weeks ago

@azhar22k what exact steps are you trying?

vscode tunneling should work, because the vscode extension runs in a "compute" backend (not directly in the web browser).

Proposal

Maybe we need to update our isRemoteWorkspace function: https://github.com/aws/aws-toolkit-vscode/blob/6fa3a9e554f4aa1916d01d00ea93497ca7205cc5/packages/core/src/shared/vscode/env.ts#L103-L104

based on https://github.com/microsoft/vscode/blob/aafaa182180d76bbf0d1e1cd68afa65ec6f407ea/src/vs/platform/telemetry/common/telemetryUtils.ts#L204 it looks like the possible values are:

'ssh-remote'
'dev-container',
'attached-container',
'wsl',
'tunnel',
'codespaces',
'amlext'
justinmk3 commented 2 weeks ago

https://github.com/aws/aws-toolkit-vscode/pull/5847 may fix this.

Please try the vsix from https://github.com/aws/aws-toolkit-vscode/releases/tag/prerelease

TPreece101 commented 2 weeks ago

That fixes it for me @justinmk3!

hayemaxi commented 2 weeks ago

This request was addressed in AWS Toolkit 3.30.0 and/or Amazon Q 1.31.0!

AWS Toolkit changelog: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/toolkit/CHANGELOG.md Amazon Q changelog: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/amazonq/CHANGELOG.md Release artifacts: https://github.com/aws/aws-toolkit-vscode/releases