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

VS Code fails to start/open when offline #7570

Closed
johnnyPescarul opened this issue Jun 12, 2016 · 176 comments
Closed

VS Code fails to start/open when offline #7570

johnnyPescarul opened this issue Jun 12, 2016 · 176 comments
Assignees
Labels
electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@johnnyPescarul
Copy link

  • VSCode Version: 1.2.0
  • OS Version: Windows 8

Steps to Reproduce:

  1. Install VS Code 1.2.0 and open first time while connected to internet
  2. Turn off data connection
  3. Try to restart VS Code (it does not open at all, either from shortcuts or exe)
@bpasero
Copy link
Member

bpasero commented Jun 12, 2016

@johnnyPescarul any output when you try to run code --verbose from the command line in this case?

@bpasero bpasero added the info-needed Issue requires more information from poster label Jun 13, 2016
@bpasero bpasero added this to the Backlog milestone Jun 13, 2016
@johnnyPescarul
Copy link
Author

@bpasero Sorry for the late reply, I didn't see the notification. I tried running "code --verbose" from command line and still nothing, not even one line. As soon as I connect to the internet, it works. I tried re-installing multiple times but I have the same behavior. I tried to replicate on a Windows 7 machine, but was not able to (so it seems to be limited to my Windows 8 machine).

@bpasero
Copy link
Member

bpasero commented Jun 15, 2016

@johnnyPescarul does it return immediately when running "code --verbose"?

@johnnyPescarul
Copy link
Author

@bpasero when I run it, it starts the process but it then hangs. It must be something early on since nothing is displayed with verbose flag on. Are there any logs generated?

@bpasero
Copy link
Member

bpasero commented Jun 15, 2016

@johnnyPescarul any chance you could find out all the processes that we are able to spawn? this might get us closer to see where it hangs.

@joaomoreno could this be an issue with creating a connection to the shared process if you are offline?

@joaomoreno
Copy link
Member

@bpasero Why the shared process? The window doesn't even seem to open...

@bpasero
Copy link
Member

bpasero commented Jun 15, 2016

@joaomoreno the shared process (to my understanding) gets created from the main side. we have seen super funky behaviour when sending telemetry where the entire VM stops in some DNS lookup. Maybe the main side stops in a similar situation trying to establish a connection to the shared process.

@joaomoreno
Copy link
Member

joaomoreno commented Jun 15, 2016

Very unlikely. The main process doesn't even connect to it, simply spawns it. It would only block if fork blocks... and even then the user would read '### VSCode main.js ###' in his console.

@johnnyPescarul
Copy link
Author

I tried again to see if any processes are actually started, but no VSCode process is being started at all, when trying to start in offline mode. Unfortunately I don't have another Windows 8 machine to try and see if I can replicate the issue.

@bpasero
Copy link
Member

bpasero commented Jun 16, 2016

@johnnyPescarul can you run code --version and see output?

@johnnyPescarul
Copy link
Author

@bpasero it is version 1.2.0
Again, if the laptop is offline, the code --version doesn't even work (nothing is displayed).

@bpasero
Copy link
Member

bpasero commented Jun 16, 2016

Wow, that seems to indicate a problem with Electron unless I am mistaken because we use Electron as node, correct @joaomoreno @Tyriar ?

@Tyriar
Copy link
Member

Tyriar commented Jun 16, 2016

code --version is one of the first things that is checked. Literally the CLI process parses args and checks help and version in an ELectron process where ATOM_SHELL_INTERNAL_RUN_AS_NODE=1.

Here is code.cmd:

@echo off
setlocal
set VSCODE_DEV=
set ATOM_SHELL_INTERNAL_RUN_AS_NODE=1
call "%~dp0..\@@NAME@@.exe" "%~dp0..\resources\\app\\out\\cli.js" %*
endlocal

Which calls into cli.ts:

export function main(args: string[]): TPromise<void> {
    const argv = parseArgs(args);

    if (argv.help) {
        console.log(helpMessage);
    } else if (argv.version) {
        console.log(pkg.version);
    } else ...other cases...

    return TPromise.as(null);
}

main(process.argv.slice(2))
    .then(() => process.exit(0))
    .then(null, err => {
        console.error(err.stack ? err.stack : err);
        process.exit(1);
    });

@bpasero bpasero added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jun 17, 2016
@ghost
Copy link

ghost commented Jun 21, 2016

I have noticed this problem as well. Opening two visual studio code instances by running code --verbose twice has resulted in the second instance opening/starting correctly.

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Jun 21, 2016
@joaomoreno joaomoreno removed the info-needed Issue requires more information from poster label Jul 5, 2016
@PHeonix25
Copy link

Can confirm this exact same behaviour when running on Windows 10.
Putting my laptop in flight mode (as I was on a plane) meant that none of the processes were able to spawn. This means the issue is easily reproducible for me.

Running code --version or code --help while offline returns immediately without any processes spawning:
image

Running either command as soon as I was tethered back on solid ground was fine:
image

@bpasero
Copy link
Member

bpasero commented Jul 11, 2016

Can you try to see if a bare Electron app starts at least? Try with:

@PHeonix25
Copy link

PHeonix25 commented Jul 11, 2016

I can confirm the same behaviour with the Electron app itself; both versions exhibited the same behaviour.

For reference, I downloaded the following two packages and just tried running electron.exe from a PS window (most similar example I could make to the reported behaviour above):

  • electron-v1.2.6-win32-x64 (latest Win x64 binary)
  • electron-v0.37.6-win32-x64 (Win x64 binary)

Thanks for helping me/us narrow it down so quickly!
Shall we make an issue on electron? I couldn't find anything in their issues list so far.
UPDATE: I found the following issue on the Atom Shell forum.

For the moment, might it be worth adding something to the VS Code project documentation so that we don't surprise/disappoint more people trying to use the editor without an internet connection?

@bpasero
Copy link
Member

bpasero commented Jul 11, 2016

@PHeonix25 please report this to https://github.com/atom/electron

@PHeonix25
Copy link

Will do, thanks @bpasero.
FYI - after finding this issue on the Atom Shell feedback forum, I also tried to implement one of the final proposed solutions: add the executable to the Windows Firewall rules - with no success - it's definitely a problem with electron. 😢

@bpasero
Copy link
Member

bpasero commented Jul 11, 2016

Thanks for filing it 👍

@johnnyPescarul
Copy link
Author

Finally, somebody was able to replicate the issue :) Thanks @PHeonix25 . For me this was a very big issue, because I had set-up a travel laptop with my dev environment, tested everything and was relying on doing a lot of offline work on that laptop. Unfortunately when I tried to use it offline I realized it was not working, and at that time I had no option to connect and download a different IDE. Thanks anyway for the great work on VSC.

@PHeonix25
Copy link

No worries @johnnyPescarul - keep an eye on the other issue for updates.
I was in the same situation - and it was a very frustrating 14hr flight.

@ghost
Copy link

ghost commented Jan 19, 2019

I'm experiencing the issue as well.
Windows 10 Home 1809 10.0.17763, VS Code 1.30.2

@chriskn
Copy link

chriskn commented Jan 20, 2019

Same for me. I like VSCode but this bug is really annoying.

@kellach
Copy link

kellach commented Jan 21, 2019

Same for me,feel so bad

@DamianSuess
Copy link

DamianSuess commented Jan 21, 2019

BOOO! NP++ to the rescue

VS Code version

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

code --verbose

dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

@itaishopen
Copy link

BOOO! NP++ to the rescue

VS Code version

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

code --verbose

dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

same problem here with the exact same resolute

@Emilius449
Copy link

Solved by
#7570 (comment)

@DamianSuess
Copy link

@Emilius449 Thank you for posting the workaround. I would prefer that they just fix it.

@aditya305
Copy link

Recently i just update my windows 10 to latest insider build 18290 and i see that VS code is working offline on this version so when windows 10 stable version of build will release it'll solve all the problems.

@bpasero
Copy link
Member

bpasero commented Jan 25, 2019

Closing this issue given that we plan to release VSCode stable early February with Electron 3.x. If you want to benefit from the fix already, consider to use our insiders version that already contains the fix: https://code.visualstudio.com/insiders/

@bpasero bpasero closed this as completed Jan 25, 2019
@bpasero bpasero added this to the December/January 2019 milestone Jan 25, 2019
@vikram-rawat
Copy link

I have the same problem I thought something is wrong then I looked into google and it turns out there are many people facing the exact same issue. Please fix it ASAP.

It has been happening for a month now. Before coming to this thread I was seariously looking for alternatives. Please fix it

@ManalLiaquat
Copy link

I think it is the best time to switch to another editor 😡😡😡

@joedf
Copy link

joedf commented Jan 31, 2019

Experienced this just yesterday...

C:\Users\Frost\AppData\Local\Programs\Microsoft VS Code>code --help

C:\Users\Frost\AppData\Local\Programs\Microsoft VS Code>
dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

@PinkiePieStyle
Copy link

PinkiePieStyle commented Feb 4, 2019

My vscode wasn't starting when offline in 2017 and few weeks ago again.
Had same "dns.js:246 this._handle = new ChannelWrap();" crap
Connected to Internet and started vscode and disconnected was fine but then even debugging wasnt working without connection. Reinstalling, deleting Extensions, nothing helped. So i've switched to InsidersBuild wich was working.

Last week i was looking what is eating up all my ssd space and found an directory from code.
VSCode wasnt working anyway so ive deleted anything in these Folders.

C:\Users\xxx\AppData\Roaming\Code\Cache
C:\Users\xxx\AppData\Roaming\Code\CachedData
C:\Users\xxx\AppData\Roaming\Code\CachedExtensions

After starting vscode by mistake and not insiders it started fine without Internet.
Its working now since few Days so ive switched back from Insiders

@lubrogit
Copy link

lubrogit commented Feb 4, 2019

@PinkiePieStyle
You got it. Deleting content of the three directories worked for me. Nevertheless I recommend to make a copy. One never knows what may go wrong. Remember Murphy's laws ...

@narr07
Copy link

narr07 commented Feb 6, 2019

tell me how to fix this :(

@wildapt01
Copy link

@narr07 - This is fixed. Upgrade VSC to 1.31 February 2019 release. VSC runs now on Electron 3:

Version: 1.31.0 (system setup)
Commit: 7c66f58312b48ed8ca4e387ebd9ffe9605332caa
Date: 2019-02-05T22:35:56.624Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

@Emilius449
Copy link

tell me how to fix this :(

#7570 (comment)

@Emilius449
Copy link

I think it is the best time to switch to another editor 😡😡😡

#7570 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests