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

Q: login fails if endpoint_url is set in [default] profile of ~/.aws/config #6299

Open
tyrsday29 opened this issue Jan 2, 2025 · 1 comment
Labels
auth-credentials authentication, authorization, credentials, AWS Builder ID, sso bug We can reproduce the issue and confirmed it is a bug.

Comments

@tyrsday29
Copy link

tyrsday29 commented Jan 2, 2025

Problem

Hi! Seemed to have figured out the issue and brining it to your attention!

The Error is in Amazon Q extension for vscode. Logging in with the free tier seems to use the default endpoint_url from the .aws config file if one is set, which results in an error opening the web view client, this seemed to be the most relevant general one:

[error] webviewId="aws.amazonq.AmazonCommonAuth": Error: Webview error -> Error: Webview backend command failed: "startCodeWhispererBuilderIdSetup()" -> Error: Failed to connect to AWS Builder ID [FailedToConnect] -> SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Installed AWS Q in vscode and attempted to try it out via the free tier. Received errrors immediately, as the webview client did not open. After a while of perusing the error messages, I finally realized one of the links in the message looked familiar- It was a reaching out to an api via my default endpoint_url from the .aws config file, though constructing it with the normal paths. Upon removing the config setting and reinstalling the extension, (a likely more secure setting in hindsight, but still inconvenient) the error disappeared.

Steps to reproduce the issue

Expected behavior

Opens the webview client to create builder ID

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

  • OS: Windows
  • Visual Studio Code version: newest
  • AWS Toolkit version: newest
  • Amazon Q version :newest
@tyrsday29 tyrsday29 added the bug We can reproduce the issue and confirmed it is a bug. label Jan 2, 2025
@justinmk3 justinmk3 added the auth-credentials authentication, authorization, credentials, AWS Builder ID, sso label Jan 23, 2025
@justinmk3
Copy link
Contributor

Logging in with the free tier seems to use the default endpoint_url from the .aws config file if one is set

Thanks for reporting this. We will definitely handle this better.

@justinmk3 justinmk3 changed the title Error when logging into free tier of AWS Q if default login url set in config file Q: login fails if endpoint_url is set in [default] profile of ~/.aws/config Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth-credentials authentication, authorization, credentials, AWS Builder ID, sso bug We can reproduce the issue and confirmed it is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants