vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

VS Code hangs with GitLens on Ubuntu 24.04

Open anatoli26 opened this issue 1 year ago • 22 comments

Description

On a fresh Ubuntu 24.04 under a new user VS Code works well, but when installed GitLens (no other extension installed, nor any config changes made), after a restart it just hangs after some 3 seconds and a popup to Force Quite the app appears.

GitLens Version

15.0.4

VS Code Version

Version: 1.89.1 Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:16:23.416Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.8.0-31-generic snap

Git Version

git version 2.43.0

Logs, Screenshots, Screen Captures, etc

No response

anatoli26 avatar May 25 '24 23:05 anatoli26

Can you please enable debug logging by running the GitLens: Enable Debug Logging command from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens & GitLens (Git) channels in the Output pane.

Once enabled, please reproduce the issue, and attach the logs from the GitLens and GitLens (Git) channels.

Thank you!

eamodio avatar May 31 '24 01:05 eamodio

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

github-actions[bot] avatar Jun 07 '24 05:06 github-actions[bot]

Can't reproduce it anymore with GitLens 15.1.0.

By the way, just in case the problem appears again, where the debug log gets written? I mean, the issue was that the entire vscode was freezing/hanging a few seconds after start, so I guess there would be no way to see anything inside the UI.

anatoli26 avatar Jun 10 '24 00:06 anatoli26

@anatoli26 you should be able to see the path of the log by opening the output in the editor

Screenshot 2024-06-26 at 6 31 04 PM

jkelroy avatar Jun 27 '24 00:06 jkelroy

изображение It regularly happens for "search and compare". Ubuntu 24.04, Gnome, Wayland.

Version: 1.91.1 Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:08:12.169Z (1 wk ago) Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.91.1 Chrome/122.0.6261.156 Electron/29.4.0 Safari/537.36

GitLens — Git supercharged v15.2.0

lampslave avatar Jul 22 '24 11:07 lampslave

gitlens.log "Keep waiting" was pressed two times before log was copied.

lampslave avatar Jul 22 '24 11:07 lampslave

image

after installing gitlense unable to use vs studio code. it crashing immediately so unable to remove extension

nithinpgit avatar Sep 01 '24 17:09 nithinpgit

have same issue as nithinpgit, fresh install of ubuntu 24.04 and vscode will be bricked after installing gitlens

lowkin18 avatar Sep 03 '24 23:09 lowkin18

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug.

It would be great if someone who can reproduce this could open an issue on the VS Code repository.

Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not.

Does this happen with any other extensions?

eamodio avatar Sep 04 '24 02:09 eamodio

VScode is not responding after install gitlen extensions

phhkhuong18i1 avatar Sep 11 '24 08:09 phhkhuong18i1

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug.

It would be great if someone who can reproduce this could open an issue on the VS Code repository.

Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not.

Does this happen with any other extensions?

On macos, After disabling the gitlense extension VS code works perfectly fine but when gitlense is enabled VS code completely hangs and cannot to anything ex: "search", "intellisense", "code completion", "file save" etc. nothing works and is hanged.

abhijit-baldawa avatar Sep 12 '24 17:09 abhijit-baldawa

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug.

It would be great if someone who can reproduce this could open an issue on the VS Code repository.

Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not.

Does this happen with any other extensions?

None of the other extensions triggered this. The last one that worked (tried jumping from each major version to the next, then mediums) was 11.7.0.

Copilot apparently does the same.

L.E. After reinstalling using the downloaded package and relogging in the user, both extensions worked for me. (not crashing anymore, didn't test yet)

AlexMCon avatar Sep 20 '24 09:09 AlexMCon

We are looking into this, but right now are completely unsure how GitLens could possibly affect VS Code in this way (extensions are run in a separate process) without a VS Code bug. It would be great if someone who can reproduce this could open an issue on the VS Code repository. Also, if you are currently stuck, you can always run code --disable-extension eamodio.gitlens to disable GitLens, or code --uninstall-extension eamodio.gitlens to uninstall it. Please let us know if disabling resolves the issue or not. Does this happen with any other extensions?

None of the other extensions triggered this. The last one that worked (tried jumping from each major version to the next, then mediums) was 11.7.0.

Copilot apparently does the same.

L.E. After reinstalling using the downloaded package and relogging in the user, both extensions worked for me. (not crashing anymore, didn't test yet)

Yes, no other extension does this. @eamodio I debugged VS code for this and I found how gitlense completely blocks VS code from functioning (no autocomplete, no formatting, not able to save the file nothing).

1] Go to Help -> Open process explorer 2] extensionHost[1] -> This utilizes 100% CPU and is displayed there. I also opened mac activity monitor and confirmed that it was indeed using the full 100% of the CPU core (I have M3 mac pro, so its 12 core cpu and one core was fully blocked here)

Now, once I disabled gitlense, the extensionHost[1] CPU usage immediately went down (almost 0%) and VS code started working right away. All of my team mates (6 people) faced the exact same issue on VS code (Mac/Windows everywhere). They all disabled gitlense and their VS code also immediately started work again.

Honestly, it is a bummer as we all were using gitlense but now we cannot use it in our VS code anymore till it is fixed. Is it possible for you to share if the Gitlense core team is planning to fix it?

abhijit-baldawa avatar Sep 25 '24 15:09 abhijit-baldawa

@abhijit-baldawa We are unable to reproduce this and really need more help trying to get to the bottom of it.

Can you provide logs or details as to the other OS's up until now we've only heard this on Ubuntu. Does this happen all the time, only when you open specific repos, or? Are you using other extensions, remote, etc? Can you try in isolation?

eamodio avatar Sep 25 '24 15:09 eamodio

@abhijit-baldawa We are unable to reproduce this and really need more help trying to get to the bottom of it.

Can you provide logs or details as to the other OS's up until now we've only heard this on Ubuntu. Does this happen all the time, only when you open specific repos, or? Are you using other extensions, remote, etc? Can you try in isolation?

Thanks for responding. Below are the answers to your questions. 1] Dev's in my team are using Mac and window's (I am on macos).

2] It happens every single time the moment VS code is opened with any TS file (or just within 10 seconds of interacting in VS code like opening any TS file or performing search/git or any operation in IDE). This is not a corner case.

3] I tried VS code with only gitlense installed and every other plugin completely disabled (or even uninstalled). The moment gitlense is enabled VS code does not work and the moment gitlense is disabled everything else in VS code works. If i just disable gitlense and enable every other plugin, VS code works fine. The problem occurs only when gitlense is enabled. You can switch files but as I said, no autocomplete, no git marker of any changed lines, no search, no code jumping nothing works. The only thing works is you can switch between files.

Regarding your question on logs, I don't know which logs you want and how to collect them. I just shared that when gitlense is enabled the extensionHost[1] shows 100% cpu utilization and the moment it is disabled then the CPU utilization goes down completely. This highlights that gitlense is either completely blocking the plugins host of VS code or, in-between VS code and gitlense communication, VS code extensionHost is being blocked by VS code due to improper communication from gitlense side. I have no idea about the internals of vs code and how it interacts with the plugins. Maybe this helps and let me know which logs you may potentially need.

abhijit-baldawa avatar Sep 25 '24 16:09 abhijit-baldawa

So if you clone the GitLens repo to a normal folder on your disk, and then open that folder in VS Code, GitLens will cause VS Code to hang? There HAS to be something unique/special here -- is there anything else unique about your machine/setup?

What version of Git do you have installed? Do you have any anti-virus or other security software installed?

eamodio avatar Sep 26 '24 21:09 eamodio

So if you clone the GitLens repo to a normal folder on your disk, and then open that folder in VS Code, GitLens will cause VS Code to hang? There HAS to be something unique/special here -- is there anything else unique about your machine/setup?

What version of Git do you have installed? Do you have any anti-virus or other security software installed?

1] No it doesn't happen on all repos. So, if I clone the gitlense repo to a normal folder and open in VS codr then gitlense will not cause hangup

2] Recently we merged a BIG PR from one of our feature branch to main branch and only after that gitlense grinds VS code to a halt (as I have explained in few of my previous comments). Only in that repo do we see this problem on EVERY dev VS code (installed on windows/mac etc.). The Irony is that the feature branch NEVER gave any issue with gitlense either but only after the merge with the main branch, gitlense seems to be struggling on the main branch for all dev's. As soon as we open our main repo in vs code in any dev's computer, gitlense grinds vs code to a halt. We now all have disabled gitlense and only after that VS code is perfectly working fine on all dev's computers.

3] I somehow captured the attached gitlense logs last time and today as well but it contains personal information about the computer details/folder and our organisation github repos. So, I cannot share it here.

4] Git version on my mac git version 2.39.3 (Apple Git-146)

5] No antivirus software or anything. As I said after the merge of a big PR to the main branch, gitlense started giving problems and disabling it was the only solution to make vscode work properly.

I hope I have provided you all the information you need. Let me know if you need anything.

abhijit-baldawa avatar Sep 27 '24 14:09 abhijit-baldawa

Unfortunately not, without out logs or having access to the repository we don't have anything to go on.

Not sure if it will work/help or not, but could also try profiling the extension host with all other extensions disabled: https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

eamodio avatar Sep 27 '24 19:09 eamodio

Unfortunately not, without out logs or having access to the repository we don't have anything to go on.

Not sure if it will work/help or not, but could also try profiling the extension host with all other extensions disabled: https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

I hope you understand that attaching log file with my computer private details and our organization's repo's on a publicly accessible github page is not a good idea. I can share the logs on a private channel ex. via email or other channel that are more private if that is a possibility.

https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions

Thanks for sharing this information but I have already used this link to go too deep into profiling, using extension bisect and even have CPU logs and create flame charts out of it. But clearly this issue is caused because of gitlense so those vscode logs are not of much use. VS Code teams suggest addressing these issues directly with the plugin creators since this is clearly not a problem with VS Code internals; therefore, those logs are not very helpful.

But, I do have full gitlense logs and I can share that via a more private channel. let me know.

abhijit-baldawa avatar Sep 27 '24 21:09 abhijit-baldawa

Reference this issue and send the logs here: https://help.gitkraken.com/gitlens/gl-contact-support/?product_s_=GitLens

As for the profiling, you didn't send us the profile. It captures the extension host process which is running GitLens, so it should allow us some insights into what is going on/stuck.

eamodio avatar Sep 28 '24 04:09 eamodio

Reference this issue and send the logs here: https://help.gitkraken.com/gitlens/gl-contact-support/?product_s_=GitLens

As for the profiling, you didn't send us the profile. It captures the extension host process which is running GitLens, so it should allow us some incites into what is going on/stuck.

I have sent the CPU profile and gitlense logs using https://help.gitkraken.com/gitlens/gl-contact-support/?product_s_=GitLens

Please let me know if you have everything you need to debug and potentially fix the issue.

abhijit-baldawa avatar Oct 07 '24 15:10 abhijit-baldawa

I'm not sure if and how this is related, but I had the exact same problem. Coming from a working system on Ubuntu 20, I just launched a freshly installed Ubuntu 24.04.1 installation, installed VScode via snap, opened my project folder which auto installs the recommended extensions (along with git lense). VScode seemed to clearly get stuck on the git lens installation. After restarting code it got stuck on loading the git lens installation page every time.

Long story short, I killall'd code, restarted via code --verbose which got stuck after:

[99692:1020/104055.650094:INFO:CONSOLE(35)] "%cTRACE color: #888 [mainThreadSecretState] Getting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/snap/code/172/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (35)
[main 2024-10-20T08:40:55.650Z] [EncryptionMainService] Checking if encryption is available...

I tried some things, but at least after disabling this check: Image

and doing

gnome-keyring-daemon --replace

I managed to get everything to work again. Now I can't reproduce the problem anymore, even if I renable the check. So I can't give you the exact steps to fix it. In any case, maybe it gives some hints where to look.

kevindehecker avatar Oct 20 '24 09:10 kevindehecker

I just had this happen, Debian 12, fresh install today. I can't confirm but suspect this might be down to Gnome Keyring and never having entered the password for your key. Once I did this, the hang stopped.

synecticosint avatar Oct 21 '24 14:10 synecticosint

I'm not sure if and how this is related, but I had the exact same problem. Coming from a working system on Ubuntu 20, I just launched a freshly installed Ubuntu 24.04.1 installation, installed VScode via snap, opened my project folder which auto installs the recommended extensions (along with git lense). VScode seemed to clearly get stuck on the git lens installation. After restarting code it got stuck on loading the git lens installation page every time.

Long story short, I killall'd code, restarted via code --verbose which got stuck after:

[99692:1020/104055.650094:INFO:CONSOLE(35)] "%cTRACE color: #888 [mainThreadSecretState] Getting password for vscode.github-authentication extension:  github.auth", source: vscode-file://vscode-app/snap/code/172/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (35)
[main 2024-10-20T08:40:55.650Z] [EncryptionMainService] Checking if encryption is available...

I tried some things, but at least after disabling this check: Image

and doing

gnome-keyring-daemon --replace

I managed to get everything to work again. Now I can't reproduce the problem anymore, even if I renable the check. So I can't give you the exact steps to fix it. In any case, maybe it gives some hints where to look.

I can confirm that this worked for me

(fresh install of both ubuntu and vscode, installing the gitlens app crashed vscode at startup. I couldn't confirm if the bug is specific to gitlens or more broadly related to vscode and ubuntu 24, as gitlens is among the very first extensions i install every time)

JulienMasgonty avatar Oct 24 '24 00:10 JulienMasgonty

Reference this issue and send the logs here: https://help.gitkraken.com/gitlens/gl-contact-support/?product_s_=GitLens

As for the profiling, you didn't send us the profile. It captures the extension host process which is running GitLens, so it should allow us some insights into what is going on/stuck.

Do you have any update since I sent detailed logs of the issue 2 weeks ago? Please let me know if you need anything else from me but, if possible, it would be good to know if the problem was identified?

abhijit-baldawa avatar Oct 24 '24 07:10 abhijit-baldawa

using "gnome-keyring-daemon --replace" fixed my issue

but it's weird that this keyring issue causes a vscode extantion to completely freeze

ans-artal avatar Oct 24 '24 10:10 ans-artal

using "gnome-keyring-daemon --replace" fixed my issue

but it's weird that this keyring issue causes a vscode extantion to completely freeze

I am using macos and this solution is not applicable to the issue I raised and send my logs. There is still issue with the gitlense extension for mac/windows

abhijit-baldawa avatar Oct 24 '24 14:10 abhijit-baldawa

for my part I had exactly the same problem (instant freeze) with the "Codeium AI" extension (either of those two was enough).

If it is also the case for you then it is probably the same cause as for me, in this case you might try to find the equivalent of the 'gnome keyring' in macos / window and reset it

hope this helps

ans-artal avatar Oct 24 '24 15:10 ans-artal

Reference this issue and send the logs here: https://help.gitkraken.com/gitlens/gl-contact-support/?product_s_=GitLens

As for the profiling, you didn't send us the profile. It captures the extension host process which is running GitLens, so it should allow us some insights into what is going on/stuck.

@eamodio Do we have any update on this since I send you the logs a month ago? Would be nice to know if this is on cards for the team there or would it be possibly fixed?

abhijit-baldawa avatar Nov 21 '24 08:11 abhijit-baldawa