vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Open file/folder crashes VS Code in Ubuntu 24.04

Open erosman opened this issue 1 year ago • 54 comments

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.89.1
  • OS Version: Ubuntu 24.04

Steps to Reproduce:

  1. Launch VS Code with an open folder
  2. Select any of the following from the File menu and VS Code crashes immediately
  • Open File
  • Open Folder
  • Open Workspace from File

The following work:

  • File -> Open Recent
  • File -> New Window

The following causes a crash:

  • File -> New Window -> Open File -> select a folder to open
  • File -> New Window -> Open Folder -> select a folder to open

There could be an issue with the open file due to changes in GNOME 46 Nautilus.

erosman avatar May 30 '24 12:05 erosman

Can you confirm if the issue is present with latest insiders https://code.visualstudio.com/insiders

deepak1556 avatar May 31 '24 03:05 deepak1556

Can you confirm if the issue is present with latest insiders https://code.visualstudio.com/insiders

There is an error when trying to install.

image

erosman avatar May 31 '24 04:05 erosman

Can someone suggest a workaround for the time being?

erosman avatar Jun 04 '24 07:06 erosman

Have the same issue with vscode installed through Ubuntu Snap. Tried the insiders and regular .deb packages and they seem to work fine.

papanireal avatar Jun 04 '24 09:06 papanireal

@papanireal Which version of Ubuntu are you using?

erosman avatar Jun 04 '24 10:06 erosman

@papanireal Which version of Ubuntu are you using?

24.04

papanireal avatar Jun 04 '24 11:06 papanireal

I tried again with the latest .deb and there is still an error.

image

erosman avatar Jun 04 '24 14:06 erosman

Does this issue occur when all extensions are disabled?: Yes

* VS Code Version: 1.89.1

* OS Version: Ubuntu 24.04

Steps to Reproduce:

1. Launch VS Code with an open folder

2. Select any of the following from the File menu and VS Code crashes immediately


* Open File

* Open Folder

* Open Workspace from File

The following work:

* File -> Open Recent

* File -> New Window

The following causes a crash:

* File -> New Window -> Open File -> select a folder to open

* File -> New Window -> Open Folder -> select a folder to open

There could be an issue with the open file due to changes in GNOME 46 Nautilus.

I had the same problem since I updated VSCode today, it was instant closing, not even opening the main menu. What worked for me was uninstalling all vscode and autoremove after. Then, installing it from the official webpage .deb file, with that, I solved it

Lexslogic avatar Jun 06 '24 01:06 Lexslogic

@papanireal @Lexslogic Are you using Gnome 46 Wayland desktop?

I had the same problem since I updated VSCode today, it was instant closing, not even opening the main menu.

Same here after updating the VSCode from snap. Now, I have lost access to VS Code completely. The issue which was reported, extended to a complete failure.

Next ....

  • Uninstalled VS Code from App Center
  • autoremove --purge
  • Re-installed from App Center
  • Same problem

Next ...

  • Uninstalled VS Code from App Center
  • autoremove --purge
  • Downloaded code_1.90.0-1717531825_amd64.deb from https://code.visualstudio.com/Download
  • Right-click -> Open With... -> GDebi Package Installer
  • "Error: Dependency is not satisfiable: libglib 2.0-0 (>= 2.37.3)" image

Error: Dependency is not satisfiable: libglib 2.0-0 (>= 2.37.3)

MySQL Workbench - Dependency Issue You want the deb for ubuntu 22.04, not 23.10.

erosman avatar Jun 06 '24 05:06 erosman

See also:

erosman avatar Jun 06 '24 07:06 erosman

I had the same issue for three days, but now the Vscode doesnt even start anymore Please fix ASAP

OS: Ubuntu 24.04 (Xorg)

0xfldr avatar Jun 06 '24 11:06 0xfldr

Does the following have any relevance? If so, how can it be fixed?

~/.config/Code/logs/20240607T005226/main.log

2024-06-07 00:52:27.002 [info] update#setState idle 2024-06-07 00:52:27.935 [error] vscode-file: Refused to load resource /snap/code/159/usr/share/code/resources/app/extensions/theme-seti/icons/seti.woff from vscode-file: protocol (original URL: vscode-file://vscode-app/snap/code/159/usr/share/code/resources/app/extensions/theme-seti/icons/seti.woff)

However, there is no /snap/code/159

image

erosman avatar Jun 06 '24 21:06 erosman

From Visual Studio Code crashes on Ubuntu 22.04.4 LTS

This also works (No need to reinstall or downgrade)

code --in-process-gpu

Above works for me too, although ...

$ code --in-process-gpu
Warning: 'in-process-gpu' is not in the list of known options, but still passed to Electron/Chromium.

erosman avatar Jun 07 '24 04:06 erosman

I got same issues today and have been unable to resolve this. Vs code closes almost immediately I attempt to open it. I haven't installed any new extension since I last used it a few hours ago.

arewageek avatar Jun 07 '24 04:06 arewageek

I just resolved mine now. I downloaded the deb file from vscode's site, installed it using: sudo dpkg -i [file_path/file_name.deb]

This solved my isses:

Note: remember to uninstall the previous vscode you have before or after doing this avoid confusions

arewageek avatar Jun 07 '24 04:06 arewageek

I can also confirm that uninstalling via snap & manually installing code_1.90.0-1717531825_amd64.deb fixes the issue.

sudo dpkg -i code_1.90.0-1717531825_amd64.deb

It seems there is an issue with the snap code installation.

No errors in ~/.config/Code/logs/20240607T130517/main.log

Note: Although I exported my settings and extensions before uninstal, snap uninstall didn't remove the extensions from ~/.vscode and everything was there after manually installing above (which was great).

erosman avatar Jun 07 '24 09:06 erosman

I also had VSCode crash on Ubuntu 24.04 but right now, after installing all the updates from apt-get and snap and rebooting, VSCode works fine. I didn't do any hacks to fix it myself (like disabling wayland, etc).

Version: 1.90.0
Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
Date: 2024-06-04T19:43:07.605Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 6.8.0-35-generic snap

Update: VSCode was working fine a day or two with external monitor. Then I unplugged the monitor and VSCode started crashing again. Plugged the monitor back - VSCode works fine :)

valiko-ua avatar Jun 07 '24 16:06 valiko-ua

nope, snap code (160) (=1.90.0) is a total failure. same for the .deb package. what a fubar.

thediveo avatar Jun 07 '24 18:06 thediveo

Same problem here:

vscode-file: Refused to load resource /snap/code/159/usr/share/code/resources/app/extensions/theme-seti/icons/seti.woff from vscode-file: protocol (original URL: vscode-file://vscode-app/snap/code/159/usr/share/code/resources/app/extensions/theme-seti/icons/seti.woff)

gerardo-m avatar Jun 07 '24 21:06 gerardo-m

Same here, but VS Code crashes immediately when starting it.

ubuntu 24.04 vs code 1.90

OliverZott avatar Jun 09 '24 14:06 OliverZott

code --in-process-gpu

I had same issue and it also works for me.

illegal-instruction-co avatar Jun 10 '24 08:06 illegal-instruction-co

If your VSCode crashes immediately you open it. Perhaps you have installed it through the App Center. To solve this issue, Uninstall VSCode from App Center and follow the following steps;

  1. First, download and install the GPG key to trust packages from the Microsoft repository: wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ rm packages.microsoft.gpg

  2. Next, add the Visual Studio Code repository to your system's software sources list: echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list

  3. Finally, update your package lists and install Visual Studio Code: sudo apt-get update sudo apt-get install code

Following these 3 simple steps should definitely fix your issue. Have a great time coding with VSCode!

Olorunnisola01 avatar Jun 10 '24 13:06 Olorunnisola01

just updated the snap version, got 1.90.1 and it doesn't crash anymore

eignatenkov avatar Jun 14 '24 09:06 eignatenkov

It's still crashed on Fedora even with the latest version :/

jonaskahn avatar Jul 15 '24 15:07 jonaskahn

I solved that by removing "recent" items from Open folder dialog, type this in terminal: rm ~/.local/share/recently-used.xbel

michalslime avatar Jul 18 '24 09:07 michalslime

If your VSCode crashes immediately you open it. Perhaps you have installed it through the App Center. To solve this issue, Uninstall VSCode from App Center and follow the following steps;

  1. First, download and install the GPG key to trust packages from the Microsoft repository: wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ rm packages.microsoft.gpg
  2. Next, add the Visual Studio Code repository to your system's software sources list: echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
  3. Finally, update your package lists and install Visual Studio Code: sudo apt-get update sudo apt-get install code

Following these 3 simple steps should definitely fix your issue. Have a great time coding with VSCode!

Thanks @Olorunnisola01 , it works perfect to me

vitorrios1001 avatar Sep 20 '24 12:09 vitorrios1001

The new veraion seems fixed problem

jonaskahn avatar Sep 24 '24 06:09 jonaskahn

This is such a laughable problem to have for Microsoft when they can't stop bragging about how much they love open-source.

postingforever avatar Sep 25 '24 09:09 postingforever

This is happening to me also with the latest snap version on Ubuntu 24.04, but it doesn't happen with all folders and of note it doesn't happen at all in Kubuntu 24.04 with plasma.

asegarra avatar Oct 03 '24 20:10 asegarra

Who said it only happen on snap package is a liar. I am anti-snap person, it is a bug from VScode. Now they seems fix it

jonaskahn avatar Oct 04 '24 05:10 jonaskahn