vscode icon indicating copy to clipboard operation
vscode copied to clipboard

VSCode hangs when opening folder in Ubuntu 24.04

Open guyrt opened this issue 1 year ago • 24 comments

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

  • VS Code Version:
1.88.1
e170252f762678dec6ca2cc69aba1570769a5d39
x64
  • OS Version: Ubuntu 24.04 (fresh install)

Steps to Reproduce:

  1. Fresh install ubuntu and vscode (both installed today - code from apt-get)
  2. open code in any folder like "code ."
  3. VSCode hangs.

Last lines in the verbose logs:

[44656:0430/204913.934951:INFO:CONSOLE(655)] "%cTRACE color: #888 CommandService#executeCommand _setContext", source: vscode-file://vscode-app/snap/code/157/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (655)
[44656:0430/204913.935581:INFO:CONSOLE(655)] "%cTRACE color: #888 [File Watcher (node.js)] stopping file watcher (/XXX/.git/refs/remotes/origin/main (excludes: <none>, includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], correlationId: <none>))", source: vscode-file://vscode-app/snap/code/157/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (655)
[44656:0430/204913.946089:INFO:CONSOLE(655)] "%cTRACE color: #888 [File Watcher (node.js)] Request to start watching: /XXX/.git/refs/remotes/origin/main (excludes: <none>, includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], correlationId: <none>)", source: vscode-file://vscode-app/snap/code/157/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (655)
[44656:0430/204913.946653:INFO:CONSOLE(655)] "%cTRACE color: #888 [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: /XXX/.git/refs/remotes/origin/main (error: Error: ENOENT: no such file or directory, stat '/XXX/.git/refs/remotes/origin/main')", source: vscode-file://vscode-app/snap/code/157/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (655)
[44656:0430/204913.959913:INFO:CONSOLE(655)] "%cTRACE color: #888 [mainThreadSecretState] Getting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/snap/code/157/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (655)

I tried with folders that aren't tracked in git.

guyrt avatar May 01 '24 03:05 guyrt

This is happening with my two fresh Ubuntu 24.04 installs (laptop and desktop). I have tried snap install and apt install. Both fail in the same way: open a folder then click just about anywhere and it locks up vscode.

n7tae avatar May 01 '24 20:05 n7tae

Same experience here.

kmcintyre avatar May 04 '24 08:05 kmcintyre

I did finally figure out that for me, opening a folder that contained a .git directory was the problem. If I moved the .git dir to a different name before trying to open it, the folder opened fine. Of course the git info for that folder was not available.

After that, I decided to go back to Ubuntu 24.04. This time VSCode worked fine. I can't say for sure why it's now working, but I did do something different this time when installing 24.04: This time, I followed my laptop's manufacturer's advice and turned off the "Install 3rd party software for for graphics and wifi...". Then after 24.04 was up I added the specified ppa to download drivers from my manufacturer. After that, I installed VSCode.

Yesterday, I did sudo snap refresh and it upgraded VSCode to 1.89 and it's working fine as well.

n7tae avatar May 04 '24 12:05 n7tae

No update?

EDIT:

