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

[BUG] salt.loaded.int.grains.metadata_gce.__virtual__() fails with stack trace in logs on AWS #67132

Open
2 of 9 tasks
fs-nicola-worthington opened this issue Jan 9, 2025 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@fs-nicola-worthington
Copy link

fs-nicola-worthington commented Jan 9, 2025

The Salt minion emits stack traces into the logs.

2025-01-09 11:11:45,881 [salt.loader.lazy :1191][ERROR   ][21166] Exception raised when processing __virtual__ function for salt.loaded.int.grains.metadata_gce. Module will not be loaded: Cannot run the event loop while another loop is running
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1174, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1269, in run
    return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1284, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/metadata_gce.py", line 32, in __virtual__
    googletest = http.query(HOST, status=True, headers=True)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/http.py", line 633, in query
    HTTPClient(max_body_size=max_body)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/httpclient.py", line 109, in __init__
    self._async_client = self._io_loop.run_sync(make_client)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/ioloop.py", line 521, in run_sync
    self.start()
  File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/platform/asyncio.py", line 195, in start
    self.asyncio_loop.run_forever()
  File "/opt/saltstack/salt/lib/python3.10/asyncio/base_events.py", line 592, in run_forever
    self._check_running()
  File "/opt/saltstack/salt/lib/python3.10/asyncio/base_events.py", line 586, in _check_running
    raise RuntimeError(
RuntimeError: Cannot run the event loop while another loop is running
2025-01-09 11:11:45,882 [salt.loader.lazy :1203][WARNING ][21166] salt.loaded.int.grains.metadata_gce.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'metadata_gce', please fix this.

Setup

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service - AWS EC2 eu-west-1 r6i.xlarge
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior

Start Salt minion.

Expected behavior

No stack traces in the logs.

Versions Report

salt --versions-report

Master:

Salt Version:
          Salt: 3007.1

Python Version:
        Python: 3.10.14 (main, Apr  3 2024, 21:30:09) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.16.0
      cherrypy: unknown
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.5.2
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: 0.16.0
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.3.3
           ZMQ: 4.3.4

Salt Package Information:
  Package Type: onedir

System Versions:
          dist: amzn 2023.6.20241121
        locale: utf-8
       machine: x86_64
       release: 6.1.115-126.197.amzn2023.x86_64
        system: Linux
       version: Amazon Linux 2023.6.20241121

Minions:

Salt Version:
          Salt: 3007.1

Python Version:
        Python: 3.10.14 (main, Apr  3 2024, 21:30:09) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.16.0
      cherrypy: 18.8.0
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.7
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.5.2
        PyYAML: 6.0.1
         PyZMQ: 25.1.2
        relenv: 0.16.0
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.3.3
           ZMQ: 4.3.4

Salt Package Information:
  Package Type: onedir

System Versions:
          dist: centos 7.9.2009 Core
        locale: utf-8
       machine: x86_64
       release: 3.10.0-1160.80.1.el7.x86_64
        system: Linux
       version: CentOS Linux 7.9.2009 Core
@fs-nicola-worthington fs-nicola-worthington added Bug broken, incorrect, or confusing behavior needs-triage labels Jan 9, 2025
Copy link

welcome bot commented Jan 9, 2025

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant