GWSL-Source icon indicating copy to clipboard operation
GWSL-Source copied to clipboard

SystemExit Exception

Open nicola-lunghi opened this issue 3 years ago • 30 comments

If in windows I click the Exit button I got the following exception:

2022-06-27 12:37:05,512 - __main__ - ERROR - Exception occurred in main loop
Traceback (most recent call last):
  File "main.py", line 615, in main
SystemExit
2022-06-27 12:37:11,727 - __main__ - ERROR - Exception occurred - Cannot Start Service. Make sure the settings file is not corrupted.
Traceback (most recent call last):
  File "main.py", line 615, in main
SystemExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 697, in <module>
  File "main.py", line 621, in main
SystemExit

GWSL version 1.4.0 from Microsoft store

the issue could be here?

https://github.com/Opticos/GWSL-Source/blob/20e53a825a7ef9b3233f253681caa820bdb3add9/manager.py#L1222-L1227

nicola-lunghi avatar Jun 27 '22 11:06 nicola-lunghi

Seeing the same issue: GWSL 1.4.0 from MS Store Edition Windows 10 Enterprise Version 21H2 Installed on ‎28/‎09/‎2021 OS build 19044.1826 Experience Windows Feature Experience Pack 120.2212.4180.0

App closed because the X server service fails. Running 'GWSL_vcxsrv.exe' from the terminal gives the following:

$ ./GWSL_vcxsrv.exe
Welcome to the VcXsrv X Server
Vendor: The VcXsrv Project
Release: 1.20.9.0

OS: Windows NT 6.2 build 9200 (64-bit)
Contact: [email protected]

LoadPreferences: C:\Users\Tokarz.SIT\.XWinrc not found
LoadPreferences: Loading C:\Users\Tokarz.SIT\AppData\Roaming\GWSL\VCXSRV\system.XWinrc
Segmentation fault

jrtokarz avatar Aug 02 '22 08:08 jrtokarz

Hmm. Is this only on exit @jrtokarz ?

Pololot64 avatar Aug 05 '22 15:08 Pololot64

@Pololot64 no, this is on starting GWSL

jrtokarz avatar Aug 05 '22 17:08 jrtokarz

After the 1.4.5 update, it stopped working for me with this same issue,

Installed through the windows store version GWSL 1.4.5 WSL 2 Windows 11 21H2 (Build:22000.1455)

Dashboard log is empty

service log

2023-01-30 14:45:05,964 - __main__ - ERROR - Exception occurred in main loop
Traceback (most recent call last):
  File "main.py", line 675, in main
SystemExit
2023-01-30 14:45:06,434 - __main__ - ERROR - Exception occurred - Cannot Start Service. Make sure the settings file is not corrupted.
Traceback (most recent call last):
  File "main.py", line 675, in main
SystemExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 757, in <module>
  File "main.py", line 681, in main
SystemExit

happy to provide with any other info

hemanta212 avatar Jan 30 '23 09:01 hemanta212

After the 1.4.5 update, it stopped working for me with this same issue,

Installed through the windows store version GWSL 1.4.5 WSL 2 Windows 11 21H2 (Build:22000.1455)

Dashboard log is empty

service log

2023-01-30 14:45:05,964 - __main__ - ERROR - Exception occurred in main loop
Traceback (most recent call last):
  File "main.py", line 675, in main
SystemExit
2023-01-30 14:45:06,434 - __main__ - ERROR - Exception occurred - Cannot Start Service. Make sure the settings file is not corrupted.
Traceback (most recent call last):
  File "main.py", line 675, in main
SystemExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 757, in <module>
  File "main.py", line 681, in main
SystemExit

happy to provide with any other info

Could you upload your settings file? (Make sure there is no personal info in it first)

Pololot64 avatar Jan 30 '23 13:01 Pololot64

is it the settings.json file stored in the same dir as logs ? (i.e at %AppData%/GWSL/), I suppose so

http://sprunge.us/ljh8C1

hemanta212 avatar Jan 30 '23 13:01 hemanta212

Wait. Is gwsl failing to run or are Linux apps failing to run?

Pololot64 avatar Jan 30 '23 13:01 Pololot64

It appears the gwsl is giving those errors when it starts, basically, when I run gwsl at the windows startup it appears in the tray but viewing its logs shows the above errors. Opening wsl and running GUI apps don't work either and don't add any errors to the log.

exiting the gwsl from the tray and relaunching it again appends same error in the log.

I do have enabled the wslg GUI in the .wslconfig file but the shell configuration by default exports the DISPLAY to point to GWSL, when I run Linux apps through a command like

DISPLAY=:0 xclock

they run successfully in wslg

hemanta212 avatar Jan 30 '23 13:01 hemanta212

Can you re-verify that gwsl is allowed through the firewall? That is likely the issue. (See the manual for details or click the button in GWSL Dashboard / about )

Pololot64 avatar Jan 30 '23 13:01 Pololot64

I rechecked the firewall settings, looks like I've allowed it, for good measure I allowed all gwsl and related apps both public and private access then exited and restarted gwsl. Still does not seem to work and produce same errors in the log.

hemanta212 avatar Jan 30 '23 14:01 hemanta212

Well one thing I know is that the issue is kind of "fake" because GWSL tends to spam that error message. It generally means nothing. I can fix it but since it does not affect functionality I don't have time at the moment.

So, just to clarify, GWSL is not crashing in any way?

It may also be wslg conflicting with it. I would recommend disabling it to check.

Pololot64 avatar Jan 30 '23 14:01 Pololot64

ok i'll try to reinstall gwsl and also try disabling the wslg and see if it works.

hemanta212 avatar Jan 30 '23 14:01 hemanta212

Disabled wslg, reinstalled Gwsl, restarted the system but still cant make it work unfortunately

hemanta212 avatar Jan 30 '23 14:01 hemanta212

I'll do some more thinking 🤔

Pololot64 avatar Jan 30 '23 14:01 Pololot64

Are you using a VPN anywhere or anything?

Pololot64 avatar Jan 30 '23 15:01 Pololot64

no, I am not using VPN.

hemanta212 avatar Jan 30 '23 15:01 hemanta212

only thing i remember that may have effect is updating gwsl from store, otherwise I had running it fine and had no other environmental change whatsoever

hemanta212 avatar Jan 30 '23 15:01 hemanta212

Now that wslg is disabled, what error do you get if you launch a GUI app directly from bash?

Pololot64 avatar Jan 30 '23 15:01 Pololot64

when i launch an gui app through bash it does nothing just get stuck, no window pops up nothing, exporting display to non existing port would error out so it means the connection with gwsl is there but just no window shows up by gwsl.

hemanta212 avatar Jan 31 '23 03:01 hemanta212

This is really strange. I know the xclock works so this makes it more strange. Maybe the new vcxsrv backend version has a bug. I doubt it but maybe

Pololot64 avatar Jan 31 '23 03:01 Pololot64

i tried with xclock it hunged, so left it and after some time exited with

Error: Can't open display: 172.28.176.1:0.0

hemanta212 avatar Jan 31 '23 03:01 hemanta212

Aha... this is good information. Can you ping that IP address from inside wsl? Also, is your distro wsl1 or wsl2?

Pololot64 avatar Jan 31 '23 04:01 Pololot64

its wsl2 and display was exported through the function auto inserted by GWSL in bashrc.

ping output

PING 172.27.176.1 (172.27.176.1) 56(84) bytes of data.

it then hangs

hemanta212 avatar Jan 31 '23 04:01 hemanta212

Aha. This is incredibly unrelated to the GWSL update then. I know you did it before but go into firewall settings and delete all rules related to GWSL. Something has likely gotten messed up.

Pololot64 avatar Jan 31 '23 04:01 Pololot64

ok so there were multiple entries in the firewall for GWSL VCXsrv windows server HIDPI so I removed all except one and now it worked

hemanta212 avatar Jan 31 '23 04:01 hemanta212

Awesome :)

Pololot64 avatar Jan 31 '23 04:01 Pololot64

so what was the issue? how did those entries came there in first place, was it due to update or just some coincidence?

hemanta212 avatar Jan 31 '23 04:01 hemanta212

Any way glad to have this finally sorted out and work. Thank you so much for the support here hope you have an awesome day. btw will those deleted fpulseaudio firewall entries auto populate itself through windows firewall requests when I use them?

hemanta212 avatar Jan 31 '23 04:01 hemanta212

What happens is that sometimes, after an update, Windows detects GWSL as a new program and asks you to allow it through again. That second prompt can be easy to miss. It causes 90% percent of problems.

Pololot64 avatar Jan 31 '23 04:01 Pololot64

Yes the rules will come back when you start GWSL the next time and give public access when it gives the prompts. Glad to help. Have a wonderful day too.

Pololot64 avatar Jan 31 '23 04:01 Pololot64