Might be related to system Keyring? I was having this issue with the first ever boot session installed with VSCode and it just freezes whenever I open a folder with .git (I'm not sure whether this issue happens recursively).

But after I rebooted it, it suddenly asked for Keyring password, and after I typed it, it works just fine. I don't know. Maybe the Keyring thing is just happned because it was the first run after the first reboot, after VSCode installation, and it was with something else and solved because the reboot has replaced the outdated service for that root cause.

hurryman2212 avatar May 09 '24 07:05 hurryman2212

Same experience even if I open a folder that does not contain .git

Try disable wayland, this may work

https://github.com/microsoft/vscode/issues/212430

liheyuan avatar May 10 '24 10:05 liheyuan

Yes, for me it works when I restart the laptop, after a fresh ubuntu install.

messenjer avatar May 21 '24 14:05 messenjer

have vscode 1.90 snap installed, but doesn't work

(this wayland transition is a total BS show, many other programs also broken on Ubuntu 24.04, and Canomical has the gall to call this LTS ... long-term sh...)

thediveo avatar Jun 07 '24 18:06 thediveo

Same here, freeze, For me happens when starting React/Next project and having a dotnet backend already started by rider.

Ubuntu 24.04, / wayland Version: 1.91.1 Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:08:12.169Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Linux x64 6.8.0-38-generic

augustogava avatar Jul 16 '24 14:07 augustogava

Please check if issue is present with latest insiders https://code.visualstudio.com/insiders

deepak1556 avatar Jul 22 '24 07:07 deepak1556

Please check if issue is present with latest insiders https://code.visualstudio.com/insiders

This is still an issue with insiders (b1c0a14d)

Viicos avatar Aug 01 '24 10:08 Viicos

I had these problems last week, but today it works after I did an Ubuntu update and machine restart! :smiley:

Has the problem been solved?

kristian-trandem-uke avatar Aug 12 '24 09:08 kristian-trandem-uke

I had these problems last week, but today it works after I did an Ubuntu update and machine restart! 😃

Has the problem been solved?

Yes, I tried 2 other app that were not compatible before (virtualbox, nextchat), and they all worked fine after upgrading to the latest Ubuntu 24.04. It seems that Ubuntu fixed this problem, finally ..

liheyuan avatar Aug 12 '24 10:08 liheyuan

It seems mutter ralated pkg fix this problem

mutter (46.2-1ubuntu0.24.04.1) noble; urgency=medium

[ Daniel van Vugt ]

  • New upstream release 46.2 (LP: #2068598)
    • Fixed mouse clicks falling through to the window behind (LP: #2026194) ...

liheyuan avatar Aug 12 '24 10:08 liheyuan

I believe this issue is related to vscode git extension, because vscode hangs when I try to connect to a repository using the git extension

hktari avatar Aug 27 '24 09:08 hktari

I believe this issue is related to vscode git extension, because vscode hangs when I try to connect to a repository using the git extension

Looks like that, in my case it hangs at this point in the log: Checking if encryption is available...

[88468:0827/212931.066403:INFO:CONSOLE(660)] "%cTRACE color: #888 [mainThreadSecretState] Getting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (660)
[main 2024-08-27T19:29:31.066Z] [EncryptionMainService] Checking if encryption is available...

foxdrodd avatar Aug 27 '24 19:08 foxdrodd

Upgrade to latest Ubuntu 24.04.1 will solve those problem, see https://github.com/microsoft/vscode/issues/212430

liheyuan avatar Aug 28 '24 02:08 liheyuan

i'm running linux mint

On Wed, 28 Aug 2024 at 04:03, Coder4 @.***> wrote:

Upgrade to latest Ubuntu 24.04.1 will solve those problem, see #212430 https://github.com/microsoft/vscode/issues/212430

— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/211762#issuecomment-2313942478, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFL5IV3RRHXSOL2UIAJINDZTUVWJAVCNFSM6AAAAABHBNEBOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJTHE2DENBXHA . You are receiving this because you commented.Message ID: @.***>

hktari avatar Aug 28 '24 07:08 hktari

i'm running linux mint On Wed, 28 Aug 2024 at 04:03, Coder4 @.> wrote: Upgrade to latest Ubuntu 24.04.1 will solve those problem, see #212430 <#212430> — Reply to this email directly, view it on GitHub <#211762 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFL5IV3RRHXSOL2UIAJINDZTUVWJAVCNFSM6AAAAABHBNEBOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJTHE2DENBXHA . You are receiving this because you commented.Message ID: @.>

Mint is also a release based on Debian. You can check when this package will have a corresponding Mint upgrade.

mutter (46.2-1ubuntu0.24.04.1) noble; urgency=medium

[ Daniel van Vugt ]

New upstream release 46.2 (LP: #2068598) Fixed mouse clicks falling through to the window behind (LP: #2026194) ...

liheyuan avatar Aug 29 '24 02:08 liheyuan

thanks for the reply. I understand

edit: until mint gets an upgrade, running vscode Version: 1.92.2 does the trick

hktari avatar Aug 30 '24 07:08 hktari

I believe this issue is related to vscode git extension, because vscode hangs when I try to connect to a repository using the git extension

Looks like that, in my case it hangs at this point in the log: Checking if encryption is available...

[88468:0827/212931.066403:INFO:CONSOLE(660)] "%cTRACE color: #888 [mainThreadSecretState] Getting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (660)
[main 2024-08-27T19:29:31.066Z] [EncryptionMainService] Checking if encryption is available...

Fix is to use "password-store": "basic" in ~/.vscode/argv.json ... or start code with --password-store="basic"

bkerler avatar Aug 31 '24 13:08 bkerler

I believe this issue is related to vscode git extension, because vscode hangs when I try to connect to a repository using the git extension

Looks like that, in my case it hangs at this point in the log: Checking if encryption is available...

[88468:0827/212931.066403:INFO:CONSOLE(660)] "%cTRACE color: #888 [mainThreadSecretState] Getting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (660)
[main 2024-08-27T19:29:31.066Z] [EncryptionMainService] Checking if encryption is available...

Fix is to use "password-store": "basic" in ~/.vscode/argv.json ... or start code with --password-store="basic"

Careful! This is not recommended, so if you are gonna use it, make sure to stop using it asap, if the issue gets fixed. See docs

this fallback strategy is, at best, obfuscation, and should only be used if you are accepting of the risk that any process on the system could, in theory, decrypt your stored secrets.

moritztim avatar Sep 05 '24 09:09 moritztim

This happens on my workstation with 22.04.5 LTS. It hangs during Checking if encryption is available... for many seconds. I'm not using wayland.

Version: 1.93.1 Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 Date: 2024-09-11T17:20:05.685Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Linux x64 6.8.0-45-generic

gorghino avatar Sep 27 '24 11:09 gorghino

Same issue. Try to disable wayland by editing '/etc/gdm3/custom.conf' with uncomment WaylandEnable=false but it not worked.

I solved it by remove my version and install again but this time using apt install. Basically : sudo apt auto-remove code then follow the procedure "2. Installing VS Code Using APT on Ubuntu "

Good luck

eckPathtech avatar Oct 10 '24 12:10 eckPathtech

Facing same issue for last two weeks. let'st try to remove and install it again.

Same issue. Try to disable wayland by editing '/etc/gdm3/custom.conf' with uncomment WaylandEnable=false but it not worked.

I solved it by remove my version and install again but this time using apt install. Basically : sudo apt auto-remove code then follow the procedure "2. Installing VS Code Using APT on Ubuntu "

Good luck

IftikharZahid avatar Oct 20 '24 02:10 IftikharZahid

Hey @deepak1556, this issue might need further attention.

@guyrt, you can help us out by closing this issue if the problem no longer exists, or adding more information.

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

For me the issue stopped when I lowered the number of CPU cores from 12 to 4 (VMware WS player 16). It actually improved the speed of the editor when loading by at least 2X (not measured, but pretty feel-able difference). I am not sure why this is happening, but I assume that allocation all of the Host cores actually throttles it indefinitely and this affects somehow the guest.

Didn't have time to investigate further, but lowering the CPU count can help people.

GeorgiIvanovSF avatar Feb 07 '25 04:02 GeorgiIvanovSF