microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.97k stars 29.19k forks source link

VS Code fails to start/open when offline #7570

Closed johnnyPescarul closed 5 years ago

johnnyPescarul commented 8 years ago

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)
abh1kudo commented 6 years ago

I was facing this issue earlier but it was resolved after the 1.17.0 update . I thought it must have been resolved by the developers (however I see since you guys are still facing this issue it wasn't). Although I don't know what actually solved the issue, in my case VS Code failed to launch whenever I wasn't connected to a network (not internet per se). So I used to connect to any open WIFI or make a hotspot from my mobile just to launch it once(No problem in running VS Code once WIFI was disconnected , WIFI was needed for launch only). I know it is not a solution, but it is a temporary thing you can try until your problems are resolved. Cheers

Marsh93 commented 6 years ago

Hello abhikudo, I have the problem with my desktop, I do not have Internet access at the moment, and this happens to me not to start the vscode, I have a solution, friend, I like vscode, but this error I have not seen it in other editors like atom or sublime. I have tried formatting but nothing, I do not know what to do to fix it. Is it a problem in the operating system or the editor itself? I was thinking about switching to ubuntu use windows 10 home currently

markgossa commented 6 years ago

I found some similar issues when debugging PowerShell scripts using VSCode while being offline. It would just get stuck trying to start PowerShell. To work around it, I created a loopback adapter by following instructions here: https://technet.microsoft.com/en-gb/library/cc708322(v=ws.10).aspx. It seemed to resolve my issue but it's just a workaround and not a fix.

gdmyghacc commented 6 years ago

Is there a working solution for this issue?

I tried installing it on server 2012 r2, but CPU usage spikes up to 100% immediately (shared by two code processes).

I followed https://blogs.technet.microsoft.com/pstips/2018/01/14/using-vscode-and-the-powershell-extension-in-an-offline-environment/ and installed the vsix manually as detailed there. Still no change.

`C:\Windows\system32>code --verbose

[main 12:02:25 PM] Starting VS Code [main 12:02:25 PM] from: c:\Program Files\Microsoft VS Code\resources\app [main 12:02:25 PM] args: { _: [], help: false, h: false, version: false, v: false, wait: false, w: false, diff: false, d: false, add: false, a: false, goto: false, g: false, 'new-window': false, n: false, 'unity-launch': false, 'reuse-window': false, r: false, 'open-url': false, performance: false, p: false, 'prof-startup': false, verbose: true, logExtensionHostCommunication: false, 'disable-extensions': false, disableExtensions: false, 'list-extensions': false, 'show-versions': false, nolazy: false, 'skip-getting-started': false, 'sticky-quickopen': false, 'disable-telemetry': false, 'disable-updates': false, 'disable-crash-reporter': false, 'skip-add-to-recently-opened': false, status: false, s: false } [main 12:02:25 PM] Resolving machine identifier... [main 12:02:25 PM] Resolved machine identifier: 96f47d1febe5251ec1e036691c4958eb 2aefe6f6dc9f4aa6839c79f8bef1a9a9 [5052:0201/120228.884:INFO:CONSOLE(1225)] "%cTRACE", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1225) [main 12:02:29 PM] IPC#vscode-workbenchLoaded [5052:0201/120234.133:INFO:CONSOLE(1226)] "%c ERR", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1226) [5052:0201/120234.133:INFO:CONSOLE(249)] "%c[Extension Host] %crejected promise not handled within 1 second %c(at Timeout._onTimeout (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:534:327))", source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workben ch/workbench.main.js (249) WARNING: Promise with no error callback:8 { exception: Error: net::ERR_CONNECTION_TIMED_OUT, error: null, promise: { _creator: null, _nextState: null, _state: { name: 'error', enter: [Function: enter], cancel: [Function: s], done: null, then: null, _completed: [Function: s], _error: [Function: s], _notify: [Function: g], _progress: [Function: s], _setCompleteValue: [Function: s], _setErrorValue: [Function: s] }, _listeners: null, _value: Error: net::ERR_CONNECTION_TIMED_OUT, _isException: true, _errorId: 8, done: [Function: done], then: [Function: then] }, handler: undefined, id: 8, parent: undefined } Error: net::ERR_CONNECTION_TIMED_OUT [main 12:03:19 PM] [uncaught exception in main]: Error: net::ERR_CONNECTION_TIME D_OUT

Error: net::ERR_CONNECTION_TIMED_OUT [main 12:03:19 PM] Error: net::ERR_CONNECTION_TIMED_OUT

Error: net::ERR_CONNECTION_TIMED_OUT at Timeout._onTimeout (C:\Program Files\Microsoft VS Code\resources\app\out\ vs\code\electron-main\main.js:88:972) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5)`

verylongword commented 6 years ago

I have this issue: 30 march 2018 Version 1.21.1 Commit 79b44aa704ce542d8ca4a3cc44cfca566e7720f1 Date 2018-03-14T14:46:47.128Z Shell 1.7.9 Renderer 58.0.3029.110 Node 7.9.0 Architecture x64

ardiyanbs commented 6 years ago

Hi Folks, I've just encountered the same issue. While I lost my internet connection, my VSCode cannot be started. I tried to run code --verbose and resulting: vscode_error And here is my VSCode version: vscode_version

If anyone has already the permanent solution, please share. Thanks.

markgossa commented 6 years ago

To work around it, I created a loopback adapter by following instructions here: https://technet.microsoft.com/en-gb/library/cc708322(v=ws.10).aspx. It seemed to resolve my issue but it's just a workaround and not a fix.

feihuit commented 6 years ago

same problem with windows 7 without internet.

  1. download VSCode-win32-x64-1.22.2.zip from https://vscode.cdn.azure.cn/stable/3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9/VSCode-win32-x64-1.22.2.zip
  2. extract to another computer without internet connection. unzip to c:\vscode\VSCode-win32-x64
  3. run taskmgr, double click code.exe, it appeared in taskmgr but disappeared quickly
  4. try cmd cd c:\vscode\VSCode-win32-x64 code the output is: net.js:10 const cares = process.binding('cares_wrap'); ^

Error: EFILE at net.js:10:23 at net.js:1645:3 at NativeModule.compile (bootstrap_node.js:535:7) at NativeModule.require (bootstrap_node.js:475:18) at internal/child_process.js:6:13 at internal/child_process.js:903:3 at NativeModule.compile (bootstrap_node.js:535:7) at NativeModule.require (bootstrap_node.js:475:18) at child_process.js:12:23 at child_process.js:542:3

code --verbose same output as code at above ( net.js:10 ......)

Himura2la commented 6 years ago

Same problem on lubuntu 18.04.

$ js -v
v8.10.0
$ code -v
1.23.1
d0182c3417d225529c6d5ad24b7572815d0de9ac
x64
pariola commented 6 years ago

Also facing the same on Windows 10

1.23.1
d0182c3417d225529c6d5ad24b7572815d0de9ac
ia32

It also fails when i try to create a new terminal

josealencar commented 6 years ago

Same here on Windows 10

image


Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T17:11:17.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64```
garci66 commented 6 years ago

Is there any work being done here. I can successfully replicate and I am willing to provide any needed info. Exact same error code:

C:\Program Files\Microsoft VS Code>code

C:\Program Files\Microsoft VS Code>
net.js:10
const cares = process.binding('cares_wrap');
                      ^

Error: EFILE
    at net.js:10:23
    at net.js:1645:3
    at NativeModule.compile (bootstrap_node.js:535:7)
    at NativeModule.require (bootstrap_node.js:475:18)
    at internal/child_process.js:6:13
    at internal/child_process.js:903:3
    at NativeModule.compile (bootstrap_node.js:535:7)
    at NativeModule.require (bootstrap_node.js:475:18)
    at child_process.js:12:23
    at child_process.js:542:3

This is on Windows 10 1804. If I bring up my wifi (tether to my phone, for example, with no internet connection on the phone -eg on a plane, as it just happened-) then it works ok. Using version 1.23.1 as above.

muradaliyev commented 6 years ago

Same problem as above. Adding MS loopback adapter solved the problem

mathieucaroff commented 6 years ago

Same problem and output as @garci66 on Windows x64 Family Edition. I found bug report #43864 before this one. I tried to shutdown windows with fast startup disabled and it fixed the problem.

A one time shutdown without fast startup can be done by maintaining the shift key pressed while clicking on the power button of the windows menu, then on the "Shut down" entry. Also see Fast Startup - How to disable if it's causing problems, on Microsoft support forum.

reddvid commented 6 years ago

Same here on Windows 10 x64. I thought this was an Windows Insider build issue.

VSC won't launch unless it's connected to a network, with or without internet connectivity.

markgossa commented 6 years ago

You can work around it by creating a loopback adapter. See my previous comment.

garci66 commented 6 years ago

Yes.. but it should not be needed. Its a code editor! (I know the bug is with node.js and not specific to VScode, but still, totally unacceptable from an end user POV)

On Sat, Aug 18, 2018 at 8:21 PM Mark Gossa notifications@github.com wrote:

You can work around it by creating a loopback adapter. See my previous comment.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/7570#issuecomment-414092135, or mute the thread https://github.com/notifications/unsubscribe-auth/AKFd2IkkwdJEP94slxU4U9Q4lj_32cOYks5uSKFigaJpZM4Izs0E .

augustoproiete commented 6 years ago

So much for coding on airplanes... πŸ˜„

image

garci66 commented 6 years ago

Thats how I ended up discovering this bug myself. Had to put my phone in tethering mode.. connect, launch VScode and then disconnect.

On Mon, Aug 20, 2018 at 10:59 PM Caio Proiete notifications@github.com wrote:

So much for coding on airplanes... πŸ˜„

[image: image] https://user-images.githubusercontent.com/177608/44375778-b2360080-a4cb-11e8-8628-a4344f3d8458.png

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/7570#issuecomment-414524478, or mute the thread https://github.com/notifications/unsubscribe-auth/AKFd2Ku45snFbgIFsxPSwUIa1rrNROo_ks5uS2llgaJpZM4Izs0E .

yackermann commented 6 years ago

Seems to be an issue with NodeJS prior to 9.x

https://github.com/nodejs/help/issues/948#issuecomment-341918738

sabihoshi commented 6 years ago

@herrjemand I installed NodeJS 9.0.0 as well as 10.9.0 but still the same error as the other people who ran code --verbose

As @reddvid has pointed out

Same here on Windows 10 x64. I thought this was an Windows Insider build issue.

This problem started for me on Windows Insider, so I thought it would be that as well. But other people experience it on Windows 8 as well, so I'm at a loss here on what to do to fix it. The loopback adapter fixes it for me and works great.

Windows 10 Pro x64 bit
Build 17744.1001
Node  9.0.0 & 10.9.0

Visual Studio Code
1.26.1
493869ee8e8a846b0855873886fc79d480d342de
x64

cmd_2018-08-24_09-11-27 2018-08-24_08-59-02

gdh1995 commented 6 years ago

VS Code 1.27.1 x64 also failures on my laptop if no Wifi is connected. My laptop is Windows 10 Education x64, Insider Version 1809 (build 17758.1).

both code --verbose and code --version print:

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
bpasero commented 6 years ago

We are building exploration builds that use a much newer version of Electron (our UI framework). I wonder if this issue reproduces with one of these builds, could you try? Download:

gdh1995 commented 6 years ago

The crash of Resolver in dns.js disappears if my Wi-Fi card is disabled when I use the above exploration version.

Win 10 x64 Edu v1809 b17760.1, VS Code Exploration x64 v1.28.0.

bpasero commented 6 years ago

@gdh1995 great to hear, so to verify: you can start without issues using that version and it does not work with our current stable?

gdh1995 commented 6 years ago

Yes, the new one (exp 1.28.0) works both when a Wi-Fi card is disabled and if hardwares enabled but no active Wi-Fi connections.

The current one (1.27.2) can not work:

[Main Instruction] Visual Studio Code

[Content]

η‰ˆζœ¬: 1.27.2 (system setup) 提亀: f46c4c469d6e6d8c46f268d1553c5dc4b475840f ζ—₯期: 2018-09-12T16:17:45.060Z Electron: 2.0.7 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 ζžΆζž„: x64

bpasero commented 6 years ago

Great, thanks.

sabihoshi commented 6 years ago

I can confirm the exploration build fixed it for me. The current latest build still doesn't.

VS Code: 1.27.2 f46c4c469d6e6d8c46f268d1553c5dc4b475840f x64 Node: v10.9.0 Chrome: 69.0.3497.100 (Official Build) (64-bit) Windows 10 Pro x64 1809 Build 17763.1

sashar2 commented 6 years ago

@bpasero, hi. Tell me, please, whether this defect is fixed in the last stable version of Electron 3.0 (https://electronjs.org/blog/electron-3-0) or only in beta10 (vscode 1.28.0 based on Electron 3.0.0-beta.10)?

bpasero commented 6 years ago

@sashar2 I would assume any version of Electron 3.0.x that is shipping with node.js 10.x

sashar2 commented 6 years ago

@sashar2 I would assume any version of Electron 3.0.x that is shipping with node.js 10.x

@bpasero, OK, thank you.

swiffer commented 6 years ago

Wow, using vs code for the last 3 years but noticed that for the first time yesterday. Internet access has become pretty common. Glad to see it will be fixed soon.

md2perpe commented 6 years ago

I encountered this problem today. I already had VS Code running and should do a replace in some files. But the sidebar search didn't work. So I tried to open the files that I knew should be modified, but the folders didn't open; the spin icon was just spinning on. So I tried to restart VS Code, but the IDE didn't load.

I will test with the insiders version.

BillyONeal commented 6 years ago

+1 on this report:

C:\Dev\msvc>"C:\Users\billy\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe"

C:\Dev\msvc>
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

C:\Dev\msvc>

Exploration build above seems to fix it for me.

nancym commented 5 years ago

Thank you for unlocking this issue 2 days ago @Microsoft! I work offline a lot and I've finally decided to install an "Exploration Build" of VS Code so I can use VS Code when I'm offline. Could someone please post a link to the most up-to-date stable version of VS Code that works offline? I see these links:

Since those links were posted June 21, I wonder if they are the most up-to-date stable "Exploration Builds" of VS Code. It would be useful if there were a web page that always pointed to the most up-to-date "Exploration Builds."

Thank you.

MA-Norouzifar commented 5 years ago

tell me plz how solve it...........?

i always see duplicate duplicate duplicate duplicate duplicate #7570 #7570 #7570

oky is duplicate but in #7570 where is solution which comment fix it .........?

h-mortazavifar commented 5 years ago

I have the same issue. version 1.29 with windows 10 1809

mayo84 commented 5 years ago

The solution so far I've found here is: Use exploration build with electron 3. downloads in the @nancym post before. There is also links in #61787 for a future electron 4 exploration build. (Recomended is electron3 build as stated by @bpasero in #61787#issuecomment-440149592)

mayo84 commented 5 years ago

Today I had a similar issue but with graphql-playground-electron v1.8.3. It seems that some win10 update has broken something in electron 2.x framework. The exploration version of vscode with electron 3 is working perfectly. Thanks devs!

tumbleintoyourheart commented 5 years ago

I faced the same issue today, both vscode stable version and insider version won't launch without a network connection Thanks for the Loopback adapter workaround, not perfect but it did make my day

ghost commented 5 years ago

Still an issue in the latest version. I used insider and does the same thing. It simply won't run offline.

nightmarlin commented 5 years ago

It's definitely still an issue...

Offline

Offline

With an internet connection

Online

bahhax404 commented 5 years ago

same issue on 1.29.1 was driving me crazy before I realized that it's because of the internet. also no solution just loops of the bot suggesting duplicates wtf !

ghost commented 5 years ago

guys download the Explorer build up above works fine offline

liveangela commented 5 years ago

The solution so far I've found here is: Use exploration build with electron 3. downloads in the @nancym post before. There is also links in #61787 for a future electron 4 exploration build. (Recomended is electron3 build as stated by @bpasero in #61787#issuecomment-440149592)

Exploration works fine to me, too

ghost commented 5 years ago

but in exploration version there are no settings.json to edit your own settings is there any way for stable build to work offline ??

llkiriell commented 5 years ago

Was it solved? I thought it could be some extension, but discarded that idea a long time ago. Apparently, several people also have the same problem here. error

AlaaZorkane commented 5 years ago

image Same error here, we should probably take this to Electron.

bpasero commented 5 years ago

Todays VSCode insider release includes Electron 3.0.x, so you can go back from the exploration build to that version.

llkiriell commented 5 years ago

@AlaaZorkane Apparently, yes, it's Electron. I have the same problem with GitHub desktop app.