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] issues with loading boto modules with salt 3006.5 #65691

Closed
2 tasks done
defanator opened this issue Dec 13, 2023 · 8 comments
Closed
2 tasks done

[BUG] issues with loading boto modules with salt 3006.5 #65691

defanator opened this issue Dec 13, 2023 · 8 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases.

Comments

@defanator
Copy link
Contributor

defanator commented Dec 13, 2023

Description
After upgrading from 3006.4 to 3006.5 we are no longer able to use states that rely on a family of boto_* modules.

Setup
TBA

Please be as specific as possible and give set-up details.

  • VM running on a cloud service, please be explicit and add details
  • onedir packaging

Steps to Reproduce the behavior
Try to apply corresponding states.

Expected behavior
No errors while loading modules.

Actual behavior

[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_asg. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_asg.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_asg', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_cloudwatch. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_cloudwatch.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_cloudwatch', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_dynamodb. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_dynamodb.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_dynamodb', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_ec2. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_ec2.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_ec2', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_elasticache. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_elasticache.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_elasticache', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_elb. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_elb.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_elb', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_secgroup. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_secgroup.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_secgroup', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_sns. Module will not be loaded: '__salt__'
[WARNING ] salt.loaded.int.module.boto_sns.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_sns', please fix this.
[ERROR   ] State 'boto_vpc.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_vpc' __virtual__ returned False: The following libraries are required to run the boto_vpc state module: boto >= 2.8.0 and boto3 >= 1.2.6.

[ERROR   ] State 'boto_vpc.internet_gateway_present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_vpc' __virtual__ returned False: The following libraries are required to run the boto_vpc state module: boto >= 2.8.0 and boto3 >= 1.2.6.

[ERROR   ] State 'boto_secgroup.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_secgroup' __virtual__ returned False: boto_secgroup module could not be loaded

[ERROR   ] State 'boto_secgroup.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_secgroup' __virtual__ returned False: boto_secgroup module could not be loaded

[ERROR   ] State 'boto_secgroup.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_secgroup' __virtual__ returned False: boto_secgroup module could not be loaded

[ERROR   ] State 'boto_secgroup.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_secgroup' __virtual__ returned False: boto_secgroup module could not be loaded

[ERROR   ] State 'boto_secgroup.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_secgroup' __virtual__ returned False: boto_secgroup module could not be loaded

[ERROR   ] State 'boto_secgroup.present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_secgroup' __virtual__ returned False: boto_secgroup module could not be loaded

[ERROR   ] State 'boto_vpc.route_table_present' was not found in SLS 'datacenters.pdx1.mgmt.vpc'
Reason: 'boto_vpc' __virtual__ returned False: The following libraries are required to run the boto_vpc state module: boto >= 2.8.0 and boto3 >= 1.2.6.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3006.5
 
Python Version:
        Python: 3.10.13 (main, Nov 15 2023, 04:34:27) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: 1.3.0
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: 1.8.0
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.14.2
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian 11 bullseye
        locale: utf-8
       machine: x86_64
       release: 5.10.0-25-cloud-amd64
        system: Linux
       version: Debian GNU/Linux 11 bullseye

Additional context

Installed boto versions:

# salt-pip list | fgrep boto
boto               2.49.0
boto3              1.33.13
botocore           1.33.13

[notice] A new release of pip is available: 23.1.1 -> 23.3.1
[notice] To update, run: /opt/saltstack/salt/bin/python3.10 -m pip install --upgrade pip

Debug log excerpts while trying to apply states through salt-call:

[DEBUG   ] The functions from module 'config' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded config.option
[DEBUG   ] The functions from module 'boto3' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_elb_tag' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto' are being loaded by dir() on the loaded module
[DEBUG   ] LazyLoaded boto.assign_funcs
[DEBUG   ] Error loading module.boto_vpc: __init__ failed
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 902, in _load_module
    self.run(module_init, self.opts)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_vpc.py", line 187, in __init__
    __utils__["boto.assign_funcs"](__name__, "vpc", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[..]
[DEBUG   ] The functions from module 'baredoc' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'beacons' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'bigip' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto3_elasticache' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto3_elasticsearch' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto3_route53' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto3_sns' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_apigateway' are being loaded by dir() on the loaded module
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_asg. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_asg.py", line 86, in __virtual__
    __utils__["boto.assign_funcs"](
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_asg.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_asg', please fix this.
[DEBUG   ] Error loading module.boto_cfn: __init__ failed
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 902, in _load_module
    self.run(module_init, self.opts)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_cfn.py", line 65, in __init__
    __utils__["boto.assign_funcs"](
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[DEBUG   ] The functions from module 'boto_cloudfront' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_cloudtrail' are being loaded by dir() on the loaded module
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_cloudwatch. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_cloudwatch.py", line 74, in __virtual__
    __utils__["boto.assign_funcs"](
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_cloudwatch.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_cloudwatch', please fix this.
[DEBUG   ] The functions from module 'boto_cloudwatch_event' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_cognitoidentity' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_datapipeline' are being loaded by dir() on the loaded module
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_dynamodb. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_dynamodb.py", line 90, in __virtual__
    __utils__["boto.assign_funcs"](__name__, "dynamodb2", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_dynamodb.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_dynamodb', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_ec2. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_ec2.py", line 87, in __virtual__
    __utils__["boto.assign_funcs"](__name__, "ec2", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_ec2.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_ec2', please fix this.
[DEBUG   ] The functions from module 'boto_efs' are being loaded by dir() on the loaded module
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_elasticache. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_elasticache.py", line 76, in __virtual__
    __utils__["boto.assign_funcs"](__name__, "elasticache", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_elasticache.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_elasticache', please fix this.
[DEBUG   ] The functions from module 'boto_elasticsearch_domain' are being loaded by dir() on the loaded module
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_elb. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_elb.py", line 81, in __virtual__
    __utils__["boto.assign_funcs"](__name__, "elb", module="ec2.elb", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_elb.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_elb', please fix this.
[DEBUG   ] The functions from module 'boto_elbv2' are being loaded by dir() on the loaded module
[DEBUG   ] Error loading module.boto_iam: __init__ failed
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 902, in _load_module
    self.run(module_init, self.opts)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_iam.py", line 75, in __init__
    __utils__["boto.assign_funcs"](__name__, "iam", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[DEBUG   ] The functions from module 'boto_iot' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_kinesis' are being loaded by dir() on the loaded module
[DEBUG   ] Error loading module.boto_kms: __init__ failed
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 902, in _load_module
    self.run(module_init, self.opts)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_kms.py", line 69, in __init__
    __utils__["boto.assign_funcs"](__name__, "kms", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[DEBUG   ] The functions from module 'boto_lambda' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_rds' are being loaded by dir() on the loaded module
[DEBUG   ] Error loading module.boto_route53: __init__ failed
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 902, in _load_module
    self.run(module_init, self.opts)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_route53.py", line 82, in __init__
    __utils__["boto.assign_funcs"](__name__, "route53", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[DEBUG   ] The functions from module 'boto_s3' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_s3_bucket' are being loaded by dir() on the loaded module
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_secgroup. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_secgroup.py", line 82, in __virtual__
    __utils__["boto.assign_funcs"](__name__, "ec2", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_secgroup.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_secgroup', please fix this.
[ERROR   ] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_sns. Module will not be loaded: '__salt__'
Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1150, in _process_virtual
    virtual = self.run(virtual_attr)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_sns.py", line 69, in __virtual__
    __utils__["boto.assign_funcs"](__name__, "sns", pack=__salt__)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in __call__
    ret = self.loader.run(run_func, *args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, 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 1260, in _run_as
    return _func_or_method(*args, **kwargs)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py", line 261, in assign_funcs
    if pack:
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 87, in __bool__
    return bool(self.value())
  File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 72, in value
    return loader.pack[self.name]
KeyError: '__salt__'
[WARNING ] salt.loaded.int.module.boto_sns.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_sns', please fix this.
[DEBUG   ] The functions from module 'boto_sqs' are being loaded by dir() on the loaded module
[DEBUG   ] The functions from module 'boto_ssm' are being loaded by dir() on the loaded module
@defanator defanator added Bug broken, incorrect, or confusing behavior needs-triage labels Dec 13, 2023
@defanator
Copy link
Contributor Author

After deeper investigation, it turned out that reverting this change fixes the issue:

% git describe
v3006.4-1926-g84f434cc76

% git diff -r v3006.4 context.py 
diff --git a/salt/loader/context.py b/salt/loader/context.py
index 86f879cc59..6bbfe4dbd8 100644
--- a/salt/loader/context.py
+++ b/salt/loader/context.py
@@ -84,11 +84,7 @@ class NamedLoaderContext(collections.abc.MutableMapping):
         self.value()[item] = value
 
     def __bool__(self):
-        try:
-            self.loader
-        except LookupError:
-            return False
-        return True
+        return bool(self.value())
 
     def __len__(self):
         return self.value().__len__()

Corresponding commit with breaking changes: 989790c

cc/ @dwoz

@dwoz dwoz added this to the Sulfur v3006.6 milestone Dec 13, 2023
@dwoz dwoz added Regression The issue is a bug that breaks functionality known to work in previous releases. and removed needs-triage labels Dec 13, 2023
dwoz added a commit to dwoz/salt that referenced this issue Dec 14, 2023
@dwoz dwoz self-assigned this Dec 14, 2023
dwoz added a commit to dwoz/salt that referenced this issue Dec 14, 2023
dwoz added a commit to dwoz/salt that referenced this issue Dec 16, 2023
dwoz added a commit to dwoz/salt that referenced this issue Dec 18, 2023
dwoz added a commit to dwoz/salt that referenced this issue Dec 18, 2023
dwoz added a commit that referenced this issue Dec 22, 2023
TimidRobot added a commit to creativecommons/sre-salt-prime that referenced this issue Jan 19, 2024
@dwoz dwoz modified the milestones: Sulfur v3006.6, Sulfur v3006.7 Feb 5, 2024
@grzegorz-gn
Copy link

This issue also exist in salt-minion x86_64 3006.6-0 version

@AGirin
Copy link

AGirin commented Feb 9, 2024

Agreed. 3006.6. - same issue...

2024-02-09 13:28:05,357 [salt.loader.lazy :1167][ERROR   ][230522] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_cloudwatch. Module will not be loaded: '__salt__'
2024-02-09 13:28:05,358 [salt.loader.lazy :1179][WARNING ][230522] salt.loaded.int.module.boto_cloudwatch.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_cloudwatch', please fix this.
2024-02-09 13:28:05,370 [salt.loader.lazy :1167][ERROR   ][230522] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_ec2. Module will not be loaded: '__salt__'
2024-02-09 13:28:05,370 [salt.loader.lazy :1179][WARNING ][230522] salt.loaded.int.module.boto_ec2.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_ec2', please fix this.
2024-02-09 13:28:05,375 [salt.loader.lazy :1167][ERROR   ][230522] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_elasticache. Module will not be loaded: '__salt__'
2024-02-09 13:28:05,375 [salt.loader.lazy :1179][WARNING ][230522] salt.loaded.int.module.boto_elasticache.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_elasticache', please fix this.
2024-02-09 13:28:05,380 [salt.loader.lazy :1167][ERROR   ][230522] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_elb. Module will not be loaded: '__salt__'
2024-02-09 13:28:05,380 [salt.loader.lazy :1179][WARNING ][230522] salt.loaded.int.module.boto_elb.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_elb', please fix this.
2024-02-09 13:28:05,411 [salt.loader.lazy :1167][ERROR   ][230522] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_secgroup. Module will not be loaded: '__salt__'
2024-02-09 13:28:05,411 [salt.loader.lazy :1179][WARNING ][230522] salt.loaded.int.module.boto_secgroup.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_secgroup', please fix this.
2024-02-09 13:28:05,413 [salt.loader.lazy :1167][ERROR   ][230522] Exception raised when processing __virtual__ function for salt.loaded.int.module.boto_sns. Module will not be loaded: '__salt__'
2024-02-09 13:28:05,413 [salt.loader.lazy :1179][WARNING ][230522] salt.loaded.int.module.boto_sns.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'boto_sns', please fix this.

@defanator
Copy link
Contributor Author

Confirming that 3006.6 still include this bug.

@dwoz
Copy link
Contributor

dwoz commented Feb 11, 2024

I've confirmed this is fixed by #65696, I thought that went out with 3006.5 but was wrong. It'll be fixed in 3006.7.

@jrehrenfeld
Copy link

Just wondering if there's timing on the 3006.7 release?

@dwoz
Copy link
Contributor

dwoz commented Feb 12, 2024

Just wondering if there's timing on the 3006.7 release?

We're held up by some failures in the test pipeline. Once they are resolved we'll do the release. Hopefully this week, if not, next.

@dwoz
Copy link
Contributor

dwoz commented May 1, 2024

Fixed in 3006.7

@dwoz dwoz closed this as completed May 1, 2024
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 Regression The issue is a bug that breaks functionality known to work in previous releases.
Projects
None yet
Development

No branches or pull requests

5 participants