Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network plugin broken on macOS #3036

Closed
sam-fredrickson opened this issue Nov 30, 2024 · 1 comment
Closed

Network plugin broken on macOS #3036

sam-fredrickson opened this issue Nov 30, 2024 · 1 comment

Comments

@sam-fredrickson
Copy link

Check the bug
I checked for recent open and closed bugs, and none seem to match this particular one.

Describe the bug

After updating to Glances 4.2.1 with Homebrew, I get this mess of an error on start up.

If I run with glances --disable-plugin network, it starts up successfully.

Traceback (most recent call last):
                                    File "/opt/homebrew/bin/glances", line 8, in <module>
                                                                                             sys.exit(main())
                                                                                                                          ~~~~^^
                                                                                                                                  File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/__init__.py", line 173, in main
                                                               start(config=core.get_config(), args=core.get_args())
                                                                                                                        ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                               File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/__init__.py", line 121, in start
                                                                                                             mode.serve_forever()
                                                                                                                                     ~~~~~~~~~~~~~~~~~~^^
                                                                                                                                                           File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/standalone.py", line 186, in serve_forever
                                                                                                   while self.__serve_once():
                                                                                                                                       ~~~~~~~~~~~~~~~~~^^
                                                                                                                                                            File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/standalone.py", line 158, in __serve_once
                                                                                                   ret = not self.screen.update(self.stats, duration=adapted_refresh)
                                                                                                                                                                                   ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                 File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/outputs/glances_curses.py", line 1099, in update
                                                                                                                                                                                           self.flush(stats, cs_status=cs_status)
                                         ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                 File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/outputs/glances_curses.py", line 1080, in flush
                              self.display(stats, cs_status=cs_status)
                                                                          ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                    File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/outputs/glances_curses.py", line 521, in display
                                                                  __stat_display = self.__get_stat_display(stats, layer=cs_status)
                                                                                                                                    File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/outputs/glances_curses.py", line 497, in __get_stat_display
                                                                                             ret[p] = stats.get_plugin(p).get_stats_display(args=self.args, max_width=plugin_max_width)
                                                                                                                                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                           File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/plugins/plugin/model.py", line 892, in get_stats_display
                                                 ret = {'display': display_curse, 'msgdict': self.msg_curse(args, max_width=max_width), 'align': align_curse}
                                                                                                                                                                                                             ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                            File "/opt/homebrew/Cellar/glances/4.2.1/libexec/lib/python3.13/site-packages/glances/plugins/network/__init__.py", line 308, in msg_curse
              tx = self.auto_unit(int(i['bytes_sent_rate_per_sec'] * to_bit)) + unit
                                                                                                                ~^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                            KeyError: 'bytes_sent_rate_per_sec'

To Reproduce
Steps to reproduce the behavior:

  1. Start Glances on macOS
  2. See error

Expected behavior
Glances start successfully without error.

Environement (please complete the following information)

  • macOS 15.1.1
  • glances 4.2.1
Glances version:        4.2.1
Glances API version:    4
PsUtil version:         6.1.0
Log file:               /Users/sam/.local/share/glances/glances.log
  • installed with Homebrew
  • glances --issue reports no errors

Additional context

I have considered whether this could be a configuration problem, but after checking these directories:

  • ~/.config/glances/
  • ~/Library/Application Support/glances/
  • /usr/local/etc/glances/
  • /usr/share/docs/glances/

I can't find any files in these places.

for x in ~/.config/glances/  "~/Library/Application Support/glances/" /usr/local/etc/glances/ /usr/share/docs/glances/; do echo $x ; ls $x; done
/Users/sam/.config/glances/
ls: /Users/sam/.config/glances/: No such file or directory
~/Library/Application Support/glances/
ls: Support/glances/: No such file or directory
ls: ~/Library/Application: No such file or directory
/usr/local/etc/glances/
ls: /usr/local/etc/glances/: No such file or directory
/usr/share/docs/glances/
ls: /usr/share/docs/glances/: No such file or directory

Here's the log output:

2024-11-29 18:26:59,416 -- WARNING -- PsUtil can not grab processes io_counters ('Process' object has no attribute 'io_counters')
2024-11-29 18:26:59,416 -- INFO -- Start Glances 4.2.1
2024-11-29 18:26:59,417 -- INFO -- CPython 3.13.0 (/opt/homebrew/Cellar/glances/4.2.1/libexec/bin/python) and psutil 6.1.0 detected
2024-11-29 18:26:59,478 -- INFO -- Start GlancesStandalone mode
2024-11-29 18:26:59,483 -- WARNING -- NVML Shared Library (libnvidia-ml.so.1) not Found, Nvidia GPU plugin is disabled
2024-11-29 18:26:59,484 -- WARNING -- Sparklines module not found (No module named 'sparklines')
2024-11-29 18:26:59,487 -- WARNING -- Missing Python Lib (No module named 'pySMART'), HDD Smart plugin is disabled
2024-11-29 18:26:59,488 -- WARNING -- Missing Python Lib (No module named 'pymdstat'), Raid plugin is disabled
2024-11-29 18:26:59,513 -- WARNING -- Error loading Docker deps Lib. Docker plugin is disabled (No module named 'docker')
2024-11-29 18:26:59,513 -- WARNING -- Error loading Podman deps Lib. Podman feature in the Containers plugin is disabled (No module named 'podman')
2024-11-29 18:26:59,514 -- WARNING -- Missing Python Lib (No module named 'netifaces'), IP plugin is disabled
2024-11-29 18:26:59,588 -- WARNING -- Can not get network connections stats ((pid=71018))
2024-11-29 18:26:59,589 -- INFO -- Disable connections stats
@nicolargo
Copy link
Owner

Thanks for the bug report @sam-fredrickson

This issue is already corrected in the develop branch: #3014

It will be release in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants