Skip to content

Launching Developer Sandbox feature does not work #2474

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

Closed
worldofgeese opened this issue Jul 13, 2022 · 33 comments · Fixed by #2511
Closed

Launching Developer Sandbox feature does not work #2474

worldofgeese opened this issue Jul 13, 2022 · 33 comments · Fixed by #2511
Milestone

Comments

@worldofgeese
Copy link

worldofgeese commented Jul 13, 2022

I installed the OpenShift Connector today. If I navigate to the OpenShift extension icon, then Add OpenShift Cluster, then Start your OpenShift experience, I receive a "Detecting Authentication Session" message with a spinning widget that never resolves.

This is on Windows 11. I have tried both inside and outside a WSL session.

Screenshots of flow attached:
2022-07-13_14h55_40
2022-07-13_14h56_04
2022-07-13_14h55_26
image

@dgolovin
Copy link
Collaborator

@worldofgeese thank you for reporting this issue. Could you run

image

and attach error log to the issue? There should be plenty of error not related to the extension. Please look for entries where 'redhat' is part of filename in stacktrace.

@worldofgeese
Copy link
Author

@dgolovin hi there.

I opened DevTools, navigated to Console and observed output as I went through the steps outlined in my first comment. First there's a print out of my kubeconfig which I won't repeat here then this error:

console.ts:137 [Extension Host] rejected promise not handled within 1 second: Timed out waiting for authentication provider to register
D @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:455
_invokeHandler @ rpcProtocol.ts:440
_receiveRequest @ rpcProtocol.ts:370
_receiveOneMessage @ rpcProtocol.ts:296
(anonymous) @ rpcProtocol.ts:161
invoke @ event.ts:572
deliver @ event.ts:774
fire @ event.ts:735
fire @ ipc.net.ts:638
_receiveMessage @ ipc.net.ts:959
(anonymous) @ ipc.net.ts:832
invoke @ event.ts:572
deliver @ event.ts:774
fire @ event.ts:735
acceptChunk @ ipc.net.ts:382
(anonymous) @ ipc.net.ts:338
(anonymous) @ browserSocketFactory.ts:230
invoke @ event.ts:572
deliver @ event.ts:774
fire @ event.ts:735
_fileReader.onload @ browserSocketFactory.ts:91
log.ts:313   ERR Timed out waiting for authentication provider to register

Am I missing a bit of a log somewhere? This is all I was able to observe. I have web connectivity from the rest of VS Code whether I am in a WSL session or not so this doesn't appear to be an issue of DNS.

@dgolovin
Copy link
Collaborator

@worldofgeese thank you for info.The problem is that VSCode API call to get auth session never resolves. That could be Windows 11 related issue. I'll add timeout and error handling to see what is going on. Will also find Windows 11 host to test.

@mohitsuman mohitsuman added this to the 0.6.0 milestone Jul 20, 2022
@dgolovin
Copy link
Collaborator

dgolovin commented Aug 9, 2022

@worldofgeese I have tested this on Windows 11 and the only way I can replicate is when I let vscode open authentication page in browser and then just close it and do nothing. In this case call to vscode auth API never returns until I restart vscode. This is known behavior and nothing can be done about that at this point. There is no API to end stalled auth API requests.

@worldofgeese
Copy link
Author

worldofgeese commented Aug 9, 2022

I can make a screencast of my flow for you so you can compare if the behavior on my system is different from your own?

Would that be helpful?

@mohitsuman
Copy link
Collaborator

@worldofgeese if you can share the screencast, we can refer to which step it is failing and if there is no workaround we would add information to users so that it becomes easy for them. So please share the screencast if possible for you.

@worldofgeese
Copy link
Author

2022-08-09_12h36_21

@worldofgeese
Copy link
Author

This isn't really helpful and I apologize but this is everything I get. No browser window ever opens to continue auth.

@worldofgeese
Copy link
Author

I should mention too that behavior is the same across both WSL and non-WSL sessions of VS Code.

@dgolovin
Copy link
Collaborator

@worldofgeese it is helpful, thank you for your time spent to report this. I see the error about waiting for authentication provider time out to register. Will try to figure out why this is happening and add appropriate error reporting if possible.

@dgolovin
Copy link
Collaborator

@worldofgeese I traced that error to authenticationService.ts#L685. Extension that registers authentication provider for Red Hat implemented the way it is recomended by Microsoft, so this problem should never be happening, but it is.

I wonder if the same issue affects other authentication providers. Could you please check if github authentication provider works for you? Just try to use Git: Clone from palette
image
then select 'Clone from Github'
image
and follow the workflow until you see list of your repositories from Github.

@dgolovin
Copy link
Collaborator

@worldofgeese is there anything relevant in Red Hat Authentication output channel?
image

@worldofgeese
Copy link
Author

I wonder if the same issue affects other authentication providers. Could you please check if github authentication provider works for you? Just try to use Git: Clone from palette

@dgolovin I can confirm I am able to authenticate to GitHub successfully through the command palette.

is there anything relevant in Red Hat Authentication output channel?

Where can I find this? This is what my integrated terminal looks like in VS Code

2022-08-17_11h19_11

@dgolovin
Copy link
Collaborator

@worldofgeese thanks for verifying github auth provider. At this point I am just trying to understand if that affects all auth providers or only Red Hat one. It seems to affect only Red Hat one.

On your screenshot Terminal view is active, to see Red Hat authentication output, select Output view (second item on the left from Terminal) and then select Red Hat Authentication from combo on the right side of the Output view.

@worldofgeese
Copy link
Author

worldofgeese commented Aug 18, 2022

@dgolovin oh there is no Red Hat Authentication output. Here you can see what Tasks are available:

2022-08-18_22h12_57

@dgolovin
Copy link
Collaborator

@worldofgeese that means Red Hat Authentication Extension is not installed. I think I know why. Could you please install it and see if that fixes the issue. You need to close the opened Add OpenShift Cluster after after Red Hat Authentication Extension installed and open it again to test.

dgolovin added a commit to dgolovin/vscode-openshift-tools that referenced this issue Aug 19, 2022
dgolovin added a commit that referenced this issue Aug 19, 2022
@dgolovin dgolovin reopened this Aug 19, 2022
@dgolovin
Copy link
Collaborator

@worldofgeese unfortunately, steps above won't help. Because even if Red Hat Authentication installed it is not going to be activated in this use case.

To activate it you need to:

  • open file %USERPROFILE%\.vscode\extensions\redhat.vscode-openshift-connector-0.5.0-win32-x86/package,json
  • find line in the very end of the file with "extensionDependencies":
  • modify it to look like this
		"redhat.vscode-redhat-account",
                 "ms-kubernetes-tools.vscode-kubernetes-tools"
	],
  • save the file and restart vscode

@dgolovin
Copy link
Collaborator

Verified latest build from main branch. it works as expected. Fix is going to be released in v0.6.0.
It would be impossible to fix without help from @worldofgeese. Thank you!

@worldofgeese
Copy link
Author

@dgolovin hey glad I can be of service 😄. Your fix does indeed allow me to auth to a following challenge screen that requires a SMS code. I receive the SMS code to my number however Connector never requests it, instead timing out.

Here is a GIF showing the flow with a fake number entered:

2022-08-19_10h27_09

@dgolovin
Copy link
Collaborator

@worldofgeese I opened new issue for this one #2514

@mohitsuman
Copy link
Collaborator

@worldofgeese Thanks for helping us to make the extension better and workflow smoother. The extension version 0.6.0 is released in Marketplace, can you please and see if the scenarios work for you.

https://marketplace.visualstudio.com/items?itemName=redhat.vscode-openshift-connector

@worldofgeese
Copy link
Author

worldofgeese commented Aug 25, 2022

@mohitsuman I can confirm it works! I am able to log in, pass the SMS challenge, and create a cluster all through the extension. However, some buttons and fields don't appear to be compatible with my dark theme, Dracula. See examples below:

2022-08-25_21h01_29
2022-08-25_21h02_10
2022-08-25_21h02_40

@worldofgeese
Copy link
Author

worldofgeese commented Aug 26, 2022

I appear to be encountering more errors as I only tested up until the Login to Sandbox action. Today, when I copied the oc login command from my OpenShift cluster dashboard and then pressed Login to Sandbox I received the following error:

2022-08-26_12h45_47

I tried this twice without success. I also disabled my VPN the second time.

@dgolovin
Copy link
Collaborator

dgolovin commented Aug 27, 2022

