FS#75504 - [cerbot] unable to renew due to python dependency error with dns-lexicon and importlib-metadata

Attached to Project: Community Packages
Opened by dbb (dbb) - Wednesday, 03 August 2022, 14:34 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 03 August 2022, 16:39 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

For the past few days `certbot-renew.service` on one of my servers has been failing with the following error:

```
An unexpected error occurred:
pkg_resources.DistributionNotFound: The 'importlib-metadata>=4' distribution was not found and is required by dns-lexicon
```

These errors began on August 1st and seems to correspond with my upgrade of `dns-lexicon` from `3.9.2-1` to `3.11.3-1` on the same day.

In my case, the actual dependency on `dns-lexicon` is from the `certbot-dns-luadns` package but I assume this affects any plugin that uses `dns-lexicon`.

Manually installing the package `python-importlib-metadata 4.8.1-3` seems to fix the issue and allows `certbot-renew.service` to succeed.

Additional info:
* package version(s)
* certbot 1.29.0-1
* certbot-dns-luadns 1.29.0-1
* dns-lexicon 3.11.3-1
* config and/or log files etc.
* link to upstream bug report, if any
* It appears the importlib-metadata dependency was introduced with this PR: https://github.com/AnalogJ/lexicon/pull/1252

Steps to reproduce:

1. Installing certbot plugin with dns-lexicon dependency and configure it
2. Ensure `python-importlib-metadata` is *not* installed
3. Attempt to get a certificate for an invalid domain, e.g.:

```
# certbot certonly --dns-luadns -d "example.invalid"
```

Observe the error it returns:

```
An unexpected error occurred:
pkg_resources.DistributionNotFound: The 'importlib-metadata>=4' distribution was not found and is required by dns-lexicon
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/tmp7agyl0u5/log or re-run Certbot with -v for more details.
```
This task depends upon

Closed by  Antonio Rojas (arojas)
Wednesday, 03 August 2022, 16:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  dns-lexicon 3.11.3-2

Loading...