-
Notifications
You must be signed in to change notification settings - Fork 15
Ask for local app fallback when Timed out while waiting for handshake
#20
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -565,6 +565,7 @@ export default class RemoteConnector extends Disposable { | |
}).connect({ | ||
host: sshDestInfo.hostName, | ||
username: sshDestInfo.user, | ||
readyTimeout: 40000, | ||
authHandler(_methodsLeft, _partialSuccess, _callback) { | ||
return { | ||
type: 'password', | ||
|
@@ -786,7 +787,7 @@ export default class RemoteConnector extends Disposable { | |
|
||
// Only use experiment for SaaS | ||
const forceUseLocalApp = getServiceURL(params.gitpodHost) === 'https://gitpod.io' | ||
? (await this.experiments.get<boolean>('gitpod.remote.useLocalApp', session.account.id))! | ||
? (await this.experiments.get<boolean>('gitpod.remote.useLocalApp', session.account.id, { gitpodHost: params.gitpodHost }))! | ||
jeanp413 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
: vscode.workspace.getConfiguration('gitpod').get<boolean>('remote.useLocalApp')!; | ||
const userOverride = isUserOverrideSetting('gitpod.remote.useLocalApp'); | ||
let sshDestination: string | undefined; | ||
|
@@ -806,8 +807,22 @@ export default class RemoteConnector extends Disposable { | |
this.telemetry.sendRawTelemetryEvent('vscode_desktop_ssh', { kind: 'gateway', status: 'failed', reason: e.toString(), ...params, gitpodVersion: gitpodVersion.raw, userOverride }); | ||
if (e instanceof NoSSHGatewayError) { | ||
this.logger.error('No SSH gateway:', e); | ||
vscode.window.showWarningMessage(`${e.host} does not support [direct SSH access](https://github.com/gitpod-io/gitpod/blob/main/install/installer/docs/workspace-ssh-access.md), connecting via the deprecated SSH tunnel over WebSocket.`); | ||
// Do nothing and continue execution | ||
const ok = 'Ok'; | ||
jeanp413 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const action = await vscode.window.showWarningMessage(`${e.host} does not support [direct SSH access](https://github.com/gitpod-io/gitpod/blob/main/install/installer/docs/workspace-ssh-access.md), connecting via the deprecated SSH tunnel over WebSocket.`, ok); | ||
if (action === ok) { | ||
jeanp413 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Do nothing and continue execution | ||
} else { | ||
return; | ||
} | ||
} else if (e instanceof SSHError && e.message === 'Timed out while waiting for handshake') { | ||
this.logger.error('SSH test connection error:', e); | ||
const ok = 'Ok'; | ||
const action = await vscode.window.showWarningMessage(`Timed out while waiting for SSH handshake, it's possible SSH connections on port 22 are blocked or your network is too slow, connecting via the deprecated SSH tunnel over WebSocket.`, ok); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @akosyakov if you want to tweak the message There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks good to me cc @loujaybee There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
jeanp413 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (action === ok) { | ||
// Do nothing and continue execution | ||
} else { | ||
return; | ||
} | ||
} else if (e instanceof NoRunningInstanceError) { | ||
this.logger.error('No Running instance:', e); | ||
vscode.window.showErrorMessage(`Failed to connect to ${e.workspaceId} Gitpod workspace: workspace not running`); | ||
|
@@ -934,17 +949,17 @@ export default class RemoteConnector extends Disposable { | |
const action = await vscode.window.showInformationMessage(`Could not install local extensions on remote workspace, please enable Settings Sync with Gitpod.`, addSyncProvider, config); | ||
if (action === addSyncProvider) { | ||
vscode.commands.executeCommand('gitpod.syncProvider.add'); | ||
} else if(action === config) { | ||
vscode.commands.executeCommand('workbench.action.openSettings',`@ext:${this.context.extension.id} sync extensions`); | ||
} else if (action === config) { | ||
vscode.commands.executeCommand('workbench.action.openSettings', `@ext:${this.context.extension.id} sync extensions`); | ||
} | ||
} else if (e instanceof NoSettingsSyncSession) { | ||
const enableSettingsSync = 'Enable Settings Sync'; | ||
const config = 'Configure'; | ||
const action = await vscode.window.showInformationMessage(`Could not install local extensions on remote workspace, please enable Settings Sync.`, enableSettingsSync, config); | ||
if (action === enableSettingsSync) { | ||
vscode.commands.executeCommand('workbench.userDataSync.actions.turnOn'); | ||
} else if(action === config) { | ||
vscode.commands.executeCommand('workbench.action.openSettings',`@ext:${this.context.extension.id} sync extensions`); | ||
} else if (action === config) { | ||
vscode.commands.executeCommand('workbench.action.openSettings', `@ext:${this.context.extension.id} sync extensions`); | ||
} | ||
} else { | ||
this.logger.error('Error while fetching settings sync extension data:', e); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is it seconds? 40? I don't mind making it higher like 1-2 minutes. WDYT? cc @mustard-mh @iQQBot
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes seconds, we can increase it more but that would mean their network it's just too slow and the experience would be subpar (I guess that's up to the user to decide so ¯\_(ツ)_/¯), if it takes 1 minute to do the check it will take another minute to connect again using remote-ssh extension 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to show a process bar when connecting and show "fallback to/try with local-app" action after 20 seconds? 40s or 1-2minutes are too long to wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah possible but this connection does nothing it's just a quick test to check if port is not blocked so not sure if we should expose it to the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean generally it should be very quick, so maybe it is not bad to show progress bar if you really have problems, then we need to add some messaging
Verifying SSH connection...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this test should be very quick, if handshake take 40s, It's hard to imagine what the latency would be once you've successfully connected