For Ubuntu/GNOME Visual Studio Code users, the Credential Manager can be accessed by launching the "Passport and Keys" application. You can delete the Visual Studio Code/GitHub entry by clicking "Password", looking for the entry and delete
Overview
Microsoft Visual Studio Code is software Microsoft makes available for free at https://code.visualstudio.com/Download. While Microsoft generally fixes issues the crop up on Windows operating systems, they have very little incentive to patch issues the crop up on their competitors operating systems, this results in a variety of issues that are known, have workarounds posted, but have not had their underlying issues solved.
VS Code requires free quota, aka free space to write files, to work. If you are getting multiple error messages at one time or ssh via terminal works while VS code does not, the most likely culprit is being over quota: VS Code not being able to write the files it needs, and thus generating other errors.
See Solution 5 below or Why can't I login graphically? : Going over quota
VS Code requires either a wired campus internet connection or the VPN to connect to the CSIL and Honea computers even if you are on Eduroam or UCSB Secure.
If you have a weak or unstable connection, VS Code tries to compensate by using less secure methods to connect, several of which are explicitly blocked by the campus border firewalls.
Use the VPN to ensure a secure connection in all circumstances. If you visit https://next.noc.ucsb.edu/ip and do not see "On-campus address" you need to restart your VPN connection.
please see: VPN FAQ
Problem 1
When accessing the software remotely from a Mac computer, certain keys do not work as intended. symptoms include pressing AltGr acts as Backspace
, pressing C acts as ArrowLeft
, or pressing e acts a delete, etc.
Solution 1
VS Code on Linux dispatches keybindings using scan codes to accommodate various keyboard layouts. This works well when sitting physically at the machine and the OS is the one creating keyboard events, but some virtualization / remote desktop software creates keyboard events with incorrect scan codes.
go to file >> preferences>>settings
search for "keyboard"
click on "keyboard" (bottom one)
use "keyboard.dispatch": "keyCode" in your settings instead of "Code"
restart VS Code.
Problem 2
On a Mac or Linux computer, pressing key combinations results in no action. If solution 1 does not work, this might help
Solution 2
go to file >> preferences>>keyboard shortcuts
search for the action you want to the combination to call
- Right click on the listed combination and then click "remap"
- type the combination you want to use and then click enter
Problem 3
Microsoft Visual Studio Code is consuming a lot of CPU
Solution 3
High CPU consumption is often caused by an issue in an extension, especially if running remotely or from a non-windows environment. VS Code running multiple processes and extensions are executed by the Extension Host
process.
Find out whether an extension is causing the high CPU load. You can open the Process Explorer using Help>Open Process Explorer
to open a new window with a continuously updating list of VS Code processes.
Disable extensions one at a time to see if that extension is the one causing an issue
Problem 4
Microsoft Visual Studio Code is giving useless error messages
Solution 4
Problem 5
Microsoft Visual Studio Code is not allowing a person to login to a remote computer, also known as a remote target after said remote computer has not been used for some time.
or
Microsoft Visual Studio Code is not allowing a person to login to a remote computer such a CSIL, but you are still able to login via ssh and terminal
Solution 5
This is actually multiple possible problems 1) saved credentials do not match current credentials or 2) saved computer does not match current computer or 3) unspecified other permissions issue, but since the VS error message can be the same as well as the solution, we are lumping them together. If its a type 3) situation, please see Solution 4 above or 4) you don't have quota space in your CoE home directory to write the files VS code needs to write.
"Host key verification failed" means that the host key of the remote host was changed. This happens after major changes such as when we reimage our computers every quarter.
VS code will stop you from connecting because it can also be a sign of spoofing, that the remote computer is not the one you think it is. So good security if you assume your remote computer never changes, which is a bad assumption in our case.
If you have a saved entry for csil.cs.ucsb.edu or linux.engr.ucsb.edu for example you may need to delete and readd said entry.
"invalid credentials" means that you changed your password and your current credentials do not match your saved credentials.
Once you clear credentials from the current instance, some extensions may prompt for authentication the next time you open VS Code. You can continue working in the current session.
"permission denied" can be either of the above as well as several other errors. e.g. your are using your ECE or UCSBnetID credentials on a CoE computer or vice versa. See Solution 4 above.
"over quota" means you have used up your quota, you allocation of space and files, and cannot write the files that VS code needs to write to in order to login. In most cases you will still be able to connect via ssh and terminal. Solution is the same as Solution 4 above.
- If you are over quota please see Why can't I login graphically? : Going over quota
#To see your current quota: quota -s USERNAME #To see your 10 biggest files: top10 #To see the size of a specific directory such as .cache du -sh example_directory du -sh .cache #Misconfigured VS code logs set to never delete anything is a common cause of quota issues #To clear your cache clearcache
Solution 5 (Long Term Mitigation)
VS Code Logs, general cache, and intellisense (a.k.a. cpp tools) cache all can grow exponentially depending on your settings. RAM and CPU usage can also grow exponentially. Setting hard limits in settings is generally a good idea. One user reported that with no limits set, their caches grew at 45 GB per hour until it completely filled their hard drive and crashed their computer.
MacOS: File > Preferences (Code > Preferences or Code > Settings on macOS) > Settings.
PC: in VSCode --> Ctrl + SHIFT + P --> type: settings --> click: "Preferences: Open Settings (JSON)"
>/dev/null 2>&1
or a test file or set to a preset maximum sizeExternal Sources of information
https://code.visualstudio.com/docs/getstarted/settings
https://github.com/microsoft/vscode/wiki
Problem 6
After being over quota, issues are still happening despite now being under quota.
Solution 6
Unfortunately when you hit the quota limit and can no longer write to files, things do not close neatly and can get corrupted.
You may need to delete the following in your CoE account:
- .vscode
- .vscode-server
- .ICEauthority
- .cache
You may also need to delete and re-add the following on your personal computer:
- saved entry for csil.cs.ucsb.edu or linux.engr.ucsb.edu or whichever system is non accessible
- saved account, username or passwords in vscode
- vscode local cache
Rebooting is recommended. Many operating systems hold stuff in memory or cache and will not let go of changed files until you either reboot or force a recheck.
Related articles