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

Signing in using Lightspeed fails when VS Code is running remotely #938

Closed
l0rd opened this issue Jul 3, 2023 · 18 comments
Closed

Signing in using Lightspeed fails when VS Code is running remotely #938

l0rd opened this issue Jul 3, 2023 · 18 comments
Assignees
Labels
bug Something isn't working

Comments

@l0rd
Copy link

l0rd commented Jul 3, 2023

Summary

After installing the extension, when I click on the "Connect" button I am redirected to local URI (vscode://redhat.ansible or checode://redhat.ansible) but I would expect to be redirected to VS Code URL instead.

The problem can be reproduced using OpenShift Dev Spaces using Red Hat Developer Sandbox (https://workspaces.openshift.com) or GitHub Codespaces.

2023-07-03 15 54 36

Extension version

v2.4.78

VS Code version

insiders

Ansible Version

N/A

OS / Environment

N/A

Relevant log output

No response

@l0rd l0rd added bug Something isn't working new labels Jul 3, 2023
@debaser19
Copy link

Also having the same issue. Might be proxy related

VSCode 1.79.2
Ansible Extension 2.4.78

2023-07-06 12:30:46.164 [error] [Extension Host] [ansible-lightspeed-oauth] error message: Request failed with status code 407
2023-07-06 12:30:46.165 [error] [Extension Host] [ansible-lightspeed-oauth] Ansible Lightspeed sign in failed: Error: An unexpected error occurred

@l0rd
Copy link
Author

l0rd commented Jul 12, 2023

Might be proxy related

Not in my case. I am not running behind a proxy when I reproduce the error.

@smseidl
Copy link

smseidl commented Jul 23, 2023

I'm having the same issue trying to use Lightspeed from Github Codespace. I get prompted to open in my local VSCode and the CodeSpace just keeps waiting for the response but it never gets it.

@priyamsahoo
Copy link
Contributor

Try out the latest version and let us know if it is fixed or not.

@priyamsahoo priyamsahoo removed the new label Aug 2, 2023
@debaser19
Copy link

Try out the latest version and let us know if it is fixed or not.

Using 2.6.92 but still doesn't work. Goes through the flow, waits 60s, then cancels.

I don't get the same error as I posted in my last reply though. Only relevant log is the timeout after 60s

@l0rd
Copy link
Author

l0rd commented Aug 2, 2023

Try out the latest version and let us know if it is fixed or not.

Thank you @priyamsahoo, can you share the PR that would have fixed this (I have not tested yet)?

@l0rd
Copy link
Author

l0rd commented Aug 3, 2023

@priyamsahoo I have tested with version v2.6.92 and the problem is still there.

@debuglevel
Copy link

For me, Ansible Lightspeed redirected to a vscode:// URL which is of course handled by my desktop installation of VS Code.

@cedriccastagnede
Copy link

Having the same issue here:

output[windows]:
[error] [Extension Host] Ansible Lightspeed authentication failed.

$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.2 (Plow)

$ code -v
1.81.1
6c3e3dba23e8fadc360aed75ce363ba185c49794
x64

$ xdg-mime query default x-scheme-handler/vscode
code-url-handler.desktop

$ env | grep -E "DBUS|SSH_TTY|SSH_AUTH_SOCK|DISPLAY|SESSION" | sort
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=localhost:11.0
SSH_AUTH_SOCK=/tmp/ssh-XXXXYljYoL/agent.22041
SSH_TTY=/dev/pts/1
XDG_SESSION_CLASS=user
XDG_SESSION_ID=29
XDG_SESSION_TYPE=tty

@TamiTakamiya
Copy link
Collaborator

Sent PR #1012 for review. Note that changes on Lightspeed server are also required for making this work. A PoC code was tested with:

  1. GitHub Codespaces
  2. Red Hat Openshift Dev Spaces
  3. code-server running on localhost

and I found the code worked with 1 (Codespaces) and 3 (code-server), but 2 (Dev Spaces) failed with a 404 error. I have opened a request against Dev Spaces on that issue.

@RomanNikitenko
Copy link

is this issue fixed by che-incubator/che-code#319?

@svor
Copy link

svor commented Jan 11, 2024

@TamiTakamiya do I understand correct that we need Ansible extension with these changes: #1012 to have Ansible Lightspeed on Dev Spaces?

When can we expect that new version of Ansible extension will be published on opensx.org?

@TamiTakamiya
Copy link
Collaborator

@svor #1012 requires corresponding changes on the server side. Currently our staging server contains those changes, but the production server at https://c.ai.ansible.redhat.com/ has not been updated yet. We are planning to update it soon and will publish the updated extension once it's done. Hopefully it will happen within a week. Thanks!

@TamiTakamiya
Copy link
Collaborator

A new version (v2.10.130) of Ansible VS Code Extension was published to Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=redhat.ansible

This contains the changes required to have Lightspeed on Dev Spaces, but a change is also required on Dev Spaces to use it. On GitHub Codespaces, the OAuth2 Authorization flow works w/o additional changes.

@svor
Copy link

svor commented Jan 23, 2024

@TamiTakamiya thanks for updates

@svor
Copy link

svor commented Jan 26, 2024

@TamiTakamiya
Copy link
Collaborator

@svor Thank you for your updates. I am going to close this issue.

@craig-br
Copy link

Hi @svor @TamiTakamiya . Currently, the solution only works for Dev Spaces instances hosted at developers.redhat.com. On-premise Dev Spaces support is being worked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

10 participants