Skip to content

Work around https://github.com/pypa/pip/pull/9450 - #60625

Merged
garethgreenaway merged 4 commits into
saltstack:masterfrom
s0undt3ch:hotfix/pip-logging-handler
Jul 29, 2021
Merged

garethgreenaway merged 4 commits into
saltstack:masterfrom
s0undt3ch:hotfix/pip-logging-handler

Conversation

@s0undt3ch

Copy link
Copy Markdown
Contributor

What does this PR do?

Work around pypa/pip#9450
See pypa/pip#10212

@s0undt3ch

Copy link
Copy Markdown
Contributor Author
❯ python
Python 3.6.8 (default, Apr 15 2020, 09:32:35) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.getLoggerClass()
<class 'logging.Logger'>
>>> import salt
>>> logging.getLoggerClass()
<class 'salt._logging.impl.SaltLoggingClass'>
>>> logging.getLogger("foo").verbose("blah")
>>>

Works in theory...

@s0undt3ch
s0undt3ch force-pushed the hotfix/pip-logging-handler branch from f137b5f to 510bff1 Compare July 26, 2021 17:54
@s0undt3ch

Copy link
Copy Markdown
Contributor Author

re-run full all

@s0undt3ch
s0undt3ch force-pushed the hotfix/pip-logging-handler branch from 510bff1 to ca11bc8 Compare July 27, 2021 04:59
@s0undt3ch
s0undt3ch marked this pull request as ready for review July 27, 2021 05:00
@s0undt3ch
s0undt3ch requested a review from a team as a code owner July 27, 2021 05:00
@s0undt3ch
s0undt3ch requested review from waynew and removed request for a team July 27, 2021 05:00
@s0undt3ch

Copy link
Copy Markdown
Contributor Author

re-run full all

Comment thread salt/__init__.py Resolved
@garethgreenaway
garethgreenaway removed the request for review from waynew July 29, 2021 20:38
@garethgreenaway
garethgreenaway merged commit 8c6547e into saltstack:master Jul 29, 2021
truzzon pushed a commit to truzzon/salt that referenced this pull request Aug 10, 2021
* Also pin the ``pip`` upgrade to be ``<21.2``

* Work around pypa/pip#9450

See pypa/pip#10212

Co-authored-by: Megan Wilhite <[email protected]>
Co-authored-by: Gareth J. Greenaway <[email protected]>
dwoz pushed a commit to dwoz/salt that referenced this pull request Sep 12, 2021
* Also pin the ``pip`` upgrade to be ``<21.2``

* Work around pypa/pip#9450

See pypa/pip#10212

Co-authored-by: Megan Wilhite <[email protected]>
Co-authored-by: Gareth J. Greenaway <[email protected]>
@gediminasz

gediminasz commented Jun 20, 2022 •

Copy link
Copy Markdown
Contributor

I've encountered a possibly related error on Salt 3004.1, Ubuntu 22.04 and Python 3.10.4:

----------
          ID: docker_package_installed
    Function: pip.installed
        Name: docker
      Result: True
     Comment: Python package docker was already installed
              All specified packages are already installed
     Started: 11:34:53.021563
    Duration: 1240.316 ms
     Changes:   
----------
          ID: docker_network_present
    Function: docker_network.present
        Name: test
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3/dist-packages/salt/state.py", line 2179, in call
                  ret = self.states[cdata["full"]](
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1201, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1216, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/loader/lazy.py", line 1249, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/states/docker_network.py", line 625, in present
                  log.trace("Details of docker network '%s': %s", name, network)
              AttributeError: 'VerboseLogger' object has no attribute 'trace'
     Started: 11:34:54.263015
    Duration: 6.73 ms
     Changes:

States:

docker_package_installed:
  pip.installed:
    - name: docker

docker_network_present:
  docker_network.present:
    - name: test

Succeeds on first run but on second run (when docker network is already present) it fails with the error above.


    Salt Version:
              Salt: 3004.1
     
    Dependency Versions:
              cffi: Not Installed
          cherrypy: Not Installed
          dateutil: 2.8.1
         docker-py: 5.0.3
             gitdb: Not Installed
         gitpython: Not Installed
            Jinja2: 3.0.3
           libgit2: Not Installed
          M2Crypto: Not Installed
              Mako: Not Installed
           msgpack: 1.0.3
      msgpack-pure: Not Installed
      mysql-python: Not Installed
         pycparser: Not Installed
          pycrypto: Not Installed
      pycryptodome: 3.11.0
            pygit2: Not Installed
            Python: 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0]
      python-gnupg: 0.4.8
            PyYAML: 5.4.1
             PyZMQ: 22.3.0
             smmap: Not Installed
           timelib: Not Installed
           Tornado: 4.5.3
               ZMQ: 4.3.4
     
    System Versions:
              dist: ubuntu 22.04 Jammy Jellyfish
            locale: utf-8
           machine: x86_64
           release: 5.4.0-113-generic
            system: Linux
           version: Ubuntu 22.04 Jammy Jellyfish

@s0undt3ch
s0undt3ch deleted the hotfix/pip-logging-handler branch June 20, 2022 13:39
@s0undt3ch

Copy link
Copy Markdown
Contributor Author

What version of pip is installed?

@gediminasz

gediminasz commented Jun 20, 2022 •

Copy link
Copy Markdown
Contributor

pip 22.0.2

Good call though, I've tested with more pip versions:

Ubuntu Python pip error?
20.04 3.8.10 20.0.2 no
20.04 3.8.10 22.1.2 yes
22.04 3.10.4 22.0.2 yes
22.04 3.10.4 21.3.1 yes
22.04 3.10.4 20.3.4 no

I suppose I can workaround this using pip install 'pip<21'

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants