Skip to content

Connection to server got closed. Server will not be restarted. #4833

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
iShibi opened this issue Jan 12, 2020 · 32 comments
Closed

Connection to server got closed. Server will not be restarted. #4833

iShibi opened this issue Jan 12, 2020 · 32 comments
Assignees
Labels
embedded Language Service more info needed The issue report is not actionable in its current state

Comments

@iShibi
Copy link

iShibi commented Jan 12, 2020

This message is showing up in the Output terminal of "cpptools: untitled".
This happens whenever I create a C file. I tried to downgrade the C\C++ extension but the problem remained unsolved. Due to this no suggestion are showing up when I am coding in a C file.

@Colengms
Copy link
Contributor

Hi @shibi391 . I'm able to create a C file without seeing this repro. Can you provide additional context that might help us identify the cause? Are there any settings you're using in c_cpp_properties.json or settings.json?

Is this specific to a particular file encoded (i.e. non UTF-8), or are there extended Unicode characters in the path?

@Colengms Colengms added Language Service more info needed The issue report is not actionable in its current state labels Jan 13, 2020
@guozc09
Copy link

guozc09 commented Mar 3, 2020

Hi @Colengms . I use version 0.26.3 of cpptools. When using VSCode in an offline environment, this problem occurs when opening a C file. But , this problem does not exist in the online environment.

@guozc09
Copy link

guozc09 commented Mar 3, 2020

I did not have this problem when I rolled back to the 0.24.1 version. However, it is not clear which version of the problem occurred between 0.24.1 and 0.26.3.

@Colengms
Copy link
Contributor

Colengms commented Mar 3, 2020

Hi @guozc09 . This is not an issue being reported by other users of 0.26.3. There would seem to be something specific about your environment or scenario. In order to help, we need more information.

We have had reports of corrupted installs of the extension, perhaps due to shutting down VS Code while installation was still in progress. Try uninstalling the extension, ensuring its directory is removed from %USERPROFILE\.vscode\extensions, and reinstalling it.

If that does not address the issue, please enable debug logging using "C_Cpp.loggingLevel": "Debug", repro the issue, and post the resulting contents of the C/C++ Output channel. That may tell us what is going on.

@guozc09
Copy link

guozc09 commented Mar 4, 2020

Hi @Colengms ,Thank you for your answer.
We have had reports of corrupted installs of the extension, perhaps due to shutting down VS Code while installation was still in progress. Try uninstalling the extension, ensuring its directory is removed from %USERPROFILE.vscode\extensions, and reinstalling it.
A: I have tried this method before, but it still has no effect.

If that does not address the issue, please enable debug logging using "C_Cpp.loggingLevel": "Debug", repro the issue, and post the resulting contents of the C/C++ Output channel. That may tell us what is going on.
A: I will take the time to try this later.

@me21
Copy link

me21 commented Apr 10, 2020

I have similar issue with cpptools 0.27.0. Here's the debug output:

initialized
cpptools/queryCompilerDefaults (id: 1)
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
cpptools/didChangeCppProperties
Warning: Database safety check failed. Recreating database.
[rc=0x80004005] (DB: false, Expected: true)
Служба обзора кода инициализирована
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
textDocument/didOpen: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp
Выполняется прерывание анализа тегов C:\USERS\ПОСТОВОЙ\DOCUMENTS\PLATFORMIO\PROJECTS\200405-024334-ESP32DEV\SRC\SKETCH_APR05A.CPP и зависимостей
cpptools/activeDocumentChange: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp
cpptools/textEditorSelectionChange
cpptools/getDocumentSymbols: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp (id: 2)
cpptools/getCodeActions: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp (id: 3)
Заполните кэш завершения включения.
Идет обнаружение файлов...
  Обнаружение файлов: обработано файлов — 0.
  Файлов, удаленных из базы данных: 0
Обнаружение файлов завершено.
Анализ оставшихся файлов...
  Анализ: обработано файлов — 0
Анализ оставшихся файлов завершен.
пустой цикл: повторный анализ активного документа
Проверка на наличие синтаксических ошибок: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp
Отправка аргументов компиляции для C:\USERS\ПОСТОВОЙ\DOCUMENTS\PLATFORMIO\PROJECTS\200405-024334-ESP32DEV\SRC\SKETCH_APR05A.CPP.
  Включить: C:\Users\Постовой\Documents\PlatformIO\Projects\200405-024334-esp32dev
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
cpptools/getDocumentSymbols: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp (id: 4)
cpptools/getDocumentSymbols
Database safe to open
cpptools/getDocumentSymbols: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp (id: 5)
cpptools/getDocumentSymbols
Постановка в очередь обновления IntelliSense для файлов в единице трансляции: C:\USERS\ПОСТОВОЙ\DOCUMENTS\PLATFORMIO\PROJECTS\200405-024334-ESP32DEV\SRC\SKETCH_APR05A.CPP
cpptools/cpptools_finishUpdateSquiggles
Число волнистых линий для ошибок: 9
Волнистые линии для ошибок будут отключены в: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp
Время обновления IntelliSense (в секундах): 9.59
cpptools/getCodeActions: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp (id: 6)
cpptools/didChangeCppProperties
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
Выполняется закрытие канала связи.
Завершение работы сервера IntelliSense: C:\USERS\ПОСТОВОЙ\DOCUMENTS\PLATFORMIO\PROJECTS\200405-024334-ESP32DEV\SRC\SKETCH_APR05A.CPP
Попытка получить значения по умолчанию из обнаруженного на компьютере компилятора: "".
Подходящий компилятор не найден. Укажите "compilerPath" в c_cpp_properties.json.
Проверка на наличие синтаксических ошибок: file:///c%3A/Users/%D0%9F%D0%BE%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B9/Documents/PlatformIO/Projects/200405-024334-esp32dev/src/sketch_apr05a.cpp
cpptools/didChangeCppProperties
  файл анализа тегов: C:\USERS\ПОСТОВОЙ\DOCUMENTS\PLATFORMIO\PROJECTS\200405-024334-ESP32DEV\SRC\SKETCH_APR05A.CPP
cpptools/didChangeSettings
Подсистема IntelliSense: Default.
Расширенная раскраска включена.
Волнистые линии для ошибок включены, если разрешены все зависимости заголовка.
Автозавершение включено.
Исключение файла: **/.git
Исключение файла: **/.svn
Исключение файла: **/.hg
Исключение файла: **/CVS
Исключение файла: **/.DS_Store
Исключение файла: **/.vscode
Исключение поиска: **/node_modules
Исключение поиска: **/bower_components
Исключение поиска: **/*.code-search
Исключение поиска: **/.vscode
$/setTraceNotification
Заполните кэш завершения включения.
Идет обнаружение файлов...

The extension was installed because it was required by PlatformIO extension 1.10.0.
VS code version is 1.44.0.

@sean-mcmanus
Copy link
Contributor

@me21 Which text translates to "Connection to server got closed. Server will not be restarted."? I checked but didn't see it. This is just a symptom of a crash of the IntelliSense process and there could be many root causes. Attaching a debugger to cpptools-srv to get a call stack of the crash or providing an isolated repro would be helpful in fixing your particular crash.

@me21
Copy link

me21 commented Apr 10, 2020

This is the contents of C/C++ output channel, while the original error message was in cpptools output channel.
However, I will check for c_cpp_properties.json file encoding, and also move my project to latin-only path.

@Bugotak
Copy link

Bugotak commented Apr 10, 2020

VS Code version 1.43 on Windows 10 Corporate Edition, 64GB RAM.
cpp_tools version 0.27.0.
Observe the following: while Intellisencse is updating it consumes up to 4GB of memory and next crashes with message "Connection to server got closed. Server will not be restarted".
Increasing C_Cpp.intelliSenseCacheSize to the value of 6000 helped but VSCode updated to 1.44 and the problem came back.

@willdzeng
Copy link