@worldofgeese could you copy login command from console dashboard again, and run it in cmd or powershell with 'oc' replaced to line

"C:\Users\Tao Hansen\.vscode\extensions\redhat.vscode-openshift-connector-0.6.0-win32-x64\out\tools\oc.exe"

keep double quotes (because you have space in your profile location).
Let me know what is the output. Thanks!

@worldofgeese
Copy link
Author

worldofgeese commented Aug 30, 2022

@dgolovin I needed to alter the path and quotes a bit to get it working but it does log me in:

C:\Users\'Tao Hansen'\.vscode\extensions\redhat.vscode-openshift-connector-0.6.0-win32-x64\out\tools\win32\oc.exe login --token=$TOKEN --server=https://api.sandbox.x8i5.p1.openshiftapps.com:6443
Logged into "https://api.sandbox.x8i5.p1.openshiftapps.com:6443" as "worldofgeese" using the token provided.

You have one project on this server: "worldofgeese-dev"

Using project "worldofgeese-dev".

@worldofgeese
Copy link
Author

@dgolovin have you had a chance to look at this since? I can log in from the CLI but not the extension

@mohitsuman
Copy link
Collaborator

@mohitsuman I can confirm it works! I am able to log in, pass the SMS challenge, and create a cluster all through the extension. However, some buttons and fields don't appear to be compatible with my dark theme, Dracula. See examples below:

2022-08-25_21h01_29 2022-08-25_21h02_10 2022-08-25_21h02_40

@worldofgeese We have fixed the compatibility of the phone number drop-down in alignment with vscode themes. This will be there in the 0.7.0 release coming out on 26 Sept.

@worldofgeese
Copy link
Author

@mohitsuman I have discovered a new issue when copying my login command code. Please see my comments above for details.

@dgolovin
Copy link
Collaborator

@worldofgeese just did the test with space in user name.

  1. I cannot replicate it on windows
  2. When I use command the same way you do (wrapping name with ') it does not work in cmd or powershell. They both interpret space in name the same way and decide the line before the space is a command to run and it could not be found obviously.

Am I missing something? Are you running exact the same command you posted above without surrounding oc.exe path with double quotes?

@dgolovin
Copy link
Collaborator

Does it work when you run it like this? What is the output?

"C:\Users\Tao Hansen\.vscode\extensions\redhat.vscode-openshift-connector-0.6.0-win32-x64\out\tools\win32\oc.exe" login --token=$TOKEN --server=https://api.sandbox.x8i5.p1.openshiftapps.com:6443

That is exactly how it is executed in vscode.

@worldofgeese
Copy link
Author

worldofgeese commented Sep 24, 2022

Does it work when you run it like this? What is the output?

@dgolovin if I run it exactly as you've formatted (whether with $TOKEN literally or with the actual sha256-~... token string) I receive:

"C:\Users\Tao Hansen\.vscode\extensions\redhat.vscode-openshift-connector-0.6.0-win32-x64\out\tools\win32\oc.exe" login --token=$TOKEN --server=https://api.sandbox.x8i5.p1.openshiftapps.com:6443
At line:1 char:115
+ ... shift-connector-0.6.0-win32-x64\out\tools\win32\oc.exe" login --token ...
+                                                             ~~~~~
Unexpected token 'login' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

Are you running exact the same command you posted above without surrounding oc.exe path with double quotes?

Yes, exactly just with $TOKEN replaced by my token like so: C:\Users\'Tao Hansen'\.vscode\extensions\redhat.vscode-openshift-connector-0.6.0-win32-x64\out\tools\win32\oc.exe login --token=sha256~g9an106ysaoblahblahblah --server=https://api.sandbox.x8i5.p1.openshiftapps.com:6443

I just tested again and my formatted command exactly as I've described works:

Logged into "https://api.sandbox.x8i5.p1.openshiftapps.com:6443" as "worldofgeese" using the token provided.

You have one project on this server: "worldofgeese-dev"

@mohitsuman mohitsuman reopened this Sep 24, 2022
@worldofgeese
Copy link
Author

I will be away on meditation retreat for ten days and unreachable 🧘‍♂️

@worldofgeese
Copy link
Author

With OpenShift Toolkit version 0.7.0 I am now able to successfully create and login to a Developer Sandbox cluster entirely through the extension-driven flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants