MatthiasSchinzel / sysmon

Graphical system monitor for linux, including information about CPU, GPU, Memory, HDD/SDD and your network connections. Similar to windows task manager.
GNU General Public License v3.0
294 stars 25 forks source link

Exception in function `get_max_connection_speed` #10

Closed AngheloAlf closed 3 years ago

AngheloAlf commented 3 years ago

Hi!

I tried to run sysmon, but it does not open because of an IndexError: list index out of range exception.

The traceback is:

Traceback (most recent call last):
  File "sysmon.py", line 595, in <module>
    main()
  File "sysmon.py", line 589, in main
    main = MainWindow()
  File "sysmon.py", line 102, in __init__
    self.s = sysinfo()
  File "/home/angie/Software/sourcecode/sysmon/src/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/home/angie/Software/sourcecode/sysmon/src/gather_data.py", line 271, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1].split()[1]
IndexError: list index out of range

Other details:

Also, i did install the dependencies as stated on the Readme.md and nvidia-smi is installed on the system.

If you need more info, just ask.

Bye c:

MatthiasSchinzel commented 3 years ago

Hi :)

So what fails is the part of getting the wifi bandwidth. M̶a̶y̶b̶e̶ ̶i̶w̶c̶o̶n̶f̶i̶g̶ ̶i̶s̶ ̶n̶o̶t̶ ̶i̶n̶s̶t̶a̶l̶l̶e̶d̶ ̶o̶n̶ ̶y̶o̶u̶r̶ ̶s̶y̶s̶t̶e̶m̶.̶ ̶ ̶ ̶C̶o̶u̶l̶d̶ ̶y̶o̶u̶ ̶p̶l̶e̶a̶s̶e̶ ̶r̶u̶n̶ ̶'̶i̶w̶c̶o̶n̶f̶i̶g̶'̶ ̶a̶n̶d̶ ̶p̶o̶s̶t̶ ̶t̶h̶e̶ ̶o̶u̶t̶p̶u̶t̶ ̶h̶e̶r̶e̶?̶ See Medaths answer

Thank you so much!

Medath commented 3 years ago

I have this exact same issue too, it happens when my wifi adapter is not connected to any network.

output of iwconfig wlp3s0 with no wifi connection:

wlp3s0    IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=16 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

output of iwconfig wlp3s0 with a wifi connection:

wlp3s0    IEEE 802.11  ESSID:"MyAP"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: aa:bb:cc:dd:ee:ff   
          Bit Rate=1 Mb/s   Tx-Power=16 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=61/70  Signal level=-49 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:99   Missed beacon:0

I peeked at your code and it's grepping iwconfig for "Bit Rate", which is not present when the adapter is not connected to a network, which means the processes list will be empty, causing the above issue.

I guess there should be a check somewhere to see if the adapter is connected to any network (grepping for ESSID:off/any?)

MatthiasSchinzel commented 3 years ago

Exactly, that is the problem! Just ran into the same issue! Give me a few moments!

MatthiasSchinzel commented 3 years ago

Alright, on my Laptop it seems to work now and the GUI is not crashing. However, the GUI is not showing "disconnected" yet, still needs to be done.

Please try again! Sorry for the inconvenience!

Medath commented 3 years ago

Can confirm it fixes the crash for me

AngheloAlf commented 3 years ago

Can also confirm it is working. Thanks!