NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.29k stars 13.54k forks source link

certbot crashes with the plugins certbot-dns-route53 or certbot-dns-google #285252

Open basvandijk opened 7 months ago

basvandijk commented 7 months ago

Describe the bug

Running the certbot binary produced by certbot.withPlugins applied to either certbot-dns-route53 or certbot-dns-google on nixpkgs-23.11 leads to a crash. The other plugins work fine.

Note that this will be fixed by https://github.com/NixOS/nixpkgs/pull/285256 because that stops using the deprecated pkg_resources API included in setuptools.

Steps To Reproduce

$ cd nixpkgs

$ git rev-parse HEAD
7731670498f0a22c361c9d68f73d382bce05d7dc

$ nix-shell -p 'let pkgs = import ./. {}; 
                in pkgs.certbot.withPlugins (plugins: 
                  [ plugins.certbot-dns-route53 ]
                )' --run 'certbot --version'
An unexpected error occurred:
pkg_resources.ContextualVersionConflict: (urllib3 2.0.7 (/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages), Requirement.parse('urllib3<1.27,>=1.25.4'), {'botocore'})
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /run/user/1000/certbot-log-11gvfrap/log or re-run Certbot with -v for more details.

$ cat /run/user/1000/certbot-log-11gvfrap/log
2024-01-31 10:49:53,378:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
  File "/nix/store/bp8mcahpnlj19gnw9pgb8kpmh8jjyzhf-python3.11-certbot-2.6.0/bin/.certbot-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/certbot/main.py", line 19, in main
    return internal_main.main(cli_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/certbot/_internal/main.py", line 1835, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/certbot/_internal/plugins/disco.py", line 192, in find_all
    cls._load_entry_point(entry_point, plugins)
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/certbot/_internal/plugins/disco.py", line 199, in _load_entry_point
    plugin_ep = PluginEntryPoint(entry_point)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/certbot/_internal/plugins/disco.py", line 40, in __init__
    self.plugin_cls: Type[interfaces.Plugin] = entry_point.load()
                                               ^^^^^^^^^^^^^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2517, in load
    self.require(*args, **kwargs)
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2540, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
           ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages/pkg_resources/__init__.py", line 875, in _resolve_dist
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (urllib3 2.0.7 (/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages), Requirement.parse('urllib3<1.27,>=1.25.4'), {'botocore'})
2024-01-31 10:49:53,378:ERROR:certbot._internal.log:An unexpected error occurred:
2024-01-31 10:49:53,379:ERROR:certbot._internal.log:pkg_resources.ContextualVersionConflict: (urllib3 2.0.7 (/nix/store/y9a9gszwyxm6802w83pl88x0v8k1pn55-python3-3.11.6-env/lib/python3.11/site-packages), Requirement.parse('urllib3<1.27,>=1.25.4'), {'botocore'})

Notify maintainers

CC @domenkozar

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.0-1048-kvm, Ubuntu, 22.04.1 LTS (Jammy Jellyfish), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.15.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
hellwolf commented 5 months ago

I am researching a similar "ContextualVersionConflict" error, and I stumbled upon this issue.

But for this one, I think it has probably been fixed.