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

Error on Cloud plugin initialisation make TUI crash #3085

Open
anika200 opened this issue Jan 14, 2025 · 5 comments
Open

Error on Cloud plugin initialisation make TUI crash #3085

anika200 opened this issue Jan 14, 2025 · 5 comments

Comments

@anika200
Copy link

Upgraded via Homebrew to latest version and now the program will not start, was working great for long time even through other upgrades via homebrew.
Not sure how to diagnose the issue or if it is just homebrew problem, I get this from the Mac OS terminal.
lee@IMac ~ % glances Error while initializing the cloud plugin ([Errno 2] No such file or directory) Error while initializing the ports plugin ([Errno 2] No such file or directory) lee@IMac ~ %
My operating system is Ventura 13.7.2
lee@IMac ~ % uname -a Darwin IMac 22.6.0 Darwin Kernel Version 22.6.0: Fri Nov 15 17:21:49 PST 2024; root:xnu-8796.141.3.709.7~2/RELEASE_X86_64 x86_64
Let me know if you need more info.

@nicolargo
Copy link
Owner

Hi @anika200

can you fill the issue report:

Check the bug
Before filling this bug report, please search if a similar issue already exists.
In this case, just add a comment on this existing issue.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Start Glances with the following options '...'
  2. Press the key '....'
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environement (please complete the following information)

  • Operating System (lsb_release -a or OS name/version): To be completed with result of: lsb_release -a
  • Glances & psutil versions: To be completed with result of: glances -V
  • How do you install Glances (Pypi package, script, package manager, source): To be completed
  • Glances test: To be completed with result of: glances --issue

Additional context
Add any other context about the problem here.

You can also pastebin:

@anika200
Copy link
Author

Hi nicolargo, thank you for your time. I hope the info below is helpful. Since there are no other reports I am wondering if it is something else to do with homebrew or even the mac but I have done nothing different lately and have not installed or upgraded anything major on the mac so...
Have a great day.
Lee

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

    Start Glances with the following options '...'
    Press the key '....'
    See error

Not sure what the above means, I just type glances in the terminal.

Expected behavior
Open glances

A clear and concise description of what you expected to happen.
Already described, see screen shot below.

Screenshots
If applicable, add screenshots to help explain your problem.

See attached
Screenshot 2025-01-15 at 10 52 31 AM

Environement (please complete the following information)

Operating System (lsb_release -a or OS name/version): To be completed with result of: lsb_release -a
Aready in first report, lsb_release -a does not work on macos.

Glances & psutil versions: To be completed with result of: glances -V
This output looks a little weird to me, I am starting to wonder if the mac terminal is flaking out but I have not changed anything on the mac side.

lee@IMac ~ % glances -V Glances version: 4.3.0.8 Glances API version: 4 PsUtil version: 6.1.1 Log file: /

How do you install Glances (Pypi package, script, package manager, source): To be completed
Installed with Homebrew
lee@IMac ~ % brew -v Homebrew 4.4.16
Glances test: To be completed with result of: glances --issue
Had to pipe this to a txt file see attached issue.txt
issue.txt

Additional context
Add any other context about the problem here.

After completing the above stuff I am starting to wonder about the mac terminal, it is acting pretty strange, so now I am also wondering about homebrew too. I strangeness includes no visible cursor and the output sometimes looks all messed up hence I had to pipe the output of glances --issue to a text file because it could not be read from the terminal.

the Glances configuration file (https://glances.readthedocs.io/en/latest/config.html#location)
Well that is unexpected, there is no glances.conf on this mac anywhere.

the Glances log file (https://glances.readthedocs.io/en/latest/config.html#logging)
I have attached log file after running glances -d
glances.log

@nicolargo
Copy link
Owner

Thanks for the log (and sorry for the delay).

The source of the error is the following:

2025-01-14 10:20:37,418 -- CRITICAL -- Error while initializing the cloud plugin ([Errno 2] No such file or directory)
2025-01-14 10:20:37,421 -- ERROR -- Traceback (most recent call last):
  File "/usr/local/Cellar/glances/4.3.0.8/libexec/lib/python3.13/site-packages/glances/stats.py", line 100, in _load_plugin
    plugin = import_module('glances.plugins.' + plugin_path)
  File "/usr/local/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/local/Cellar/glances/4.3.0.8/libexec/lib/python3.13/site-packages/glances/plugins/cloud/__init__.py", line 24, in <module>
    import requests
  File "/usr/local/Cellar/glances/4.3.0.8/libexec/lib/python3.13/site-packages/requests/__init__.py", line 164, in <module>
    from .api import delete, get, head, options, patch, post, put, request
  File "/usr/local/Cellar/glances/4.3.0.8/libexec/lib/python3.13/site-packages/requests/api.py", line 11, in <module>
    from . import sessions
  File "/usr/local/Cellar/glances/4.3.0.8/libexec/lib/python3.13/site-packages/requests/sessions.py", line 15, in <module>
    from .adapters import HTTPAdapter
  File "/usr/local/Cellar/glances/4.3.0.8/libexec/lib/python3.13/site-packages/requests/adapters.py", line 81, in <module>
    _preloaded_ssl_context.load_verify_locations(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
FileNotFoundError: [Errno 2] No such file or directory

It looks like the requests lib do not start.

Just to be sure, can you try:

$ python
>>> import requests
...

copy/paste the result.

Nevertheless Glances should not crash if the Cloud plugin is not loaded so it's clearly a bug.

I will try to write a patch for the next version.

I keep you inform.

@nicolargo nicolargo added the bug label Jan 19, 2025
@nicolargo nicolargo added this to the Glances 4.3.1 milestone Jan 19, 2025
@nicolargo nicolargo changed the title Non starting issue after upgrading via Homebrew to version 4.3.0.8 Error on Cliud plugin initialisation make TUI crash Jan 19, 2025
@nicolargo nicolargo changed the title Error on Cliud plugin initialisation make TUI crash Error on Cloud plugin initialisation make TUI crash Jan 19, 2025
@nicolargo
Copy link
Owner

Patch pushed on the develop branch.

Next version of Glances will not crash if the cloud plugin can not be loaded.

For you specific case @anika200 try to solve the requests import. You can also try to run Glances without the cloud plugin:

glances --disable-plugin cloud

@anika200
Copy link
Author

anika200 commented Jan 21, 2025

Wow, thanks for all the hard work.
This is what I get from the python command, looks like it could be a problem.
``lee@IMac ~ % python3
Python 3.13.1 (main, Dec 3 2024, 17:59:52) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import requests
Traceback (most recent call last):
File "", line 1, in
import requests
ModuleNotFoundError: No module named 'requests'``

Not sure I ran the above command correctly???
If I run with --disable-plugin cloud I get the same crash.

I realize I could probably update and it will be fine but I am gonna wait in case you need more info.

Meanwhile I will be installing the latest version to my newest debian install.

After looking everything over again, I see now how I can try to solve the import requests. Thank you.

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