Same issue here.
VS code version: 1.44.0
cpp tool version: 0.27.0

I got the exact same error, and everything including coloring stopped working, hard to restart vscode to make it work.

One thing did notice is that the memory usage of cpp-tool increased a lot >5Gb when I open new files, particularly when it starts to "Parsing Open File".

Not sure how to generate debug outputs, maybe some instruction regarding that would be helpful?

@sean-mcmanus
Copy link
Contributor

@willdzeng Our process is crashing. We believe we know where it's crashing, but so far have not been able to find a repro. If you can provide repro steps, that would help -- something to do with changing settings.

@koksenglow
Copy link

I'm having the same issue here

VS code version: 1.44.1
OS: Window 10
cpp tool verison: 0.27.0

I got the same error and this is making me unable to use "Go to Defination", "Go to Declaration" and "Go to Reference" features

This error happens after using "Go to Defination" for few times

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Apr 16, 2020

@koksenglow Our next Insiders release should have more crash fixes. It looks like some crash fixes accidentally didn't get moved to our release branch for 0.27.0.

@guozc09
Copy link

guozc09 commented Apr 20, 2020

Hi @Colengms & @sean-mcmanus :
VS code version: 1.44.2 win32
cpp tool version: 0.27.0
I changed C_Cpp: Logging Level to Debug, but the output log is still only one line "Connection to server got closed. Server will not be restarted". OUTLINE displays "The active editor cannot provide outline information."
cpp tool version: 0.24.0 works fine without this error.
My computer with VSCode installed cannot connect to the Internet.

@me21
Copy link

me21 commented Apr 20, 2020

@guozc09 please post the contents of C/C++ output channel, the output log you're referring to is in another output channel (cpptools).

@guozc09
Copy link

guozc09 commented Apr 20, 2020

@me21 when an error occurs, the output channel is automatically switched to cpptools.

@me21
Copy link

me21 commented Apr 20, 2020

@guozc09 you can switch it back manually ;)

@guozc09
Copy link

guozc09 commented Apr 20, 2020

@me21 The following is the output of the log window:
[2020-04-20 16:30:15.258] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:15.258] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:15.258] [renderer1] [error] Error: [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:15.258] [renderer1] [error] [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:16.503] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:16.504] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:16.504] [renderer1] [error] Error: [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:16.504] [renderer1] [error] [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:16.918] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:16.918] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:16.919] [renderer1] [error] Error: [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:16.919] [renderer1] [error] [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:17.635] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:17.635] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:17.635] [renderer1] [error] Error: [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:17.636] [renderer1] [error] [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:17.782] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:17.783] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:17.783] [renderer1] [error] Error: [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:17.783] [renderer1] [error] [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:18.215] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:18.215] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:18.215] [renderer1] [error] Error: [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:18.215] [renderer1] [error] [File Watcher (C#)] is restarted again...
[2020-04-20 16:30:18.749] [renderer1] [error] Error: [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:18.750] [renderer1] [error] [File Watcher (C#)] terminated unexpectedly (code: 2148734720, signal: null)
[2020-04-20 16:30:18.750] [renderer1] [error] Error: [File Watcher (C#)] Watcher failed to start after retrying for some time, giving up. Please report this as a bug report!
[2020-04-20 16:30:18.750] [renderer1] [error] [File Watcher (C#)] Watcher failed to start after retrying for some time, giving up. Please report this as a bug report!
[2020-04-20 16:30:18.968] [renderer1] [error] spawnSync global ENOENT: Error: spawnSync global ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:620:24)
at Global.execute (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\global\executableBase.js:19:20)
at Global.executeOnDocument (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\global\global.js:149:21)
at Global.provideDocumentSymbols (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\global\global.js:126:28)
at c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\documentSymbolProvider.js:12:37
at new Promise ()
at GlobalDocumentSymbolProvider.provideDocumentSymbols (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\documentSymbolProvider.js:10:16)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:626:330
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:54:761
at new Promise ()
at Object.t.asPromise (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:54:733)
at v.provideDocumentSymbols (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:626:301)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:649:921
at e._withAdapter (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:649:159)
at e.$provideDocumentSymbols (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:649:899)
at e._doInvokeHandler (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:683)
at e._invokeHandler (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:375)
at e._receiveRequest (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:750:953)
at e._receiveOneMessage (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:749:832)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:34
at e.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)
at v.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:206:615)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:919:744
at e.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)
at v.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:206:615)
at t.PersistentProtocol._receiveMessage (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:211:17)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:208:155
at e.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)
at p.acceptChunk (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:204:129)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:203:483
at Socket.t (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:212:565)
at Socket.emit (events.js:203:13)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:276:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
[2020-04-20 16:30:20.883] [renderer1] [error] spawnSync global ENOENT: Error: spawnSync global ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:620:24)
at Global.execute (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\global\executableBase.js:19:20)
at Global.executeOnDocument (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\global\global.js:149:21)
at Global.provideDocumentSymbols (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\global\global.js:126:28)
at c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\documentSymbolProvider.js:12:37
at new Promise ()
at GlobalDocumentSymbolProvider.provideDocumentSymbols (c:\Users\zc.guo.vscode\extensions\jaycetyle.vscode-gnu-global-0.3.2\out\documentSymbolProvider.js:10:16)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:626:330
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:54:761
at new Promise ()
at Object.t.asPromise (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:54:733)
at v.provideDocumentSymbols (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:626:301)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:649:921
at e._withAdapter (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:649:159)
at e.$provideDocumentSymbols (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:649:899)
at e._doInvokeHandler (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:683)
at e._invokeHandler (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:752:375)
at e._receiveRequest (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:750:953)
at e._receiveOneMessage (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:749:832)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:34
at e.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)
at v.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:206:615)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:919:744
at e.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)
at v.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:206:615)
at t.PersistentProtocol._receiveMessage (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:211:17)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:208:155
at e.fire (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:48:497)
at p.acceptChunk (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:204:129)
at c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:203:483
at Socket.t (c:\Users\zc.guo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:212:565)
at Socket.emit (events.js:203:13)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:276:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
[2020-04-20 16:30:22.518] [renderer1] [error] Connection got disposed.: Error: Connection got disposed.
at Object.dispose (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:3814:25)
at Object.dispose (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:5393:35)
at LanguageClient.handleConnectionClosed (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:7475:42)
at LanguageClient.handleConnectionClosed (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:16494:15)
at closeHandler (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:7462:18)
at CallbackList.invoke (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:11264:39)
at Emitter.fire (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:11322:36)
at closeHandler (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:3164:26)
at CallbackList.invoke (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:11264:39)
at Emitter.fire (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:11322:36)
at StreamMessageReader.fireClose (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:14035:27)
at Socket. (c:\Users\zc.guo.vscode\extensions\ms-vscode.cpptools-0.27.0\dist\main.js:14075:46)
at Socket.emit (events.js:208:15)
at Pipe. (net.js:588:12)
[2020-04-20 16:30:41.306] [renderer1] [error] net::ERR_CONNECTION_TIMED_OUT: Error: net::ERR_CONNECTION_TIMED_OUT
at SimpleURLLoaderWrapper. (electron/js2c/browser_init.js:2623:21)
at SimpleURLLoaderWrapper.emit (events.js:203:13)

@sean-mcmanus
Copy link
Contributor

@guozc09 That logging is not from the C/C++ channel, but we don't really need those logs. Most likely, the crash is one of the known ones with a fix pending, but if you wanted us to confirm that, you could attach a debugger to the cpptools process before it crashes and then get a crash call stack when the crash occurs.

@iShibi iShibi closed this as completed Apr 28, 2020
@iShibi iShibi reopened this Apr 28, 2020
@iShibi
Copy link
Author

iShibi commented Apr 28, 2020

The error that the server could not be started is still occurring, I can use other plugins smoothly except this one. Whenever I create a C file, the plugin launches itself and throws this error in the output tab of cpptools. I tried to reinstall the plugin but it didn't solve the problem.

