Page MenuHomePhabricator

[cumin] urllib >= 2 fails to disable warning SubjectAltNameWarning as exception is not there anymore
Closed, ResolvedPublic

Description

For example:

dcaro@urcuchillay$ wmcs-cookbooks component.deploy --component builds-builder --cluster-name toolsbeta --git-branch bump_builds-builder
Got matching cookbooks wmcs.toolforge.k8s.component.deploy
INFO: guessed git tree name as toolforge-deploy
START - Cookbook wmcs.toolforge.k8s.component.deploy for component builds-builder
Exception raised while executing cookbook wmcs.toolforge.k8s.component.deploy:
Traceback (most recent call last):
  File "/home/dcaro/Work/wikimedia/spicerack/spicerack/_menu.py", line 250, in _run
    raw_ret = runner.run()
              ^^^^^^^^^^^^
  File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/wmcs_libs/common.py", line 766, in _wrapped_run
    return object.__getattribute__(self, __name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/cookbooks/wmcs/toolforge/k8s/component/deploy.py", line 141, in run
    deploy_node = remote.query(f"D{{{deploy_node_fqdn}}}", use_sudo=True)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dcaro/Work/wikimedia/spicerack/spicerack/remote.py", line 337, in query
    hosts = query.Query(self._config).execute(query_string)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dcaro/.virtualenvs/wmcs-cookbooks-python3/lib/python3.12/site-packages/cumin/query.py", line 61, in execute
    hosts = self._query_default_backend(query_string)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dcaro/.virtualenvs/wmcs-cookbooks-python3/lib/python3.12/site-packages/cumin/query.py", line 95, in _query_default_backend
    query = backend.cls(self.config)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dcaro/.virtualenvs/wmcs-cookbooks-python3/lib/python3.12/site-packages/cumin/backends/puppetdb.py", line 249, in __init__
    urllib3.disable_warnings(category=getattr(urllib3.exceptions, exception))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'urllib3.exceptions' has no attribute 'SubjectAltNameWarning'
END (FAIL) - Cookbook wmcs.toolforge.k8s.component.deploy (exit_code=99) for component builds-builder

This is similar to T345309: Wmfdata's presto.run fails with Urllib3 v2 or higher

Event Timeline

dcaro renamed this task from [cumin] urllib >= 2 fails with the new internal certificates to [cumin] urllib >= 2 fails to disable warning SubjectAltNameWarning as exception is not there anymore.Jan 5 2024, 11:49 AM

We have that usually configured in the spicerack config:

 9 puppetdb:                                                                      
10     host: puppetdb-api.discovery.wmnet                                         
11     port: 8090                                                                 
12     api_version: 4                                                                                                                                                                                                                                                                                                                                                                        
13     urllib3_disable_warnings:                                                  
14       - SubjectAltNameWarning  # Temporary fix for T158757

Just removing that entry seems to work for me.

Volans claimed this task.
Volans edited projects, added Cumin; removed Puppet-Core, SRE.

@dcaro correct, cumin disables the warnings listed in the cumin's configuration, so this is totally user-controlled and can be resolved on the user side. There is no direct mention of SubjectAltNameWarning in cumin's source code anymore since last May. Resolving.