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

PowerShell Integrated Console unusable with no internet #954

Closed
marckassay opened this issue Jul 13, 2017 · 13 comments
Closed

PowerShell Integrated Console unusable with no internet #954

marckassay opened this issue Jul 13, 2017 · 13 comments

Comments

@marckassay
Copy link

  • VSCode Version: Code 1.14.0 (b8cd5b9556d8b70ea560d35b903422363f6c5c40, 2017-07-10T18:36:31.751Z)
  • OS Version: Windows_NT ia32 10.0.15063
  • Extensions:
Extension Author (truncated) Version
vscode-eslint dba 1.2.11
tslint eg2 0.16.0
PowerShell ms- 1.4.1
debugger-for-chrome msj 3.1.6

Steps to Reproduce:

  1. Disconnect computer from internet
  2. Launch VSCode with a project that uses PowerShell Integrated Console.

Expected:

  • To be able to use the Integrated Console without internet.

The picture below shows the console that is unusable.
powershell_integrated

@PowerSchill
Copy link
Contributor

I wasn’t able to reproduce the issue on my test system with those extensions. Do you have anything running in your Microsoft.VSCode_profile.ps1?

@LaurentDardenne
Copy link

I had a similar problem, moreover access to symbols is impossible.
When my ADSl modem is switched on but no internet connection (problem at the provider), it works.
When I switch off the modem I have the same worries. No error log is generated

@marckassay
Copy link
Author

marckassay commented Jul 14, 2017

Nothing is running in my Microsoft.VSCode_profile.ps1 file. Below is a screenshot of what chrome debugger outputs during this scenario.
chrome_debugger

After some research, if I install a network loopback adapter it will work as expected. Since I have a x64 bit OS I used the following:

E:\> devcon64.exe install C:\WINDOWS\inf\netloop.inf *MSLOOP
Device node created. Install is complete when drivers are installed...
Updating drivers for *MSLOOP from C:\WINDOWS\inf\netloop.inf.
Drivers installed successfully.

UPDATE 7.19.2017: Alternatively for adding a loopback adapter, use LoopbackAdapter module.

@marckassay
Copy link
Author

@PowerSchill,
I believe having a network adapter enabled (or 'Up' status), regardless if its connected to the internet or not will not replicate this issue that is illustrated in the image of my first post. That is, at least initially. It seems that after a minute or so, the network adapter will detect no signal from ISP and switch to the status of 'Disconnected'. At least that is what I conclude at this point, but networking isn't exactly my forte either. Also use the Get-NetAdapter command to check status.

I have committed on my forked repo which prevents the Integrated Console from being stuck in the "Starting PowerShell…" status during the 'Disconnected' scenario. It will put the console in a status of, 'Initialization Error'. It’s a modest fix, but I have now found where its failing and will attempt later to have the console usable. Unless you or anyone else has any suggestions or solutions (even proposed PR), please do this. I don't want to suppress development in anyway.

The animated gif below will illustrate what my forked git commit does when having a network adapter connected. And then I'll disconnect my connection and reload VSCode.
demo954commit7173e323

@aarontheadmin
Copy link

I am having the same issue - no internet causes "Starting PowerShell..."

  • VSCode Version: Code 1.15.1 (41abd21afdf7424c89319ee7cb0445cc6f376959, 2017-08-16T18:05:38.342Z)
  • OS Version: Windows_NT ia32 10.0.15063

My connection is going through a switch, router, then modem at work, and a router-modem at home. Same problem in both places.

@david-house
Copy link

Same issue VSCode 1.16.1
Windows 10.0.15063 64-bit
Powershell extension 1.4.3

@LethiferousMoose
Copy link

I also see the same issue with the latest versions;

PS > code -v
1.23.1
d0182c3417d225529c6d5ad24b7572815d0de9ac
x64
PS > $pseditor.EditorServicesVersion

Major  Minor  Build Revision
-----  -----  -----  --------
1      7      0      0
PS > $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0-preview.2
PSEdition                      Core
GitCommitId                    v6.1.0-preview.2
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@rkeithhill
Copy link
Contributor

rkeithhill commented May 23, 2018

This should be resolved in the next update as we're switching over to use named pipes. As for now, do you not have a loopback adapter installed? That should allow communication between VSCode and the PowerShell language server even without an internet connection.

Also, can you set the extensions logLevel to Diagnostic and copy/paste the output you see in the terminal when it's trying to find a TCP port to use? Put this in your user settings file:

"powershell.developer.editorServicesLogLevel": "Diagnostic"

Now, when the PowerShell Integrated Terminal tries to start, there should be a bunch of yellow/verbose output.

@LethiferousMoose
Copy link

LethiferousMoose commented May 24, 2018

I do not have a loopback adapter installed. I only hit this issue because I wasn't able to get on a network, it won't be a common issue for me. This is only the second time I hit it, but it took me awhile to remember this was the cause.

Here's the diagnostic content from the terminal:

Transcript started, output file is C:\Users\<UserName>\.vscode\extensions\ms-vscode.powershell-1.7.0\logs\1527169470-ae67b456-2d23-46f5-8f21-513f5bbb01e01527169463165\Start-EditorServices.log
VERBOSE:
#-- Updated PSModulePath to: -------------------------------------------------
VERBOSE: C:\Users\<UserName>\Documents\PowerShell\Modules
VERBOSE: C:\Program Files\PowerShell\Modules
VERBOSE: c:\program files\powershell\6-preview\Modules
VERBOSE: C:\Users\<UserName>\.vscode\extensions\ms-vscode.powershell-1.7.0\modules
VERBOSE:
#-- Check required modules available -----------------------------------------
VERBOSE: Testing module availability PowerShellGet
VERBOSE: Loading module from path 'C:\program files\powershell\6-preview\Modules\PowerShellGet\1.6.0\PSModule.psm1'.
VERBOSE: PowerShellGet  found
VERBOSE:
#-- Start up PowerShellEditorServices ----------------------------------------
VERBOSE: Importing PowerShellEditorServices
VERBOSE: Loading module from path 'C:\Users\<UserName>\.vscode\extensions\ms-vscode.powershell-1.7.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'.
VERBOSE: Loading module from path 'C:\Users\<UserName>\.vscode\extensions\ms-vscode.powershell-1.7.0\modules\PowerShellEditorServices\PowerShellEditorServices.psm1'.
VERBOSE: Exporting function 'Start-EditorServicesHost'.
VERBOSE: Exporting function 'Compress-LogDir'.
VERBOSE: Exporting function 'Get-PowerShellEditorServicesVersion'.
VERBOSE: Importing function 'Compress-LogDir'.
VERBOSE: Importing function 'Get-PowerShellEditorServicesVersion'.
VERBOSE: Importing function 'Start-EditorServicesHost'.
VERBOSE: Checking port: 13073, attempts remaining 10 --------------------
VERBOSE: Testing availability of port 13073 at address 127.0.0.1 / InterNetwork
VERBOSE: Port: 13073 is available
VERBOSE: Checking port: 10744, attempts remaining 10 --------------------
VERBOSE: Testing availability of port 10744 at address 127.0.0.1 / InterNetwork
VERBOSE: Port: 10744 is available
PowerShell Integrated Console

VERBOSE: Invoking Start-EditorServicesHost
VERBOSE: Start-EditorServicesHost returned Microsoft.PowerShell.EditorServices.Host.EditorServicesHost
VERBOSE: Processing object of type [Hashtable] at depth 0
VERBOSE: Processing object of type [Int32] at depth 1
VERBOSE: Processing object of type [Int32] at depth 1
VERBOSE: Writing session file with contents:
VERBOSE: {"debugServicePort":10744,"languageServiceTransport":"Tcp","status":"started","debugServiceTransport":"Tcp","languageServicePort":13073}
VERBOSE: Wrote out session file
VERBOSE:
#-- Waiting for EditorServicesHost to complete execution ---------------------

@TylerLeonhardt
Copy link
Member

As Keith has said, this will be fixed in the next version because we will no longer be relying on TCP in the extension.

Switching to named pipes will allow the extension to work without internet and without a loopback adapter. 🎉

If you would like to get this fix immediately, you can grab the latest CI build:
https://ci.appveyor.com/project/PowerShell/vscode-powershell/build/artifacts

Or, just wait for the next release 🙂

@marckassay
Copy link
Author

@tylerl0706, what's the build number to the version you referred to in your last post? Because I noticed this issue again last week during a service outage where I live.

@rkeithhill
Copy link
Contributor

rkeithhill commented Jul 11, 2018

Your VSCode should automatically update to 1.8.0 of the PowerShell extension.

@marckassay
Copy link
Author

Oh nice! It just updated to 1.8.0 and now works even when internet is unavailable. Thanks!

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

No branches or pull requests

8 participants