@sean-mcmanus
Copy link
Contributor

@shibi391 We have a number of crash fixes pending for our next 0.28.0-insiders release. Our auto-crash restarting also broke in 0.27.0. Using 0.26.3 may be more stable until we get a fix out.

@tenry92
Copy link

tenry92 commented Jun 3, 2020

I'm having this issue as well. It seems to be happening more and more often, while the number of files and codes in my workspace are growing.

I'm not sure, when it happens: once, it occurred after opening a C++ file, but it might just have been a timing issue. It also often happens while I'm working on a file.

VS code version: 1.45.1
OS: Linux Mint 19
cpp tool version: 0.28.2

The related issue #5528 suggested to uninstall the Clang-format extension, however this extension was never installed on my machine.

In my workspace, I set the setting "C_Cpp.loggingLevel" to "Debug" and after getting the server closed error again, I could find the following error logs in "Log (Extension Host)" ("cpptools" still only contains the error message from this issue's title), which seems related:

[2020-06-03 23:40:18.692] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-06-03 23:40:18.692] [exthost] [error] Error: Connection got disposed.
  at Object.dispose (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:3888:25)
  at Object.dispose (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:5410:35)
  at LanguageClient.handleConnectionClosed (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:7492:42)
  at LanguageClient.handleConnectionClosed (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:18121:15)
  at closeHandler (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:7479:18)
  at CallbackList.invoke (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:11870:39)
  at Emitter.fire (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:11928:36)
  at closeHandler (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:3238:26)
  at CallbackList.invoke (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:11870:39)
  at Emitter.fire (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:11928:36)
  at StreamMessageReader.fireClose (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:13903:27)
  at Socket.<anonymous> (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:13943:46)
  at Socket.emit (events.js:208:15)
  at Pipe.<anonymous> (net.js:588:12)

[...]

[2020-06-03 23:40:19.325] [exthost] [error] [ms-vscode.cpptools] provider FAILED
[2020-06-03 23:40:19.325] [exthost] [error] Error: Language client is not ready yet
  at LanguageClient.sendRequest (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:7043:19)
  at /home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36629:67
  at DefaultClient.<anonymous> (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:37595:34)
  at Generator.next (<anonymous>)
  at /home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36218:71
  at new Promise (<anonymous>)
  at module.exports.__awaiter (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36214:12)
  at nextTask (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:37593:34)
  at DefaultClient.queueTask (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:37607:24)
  at DefaultClient.requestWhenReady (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:37643:21)
  at DocumentSymbolProvider.<anonymous> (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36625:48)
  at Generator.next (<anonymous>)
  at /home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36218:71
  at new Promise (<anonymous>)
  at module.exports.__awaiter (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36214:12)
  at DocumentSymbolProvider.provideDocumentSymbols (/home/simon/.vscode/extensions/ms-vscode.cpptools-0.28.2/dist/main.js:36624:32)
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:662:268
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:51:988
  at new Promise (<anonymous>)
  at Object.t.asPromise (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:51:960)
  at v.provideDocumentSymbols (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:662:239)
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:686:725
  at e._withAdapter (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:685:862)
  at e.$provideDocumentSymbols (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:686:703)
  at e._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:788:757)
  at e._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:788:449)
  at e._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:787:69)
  at e._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:785:970)
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:784:213
  at e.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
  at v.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:232:615)
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:957:179
  at e.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
  at v.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:232:615)
  at t.PersistentProtocol._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:237:17)
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:234:155
  at e.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:67)
  at p.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:230:129)
  at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:229:483
  at Socket.t (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:238:565)
  at Socket.emit (events.js:203:13)
  at addChunk (_stream_readable.js:295:12)
  at readableAddChunk (_stream_readable.js:276:11)
  at Socket.Readable.push (_stream_readable.js:210:10)
  at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

@sean-mcmanus
Copy link
Contributor

@tenry92 "Connection to server got closed." is a symptom of the cpptools process crashing, with different potential causes. Can you attach a debugger before the crash occurs to get a call stack of the crashing thread?

