Bug 42278 - Encountered exception during recovery: AttributeError: module 'base64' has no attribute 'decodestring'
Summary: Encountered exception during recovery: AttributeError: module 'base64' has no...
Status: CLOSED FIXED
Alias: None
Product: Branch p10
Classification: Unclassified
Component: certbot-dns_rfc2136 (show other bugs)
Version: не указана
Hardware: x86_64 Linux
: P5 normal
Assignee: Vitaly Lipatov
QA Contact: qa-p10@altlinux.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-28 20:01 MSK by Анатолий Кирсанов
Modified: 2024-02-29 01:20 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Анатолий Кирсанов 2022-03-28 20:01:01 MSK
Оказалось, что в Python 3.9 убили искомую функцию: "base64.encodestring() and base64.decodestring(), aliases deprecated since Python 3.1, have been remove"

Это текст отсюда
https://docs.python.org/3.9/whatsnew/3.9.html

На P10:
# python3 --version
Python 3.9.6
# certbot --version
certbot 1.17.0

При этом в Сизифе есть намного новее certbot:
https://packages.altlinux.org/ru/sisyphus/srpms/certbot/

Не сомневаюсь, что более новые версии этого плагина адаптированы к свежей версии Python. Требуется обновление.
Comment 1 Aleksandr Sysoev 2023-04-04 10:04:27 MSK
Так-же тут https://docs.python.org/3.9/whatsnew/3.9.html указано  "use base64.encodebytes() and base64.decodebytes() instead". То есть на замену вот этому "base64.encodestring() and base64.decodestring()" пришло вышеописанное, если верить документации.
Comment 2 Анатолий Кирсанов 2024-01-14 02:35:37 MSK
(Ответ для Aleksandr Sysoev на комментарий #1)
> Так-же тут https://docs.python.org/3.9/whatsnew/3.9.html указано  "use
> base64.encodebytes() and base64.decodebytes() instead". То есть на замену
> вот этому "base64.encodestring() and base64.decodestring()" пришло
> вышеописанное, если верить документации.

Люди этому поверили в 2019 году и все исправили. Требуется перенести из Сизиф на P10 пакет python3-module-dns.

Подробнее:

В логе /var/log/letsencrypt/letsencrypt.log видно где конкретно происходит ошибка.

2024-01-14 02:08:45,454:DEBUG:certbot._internal.error_handler:Encountered exception:
Traceback (most recent call last):
  File "/usr/share/certbot/certbot/_internal/auth_handler.py", line 73, in handle_authorizations
    resps = self.auth.perform(achalls)
  File "/usr/share/certbot/certbot/plugins/dns_common.py", line 69, in perform
    self._perform(domain, validation_domain_name, validation)
  File "/usr/share/certbot/certbot_dns_rfc2136/_internal/dns_rfc2136.py", line 79, in _perform
    self._get_rfc2136_client().add_txt_record(validation_name, validation, self.ttl)
  File "/usr/share/certbot/certbot_dns_rfc2136/_internal/dns_rfc2136.py", line 87, in _get_rfc2136_client
    return _RFC2136Client(self.credentials.conf('server'),
  File "/usr/share/certbot/certbot_dns_rfc2136/_internal/dns_rfc2136.py", line 103, in __init__
    self.keyring = dns.tsigkeyring.from_text({
  File "/usr/lib/python3/site-packages/dns/tsigkeyring.py", line 35, in from_text
    secret = base64.decodestring(maybe_encode(textring[keytext]))
AttributeError: module 'base64' has no attribute 'decodestring'

$ apf find /usr/lib/python3/site-packages/dns/tsigkeyring.py
python3-module-dns

Проблема решена 05.01.2019 в коммите https://github.com/rthalley/dnspython/commit/f93c8c6ad41d38ccd19335a5a0a396cbaa409caf
Он соответствует версии v2.0.0rc1. И в Сизифе все давно уже есть. Там вообще 2.2.0.

Да и о самой ошибке было известно давно https://github.com/rthalley/dnspython/issues/338 (01.11.2018)
Comment 3 Vitaly Lipatov 2024-01-21 19:31:50 MSK
338224 EPERM #2 p10 python3-module-dns.git=2.2.0-alt2
Comment 4 Vitaly Lipatov 2024-02-29 01:20:02 MSK
В p10 пришёл python3-module-dns.git=2.2.0-alt2
https://packages.altlinux.org/ru/tasks/338224/