microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
9.94k stars 299 forks source link

GitKraken will not start (was working properly after initial install, no update since) #1038

Open vaquilina-work opened 1 year ago

vaquilina-work commented 1 year ago

Windows build number:

10.0.19045.0

Your Distribution version:

22.04

Your WSL versions:

WSL version: 1.2.0.0 Kernel version: 5.15.90.1 WSLg version: 1.0.51 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.2788

Steps to reproduce:

  1. Install GitKraken (https://help.gitkraken.com/gitkraken-client/windows-subsystem-for-linux/)
    wget https://release.gitkraken.com/linux/gitkraken-amd64.deb
    sudo apt install ./gitkraken-amd64.deb
    sudo apt --fix-broken install
  2. Attempt to run gitkraken from terminal
  3. Attempt to run GitKraken from Start Menu (Target: C:\Users\vince\AppData\Local\Microsoft\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_8wekyb3d8bbwe\wslg.exe -d Ubuntu-22.04 --cd "~" -- /usr/share/gitkraken/gitkraken)

WSL logs:

weston.log pulseaudio.log stderr.log versions.txt

WSL dumps:

No response

Expected behavior:

Expected GitKraken to launch from wslg as normal, as it did when I installed it initially.

Actual behavior:

Gitkraken fails to start in any noticeable way, and does not print an error.

dmesg output (from three separate attempts):

[ 4499.173754] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4499.174707] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4499.175436] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4499.176228] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 4499.888391] traps: gitkraken[1759] trap int3 ip:558fd926c92f sp:7ffff499f050 error:0 in gitkraken[558fd5d4c000+71c5000]
[ 4499.889084] potentially unexpected fatal signal 5.
[ 4499.889483] CPU: 16 PID: 1759 Comm: gitkraken Not tainted 5.15.90.1-microsoft-standard-WSL2 #1
[ 4499.889850] RIP: 0033:0x558fd926c92f
[ 4499.889985] Code: 67 8d 00 00 cc cc cc cc cc cc cc 55 48 89 e5 48 83 ec 10 48 89 3d 29 a6 2d 04 48 8d 45 f8 48 89 38 48 89 c7 e8 42 17 e2 fc cc <0f> 0b cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 55 48 89 e5 e8
[ 4499.890592] RSP: 002b:00007ffff499f050 EFLAGS: 00000206
[ 4499.890769] RAX: 00007ffff499f058 RBX: 00000000fffff000 RCX: 00000000fffff000
[ 4499.891045] RDX: 0000000000000000 RSI: 0000558fdd540a00 RDI: 00007ffff499f058
[ 4499.891315] RBP: 00007ffff499f060 R08: 0000558fdd5409c0 R09: 00007ffff499f19e
[ 4499.891586] R10: 0000000000004000 R11: 0000000000000202 R12: 0000000000004000
[ 4499.891852] R13: 00000000fffff000 R14: 0000558fdd540a00 R15: 0000558fdd541408
[ 4499.892116] FS:  00007f476219fe40 GS:  0000000000000000
[ 4521.391237] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4521.392194] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4521.392989] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4521.393574] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 4522.103720] traps: gitkraken[1811] trap int3 ip:55738509392f sp:7ffcd78311f0 error:0 in gitkraken[557381b73000+71c5000]
[ 4522.104318] potentially unexpected fatal signal 5.
[ 4522.104630] CPU: 17 PID: 1811 Comm: gitkraken Not tainted 5.15.90.1-microsoft-standard-WSL2 #1
[ 4522.104931] RIP: 0033:0x55738509392f
[ 4522.105062] Code: 67 8d 00 00 cc cc cc cc cc cc cc 55 48 89 e5 48 83 ec 10 48 89 3d 29 a6 2d 04 48 8d 45 f8 48 89 38 48 89 c7 e8 42 17 e2 fc cc <0f> 0b cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 55 48 89 e5 e8
[ 4522.105705] RSP: 002b:00007ffcd78311f0 EFLAGS: 00000206
[ 4522.105889] RAX: 00007ffcd78311f8 RBX: 00000000fffff000 RCX: 00000000fffff000
[ 4522.106148] RDX: 0000000000000000 RSI: 0000557389367a00 RDI: 00007ffcd78311f8
[ 4522.106402] RBP: 00007ffcd7831200 R08: 00005573893679c0 R09: 00007ffcd783133e
[ 4522.106719] R10: 0000000000004000 R11: 0000000000000202 R12: 0000000000004000
[ 4522.106977] R13: 00000000fffff000 R14: 0000557389367a00 R15: 0000557389368408
[ 4522.107250] FS:  00007fcf7f955e40 GS:  0000000000000000
[ 4540.841479] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4540.842589] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4540.843766] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 4540.844495] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 4541.567157] traps: gitkraken[1844] trap int3 ip:56023f9e492f sp:7fff6b0a4910 error:0 in gitkraken[56023c4c4000+71c5000]
[ 4541.567841] potentially unexpected fatal signal 5.
[ 4541.568185] CPU: 19 PID: 1844 Comm: gitkraken Not tainted 5.15.90.1-microsoft-standard-WSL2 #1
[ 4541.568607] RIP: 0033:0x56023f9e492f
[ 4541.568749] Code: 67 8d 00 00 cc cc cc cc cc cc cc 55 48 89 e5 48 83 ec 10 48 89 3d 29 a6 2d 04 48 8d 45 f8 48 89 38 48 89 c7 e8 42 17 e2 fc cc <0f> 0b cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 55 48 89 e5 e8
[ 4541.569465] RSP: 002b:00007fff6b0a4910 EFLAGS: 00000202
[ 4541.569639] RAX: 00007fff6b0a4918 RBX: 00000000fffff000 RCX: 00000000fffff000
[ 4541.569900] RDX: 0000000000000000 RSI: 0000560243cb8a00 RDI: 00007fff6b0a4918
[ 4541.570203] RBP: 00007fff6b0a4920 R08: 0000560243cb89c0 R09: 00007fff6b0a4a5e
[ 4541.570463] R10: 0000000000004000 R11: 0000000000000202 R12: 0000000000004000
[ 4541.570716] R13: 00000000fffff000 R14: 0000560243cb8a00 R15: 0000560243cb9408
[ 4541.570966] FS:  00007fe5c9890e40 GS:  0000000000000000
xrafhue commented 1 year ago

Hi, @vaquilina-work

I'm facing a similar issue where launching the 'gitkraken' command in the terminal does not result in anything happening. I have installed 'gedit' to check if the 'g' in 'wslg' is working properly. However, I couldn't find any logs related to 'gitkraken' to investigate why the application is not launching. Have you found a solution to make 'gitkraken' work with repositories located in WSL? In m'y case i am trying to open it as root an not à standard user it is also your case ?

Thanks in advance for your response.

Best regards,

Rafael

vaquilina-work commented 1 year ago

Hi, @xrafhue

In my case, it turned out that Windows Update was quietly updating the driver for my integrated graphics (Intel UHD 630). As far as I'm aware, wslg only works with specifed vGPU drivers (as per https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps).

Disallowing Windows Update from including driver updates and rolling back the driver solved the issue for me.

mosullivan93 commented 1 year ago

For future reference: I've found that when troubleshooting GPU issues with Electron based programs (e.g. GitKraken/Slack/Discord), it is sometimes helpful to disable hardware acceleration using the --disable-gpu command line option.

For example, on my Ubuntu desktop I had prioritised the integrated graphics using the prime profiles in the NVIDIA X settings program. The time GitKraken stopped working I eventually figured out it was getting confused with the GPU acceleration. I tried editing /usr/share/applications/gitkraken.desktop to change the Exec line to Exec=/usr/share/gitkraken/gitkraken --disable-gpu %U. After refreshing the desktop database with sudo update-desktop-database I could run GitKraken again.

Of course, in a similar vein, if you knew the full path to the executable you could try launching it from a terminal instead of the .desktop file so you can see the error messages directly to gleam the problem. You might need to vary the instructions slightly for your distribution (i.e. This anecdote was relevant to native Ubuntu so WSLg will be a little different) but it can help narrow down the issue.

RickBruyninckx commented 1 year ago

I've got the exact same issue (and errors). The problem is not wslg because gedit and other wslg applications work perfectly fine. I've also tried reinstalling the application and removing the .gitkraken folder.

Edchja commented 1 year ago

@RickBruyninckx Can you try this please? It worked for me and since then gitkraken is working fine again.

Hi, @xrafhue

In my case, it turned out that Windows Update was quietly updating the driver for my integrated graphics (Intel UHD 630). As far as I'm aware, wslg only works with specifed vGPU drivers (as per https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps).

Disallowing Windows Update from including driver updates and rolling back the driver solved the issue for me.

alensa commented 11 months ago

Removing gitkraken folder from home/config and running gitkraken --disable-gpu as user helped, also there must be no custom export for DISPLAY.

rpoenaru commented 11 months ago

I was also facing this problem with WSL2. By rolling back my Intel Drivers to 30.0.101.1338 fixed the issue for me. I can open GitKraken from the WSL2 terminal just as before. Thanks, @vaquilina-work

sneurlax commented 7 months ago

... Of course, in a similar vein, if you knew the full path to the executable you could try launching it from a terminal instead of the .desktop file so you can see the error messages directly to gleam the problem. You might need to vary the instructions slightly for your distribution (i.e. This anecdote was relevant to native Ubuntu so WSLg will be a little different) but it can help narrow down the issue.

I followed this line of troubleshooting and got the error:

/usr/share/gitkraken# ./gitkraken
[1214/142210.519989:FATAL:electron_main_delegate.cc(293)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Trace/breakpoint trap

so I launch it like

/usr/share/gitkraken# ./gitkraken --no-sandbox

it runs, throwing the following errors:

[817:1214/142221.755376:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
(node:789) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `gitkraken --trace-deprecation ...` to show where the warning was created)
state:  unavailable
Error: Path must be a valid path to a file or a directory.
    at buildNSFW (/usr/share/gitkraken/resources/app.asar/node_modules/nsfw/js/src/index.js:74:11)
The above error occurred in task call

(node:789) UnhandledPromiseRejectionWarning: Error: Path must be a valid path to a file or a directory.
    at buildNSFW (/usr/share/gitkraken/resources/app.asar/node_modules/nsfw/js/src/index.js:74:11)
(node:789) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
(node:789) UnhandledPromiseRejectionWarning: Error: bad request
    at buildError (/usr/share/gitkraken/resources/app.asar/src/main/static/main.bundle.js:2:1465798)
    at IncomingMessage.<anonymous> (/usr/share/gitkraken/resources/app.asar/src/main/static/main.bundle.js:2:1466782)
    at IncomingMessage.emit (node:events:513:28)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
(node:789) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
state:  checking
state:  unavailable

and looking like this Screenshot (1)

--disable-gpu does not resolve this issue=, so gitkraken remains mostly unusable for me on WSL2.

sneurlax commented 7 months ago

After a restart, this works for me! Thanks for the tips, everyone. Not sure why a reboot was needed to make it stick. In the end I had to edit /usr/share/applications/gitkraken.desktop to change the Exec line to Exec=/usr/share/gitkraken/gitkraken --no-sandbox %U & disown and refreshing the desktop database with sudo update-desktop-database

edit: aaand it's broken again

GiulioDallaVecchia commented 1 week ago

The problem that I've notice it's that when I try to start GitKraken with a default user everything is ok, but if I try to start GitGraken with the root user the problem appears. (with the root user I have to add --no-sandbox)

If you want to lunch GitKraken from root user you have to modify the file in /usr/share/gitkraken/resources/bin/gitkraken.sh like below:

"ELECTRON_RUN_AS_NODE=1 "$GITKRAKEN" "$CLI" "--no-sandbox" "$@""