@tenry92
Copy link

tenry92 commented Jun 3, 2020

"Unfortunately" this issue did not appear again during the last hour. I uninstalled and installed the cpptools extension, but I'm not sure if it was within that hour (and fixed it) or if I already did so previously and the error came up again anywhere.

When the error appears again, I'll check for the debugger and post an update here.

@Colengms
Copy link
Contributor

Hi @iShibi . Are you still seeing this issue with a recent build of the extension?

@Colengms Colengms self-assigned this Oct 28, 2020
@iShibi
Copy link
Author

iShibi commented Oct 29, 2020

Yes. I just reinstalled the extension v1.0.1 and got the same error. Just to make sure I did everything right, I uninstalled the extension, deleted the extension folder from C:\Users\myName\.vscode\extensions and reinstalled the extension once again. It installs everything correctly but after that, it throws this error: [Error - 12:57:02 pm] Connection to server got closed. Server will not be restarted.

@Colengms
Copy link
Contributor

Hi @iShibi . I asked as this issue is currently blocked due to needing more information. That error message indicates that our native process crashed. We asked if you could attach the debugger to collect call stacks when it crashes, which should point us directly to the issue. Can you attach the debugger to the cpptools process, and collect those stacks for us? Some guidance is here: https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv

@athisun
Copy link

athisun commented Nov 12, 2020

@Colengms I'm not sure this is the case for everyone, but I wasn't able to follow your guide to attach a debugger since the cpptools and cpptools-srv processes are not listed in the process picker, even immediately after restarting vscode or reinstalling the cpptools extension. I'm using cpptools 1.1.1 and having the same issue as above on macOS 10.15.7, vscode 1.51.1.

@Colengms
Copy link
Contributor

Hi @athisun . If you have already seen the message, "Connection to server got closed. Server will not be restarted.", then those processes would no longer be running. If the issue occurs immediately open launch, it's unlikely you'll be able to connect a debugger quickly enough. Rather, that guidance is for when there is some step that seems to cause the issue, and you can connect the debugger before reproducing the issue, to then capture the stack of the crash.

It sounds like the extension is failing for you on initialization. To understand what is happening, could you provide more information, such as the output of the C/C++ channel, if any, with debug logging enabled ("C_Cpp.loggingLevel": "Debug"), any perhaps any other relevant output from VS Code, such as the Extensions output channel, or console output (via Help -> Toggle Developer Tools). Also, I'd suggest creating a new issue to discuss your specific case. The error message "Connection to server got closed. Server will not be restarted." is generic, and could occur due to various different causes.

One common issue on initialization is due to missing or corrupted files. It's possible to have quit VS Code while an extension is in the process of being installed or updated, or while some required files are being downloaded, leaving the extension in a bad state. To rule that out, I'd suggest completely deleting the installation directory of the extension (generally in .vscode\extensions, in your HOME directory), and installing a fresh copy of the extension. You might also try using the offline vsix here, as it is bundled with all dependencies, so does not require additional files to be downloaded.

@athisun
Copy link

athisun commented Nov 12, 2020

Thanks @Colengms. No luck with raising the logging level to debug - the only output from cpptools is the one line [Error - 11:57:15 AM] Connection to server got closed. Server will not be restarted.. The Tasks, Extensions channel remains blank. The C/C++ channel has a single line Finished installing dependencies.

I have tried reinstalling, downgrading to 1.1.0, uninstalling and deleting the extension folder from .vscode\extensions, all with the same result after vscode restart.

I just tried the VSIX file after uninstalling and removing the extension directory from .vscode/extensions, installing via terminal using code --install-extension cpptools-osx.vsix. Installing is successful, but restarting vscode yields the same output and eventually a popup warning "Extension host terminated unexpectedly.".

Curious though that the logging level was remembered through un/re-installs - could this perhaps be caused by an invalid setting?

@Colengms
Copy link
Contributor

@athisun I'm moving this to a new issue: #6503

@github-actions
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
embedded Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests