-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Comments
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? |
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. |
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. |
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 If that does not address the issue, please enable debug logging using |
Hi @Colengms ,Thank you for your answer. 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. |
I have similar issue with cpptools 0.27.0. Here's the debug output:
The extension was installed because it was required by PlatformIO extension 1.10.0. |
@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. |
This is the contents of C/C++ output channel, while the original error message was in cpptools output channel. |
VS Code version 1.43 on Windows 10 Corporate Edition, 64GB RAM. |
Same issue here. 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? |
@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. |
I'm having the same issue here VS code version: 1.44.1 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 |
@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. |
Hi @Colengms & @sean-mcmanus : |
@guozc09 please post the contents of C/C++ output channel, the output log you're referring to is in another output channel (cpptools). |
@me21 when an error occurs, the output channel is automatically switched to cpptools. |
@guozc09 you can switch it back manually ;) |
@me21 The following is the output of the log window: |
@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. |
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. |
@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. |
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 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:
|
@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? |
"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. |
Hi @iShibi . Are you still seeing this issue with a recent build of the extension? |
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 |
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 |
@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. |
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 ( 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. |
Thanks @Colengms. No luck with raising the logging level to debug - the only output from cpptools is the one line I have tried reinstalling, downgrading to 1.1.0, uninstalling and deleting the extension folder from I just tried the VSIX file after uninstalling and removing the extension directory from Curious though that the logging level was remembered through un/re-installs - could this perhaps be caused by an invalid setting? |
This issue has been closed automatically because it needs more information and has not had recent activity. |
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.
The text was updated successfully, but these errors were encountered: