Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-03 Thread Nicolas Grandjean
Hi Harlan,

Le 02/01/2021 à 23:25, Harlan Lieberman-Berg a écrit :
> Hi Nicolas,
> 
> Your installation of python3-cryptography is very broken.  You appear
> to be missing about half of the files for some reason.  Try
> reinstalling python3-cryptography and see if that fixes the problem:
> 
> apt reinstall python3-cryptography

You are right. Reinstall the package solved the problem.

So, it was not a package bug…

Thanks !


-- 
Nicolas Grandjean



Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-02 Thread Harlan Lieberman-Berg
Hi Nicolas,

Your installation of python3-cryptography is very broken.  You appear
to be missing about half of the files for some reason.  Try
reinstalling python3-cryptography and see if that fixes the problem:

apt reinstall python3-cryptography

On Sat, Jan 2, 2021 at 3:09 AM Nicolas Grandjean  wrote:
>
>
>
> Le 01/01/2021 à 22:16, Harlan Lieberman-Berg a écrit :
> > […]
> > Can you also attach the output of this new script?
>
> You can find it in the attached files.
>
> $ ./import2.py > import2.out1 2> import2.out2
>
>
> --
> Nicolas



-- 
Harlan Lieberman-Berg
~hlieberman



Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-02 Thread Nicolas Grandjean


Le 01/01/2021 à 22:16, Harlan Lieberman-Berg a écrit :
> […]
> Can you also attach the output of this new script?

You can find it in the attached files.

$ ./import2.py > import2.out1 2> import2.out2


-- 
Nicolas
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # 
import '_warnings' # 
import '_weakref' # 
# installing zipimport hook
import 'zipimport' # 
# installed zipimport hook
import '_frozen_importlib_external' # 
import '_io' # 
import 'marshal' # 
import 'posix' # 
import _thread # previously loaded ('_thread')
import '_thread' # 
import _weakref # previously loaded ('_weakref')
import '_weakref' # 
# /usr/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc matches 
/usr/lib/python3.7/encodings/__init__.py
# code object from 
'/usr/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc'
# trying /usr/lib/python3.7/codecs.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/codecs.abi3.so
# trying /usr/lib/python3.7/codecs.so
# trying /usr/lib/python3.7/codecs.py
# /usr/lib/python3.7/__pycache__/codecs.cpython-37.pyc matches 
/usr/lib/python3.7/codecs.py
# code object from '/usr/lib/python3.7/__pycache__/codecs.cpython-37.pyc'
import '_codecs' # 
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f9ad141acf8>
# trying /usr/lib/python3.7/encodings/aliases.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/encodings/aliases.abi3.so
# trying /usr/lib/python3.7/encodings/aliases.so
# trying /usr/lib/python3.7/encodings/aliases.py
# /usr/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc matches 
/usr/lib/python3.7/encodings/aliases.py
# code object from 
'/usr/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader 
object at 0x7f9ad142f6d8>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f9ad141a748>
# trying /usr/lib/python3.7/encodings/utf_8.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/encodings/utf_8.abi3.so
# trying /usr/lib/python3.7/encodings/utf_8.so
# trying /usr/lib/python3.7/encodings/utf_8.py
# /usr/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc matches 
/usr/lib/python3.7/encodings/utf_8.py
# code object from 
'/usr/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object 
at 0x7f9ad143e400>
import '_signal' # 
# trying /usr/lib/python3.7/encodings/latin_1.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/encodings/latin_1.abi3.so
# trying /usr/lib/python3.7/encodings/latin_1.so
# trying /usr/lib/python3.7/encodings/latin_1.py
# /usr/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc matches 
/usr/lib/python3.7/encodings/latin_1.py
# code object from 
'/usr/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader 
object at 0x7f9ad143eef0>
# trying /usr/lib/python3.7/io.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/io.abi3.so
# trying /usr/lib/python3.7/io.so
# trying /usr/lib/python3.7/io.py
# /usr/lib/python3.7/__pycache__/io.cpython-37.pyc matches 
/usr/lib/python3.7/io.py
# code object from '/usr/lib/python3.7/__pycache__/io.cpython-37.pyc'
# trying /usr/lib/python3.7/abc.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/abc.abi3.so
# trying /usr/lib/python3.7/abc.so
# trying /usr/lib/python3.7/abc.py
# /usr/lib/python3.7/__pycache__/abc.cpython-37.pyc matches 
/usr/lib/python3.7/abc.py
# code object from '/usr/lib/python3.7/__pycache__/abc.cpython-37.pyc'
import '_abc' # 
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f9ad1444518>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f9ad1444160>
# trying /usr/lib/python3.7/_bootlocale.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/_bootlocale.abi3.so
# trying /usr/lib/python3.7/_bootlocale.so
# trying /usr/lib/python3.7/_bootlocale.py
# /usr/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc matches 
/usr/lib/python3.7/_bootlocale.py
# code object from '/usr/lib/python3.7/__pycache__/_bootlocale.cpython-37.pyc'
import '_locale' # 
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 
0x7f9ad1444b00>
# trying /usr/lib/python3.7/site.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/site.abi3.so
# trying /usr/lib/python3.7/site.so
# trying /usr/lib/python3.7/site.py
# /usr/lib/python3.7/__pycache__/site.cpython-37.pyc matches 
/usr/lib/python3.7/site.py
# code object from '/usr/lib/python3.7/__pycache__/site.cpython-37.pyc'
# trying /usr/lib/python3.7/os.cpython-37m-x86_64-linux-gnu.so
# trying /usr/lib/python3.7/os.abi3.so
# trying /usr/lib/python3.7/os.so
# trying /usr/lib/python3.7/os.py
# /usr/lib/python3.7/__pycache__/os.cpython-37.pyc matches 
/usr/lib/python3.7/os.py
# code object from 

Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-01 Thread Harlan Lieberman-Berg
On Fri, Jan 1, 2021 at 6:24 AM Nicolas Grandjean  wrote:
> nicolas@krypton:/tmp$ ./import.py
> /usr/lib/python3/dist-packages/cryptography/__init__.py
> 2.6.1
> /usr/lib/python3/dist-packages/cryptography/hazmat/__init__.py
> None
> Traceback (most recent call last):
>   File "./import.py", line 10, in 
> import cryptography.hazmat.primitives.asymmetric
> ModuleNotFoundError: No module named
> 'cryptography.hazmat.primitives.asymmetric'

Curiouser and curiouser!  The version of the module you have installed
clearly has the module that it's complaining it can't find.  And the
'None' there is strange; that means it successfully loaded
cryptography.hazmat.primitives (otherwise the ModuleNotFoundError
would have been for cryptography.hazmat.primitives, instead of
cryptography.hazmat.primitives.asymmetric), but that the module didn't
have a path.

A couple more things to try so we can get some more info:

find /usr/lib/python3/dist-packages/cryptography/hazmat -name __init__.py -ls

Can you also attach the output of this new script?
-- 
Harlan Lieberman-Berg
~hlieberman
#!/usr/bin/python3 -vvv

import os, sys
import pkgutil

def print_submodules(module):
for loader, module_name, is_pkg in pkgutil.walk_packages(module.__path__, module.__name__+'.'):
print(module_name)
module_name = __import__(module_name, fromlist='dummylist')
if is_pkg:
print_submodules(module_name)

import cryptography
print_submodules(cryptography)


Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-01 Thread Nicolas Grandjean


hi harlan,

Le 01/01/2021 à 11:20, Harlan Lieberman-Berg a écrit :
> That's a strange error.  certbot depends on python3-certbot, which I
> see you have installed.  That package depends on python3-cryptography,
> which should have the python module that it's erroring about.
>
> A couple of things to get some more intel.  First, what's the output
> of the following: dpkg -s python3-cryptography python3-certbot certbot

It's in the file `dpkg-output`.

> Second, can you run the attached script and give me the output?

nicolas@krypton:/tmp$ ./import.py
/usr/lib/python3/dist-packages/cryptography/__init__.py
2.6.1
/usr/lib/python3/dist-packages/cryptography/hazmat/__init__.py
None
Traceback (most recent call last):
  File "./import.py", line 10, in 
import cryptography.hazmat.primitives.asymmetric
ModuleNotFoundError: No module named
'cryptography.hazmat.primitives.asymmetric'


I hope it can be useful


-- 
Nicolas

Package: python3-cryptography
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 1417
Maintainer: Tristan Seligmann 
Architecture: amd64
Source: python-cryptography
Version: 2.6.1-3+deb10u2
Depends: python3 (>= 3~), python3-asn1crypto (>= 0.21.0~), 
python3-cffi-backend-api-min (<= 9729), python3-cffi-backend-api-max (>= 9729), 
python3-six (>= 1.4.1), python3:any, libc6 (>= 2.14), libssl1.1 (>= 1.1.1)
Suggests: python-cryptography-doc, python3-cryptography-vectors
Breaks: python3-openssl (<< 16.0.0)
Description: Python library exposing cryptographic recipes and primitives 
(Python 3)
 The cryptography library is designed to be a "one-stop-shop" for
 all your cryptographic needs in Python.
 .
 As an alternative to the libraries that came before it, cryptography
 tries to address some of the issues with those libraries:
  - Lack of PyPy and Python 3 support.
  - Lack of maintenance.
  - Use of poor implementations of algorithms (i.e. ones with known
side-channel attacks).
  - Lack of high level, "Cryptography for humans", APIs.
  - Absence of algorithms such as AES-GCM.
  - Poor introspectability, and thus poor testability.
  - Extremely error prone APIs, and bad defaults.
 .
 This package contains the Python 3 version of cryptography.
Homepage: https://cryptography.io/

Package: python3-certbot
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 1222
Maintainer: Debian Let's Encrypt 
Architecture: all
Source: python-certbot
Version: 0.31.0-1
Replaces: python-letsencrypt
Depends: python3-acme (>= 0.29.0~), python3-requests (>= 2.4.3), 
python3-configargparse (>= 0.10.0), python3-configobj, python3-cryptography (>= 
1.2.3), python3-josepy, python3-mock, python3-parsedatetime (>= 1.3), 
python3-pkg-resources, python3-rfc3339, python3-tz, python3-zope.component, 
python3-zope.interface, python3:any
Recommends: certbot
Suggests: python-certbot-doc
Breaks: python-certbot-apache (<< 0.20.0), python-certbot-nginx (<< 0.20.0), 
python-letsencrypt (<= 0.6.0)
Description: main library for certbot
 The objective of Certbot, Let's Encrypt, and the ACME (Automated
 Certificate Management Environment) protocol is to make it possible
 to set up an HTTPS server and have it automatically obtain a
 browser-trusted certificate, without any human intervention. This is
 accomplished by running a certificate management agent on the web
 server.
 .
 This agent is used to:
 .
   - Automatically prove to the Let's Encrypt CA that you control the website
   - Obtain a browser-trusted certificate and set it up on your web server
   - Keep track of when your certificate is going to expire, and renew it
   - Help you revoke the certificate if that ever becomes necessary.
 .
 This package contains the main libraries.
Homepage: https://certbot.eff.org/

Package: certbot
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 68
Maintainer: Debian Let's Encrypt 
Architecture: all
Source: python-certbot
Version: 0.31.0-1
Replaces: letsencrypt
Provides: letsencrypt
Depends: python3-certbot (= 0.31.0-1), python3:any
Suggests: python3-certbot-apache, python3-certbot-nginx, python-certbot-doc
Breaks: letsencrypt (<= 0.6.0)
Conffiles:
 /etc/cron.d/certbot b100f45b33319f91060b0a59721a0ede
 /etc/letsencrypt/cli.ini dc5a5672c8f966a968ac0c98c447c14e
 /etc/logrotate.d/certbot a815a66a333f2637c00055fcd44b02d4
Description: automatically configure HTTPS using Let's Encrypt
 The objective of Certbot, Let's Encrypt, and the ACME (Automated
 Certificate Management Environment) protocol is to make it possible
 to set up an HTTPS server and have it automatically obtain a
 browser-trusted certificate, without any human intervention. This is
 accomplished by running a certificate management agent on the web
 server.
 .
 This agent is used to:
 .
   - Automatically prove to the Let's Encrypt CA that you control the website
   - Obtain a browser-trusted certificate and set it up on your web server
   - Keep track of when your certificate is going to expire, and 

Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-01 Thread Harlan Lieberman-Berg
On Fri, Jan 1, 2021 at 4:57 AM Nicolas Grandjean  wrote:
> Dec 31 19:03:18 krypton certbot[4849]: ModuleNotFoundError: No module named 
> 'cryptography.hazmat.primitives.asymmetric'

Hi Nicolas,

That's a strange error.  certbot depends on python3-certbot, which I
see you have installed.  That package depends on python3-cryptography,
which should have the python module that it's erroring about.

A couple of things to get some more intel.  First, what's the output
of the following: dpkg -s python3-cryptography python3-certbot certbot

Second, can you run the attached script and give me the output?

-- 
Harlan Lieberman-Berg
~hlieberman
#!/usr/bin/python3

import cryptography
print(cryptography.__file__)
print(cryptography.__version__)
import cryptography.hazmat
print(cryptography.hazmat.__file__)
import cryptography.hazmat.primitives
print(cryptography.hazmat.primitives.__file__)
import cryptography.hazmat.primitives.asymmetric
print(cryptography.hazmat.primitives.asymmetric.__file__)


Bug#978962: certbot: Certbot needs python-cryptography to work

2021-01-01 Thread Nicolas Grandjean
Package: certbot
Version: 0.31.0-1
Severity: normal

Dear Maintainer,

I think the `certbot` package needs `python-cryptography` package :

Dec 31 19:03:17 krypton systemd[1]: Starting Certbot...
Dec 31 19:03:18 krypton certbot[4849]: Traceback (most recent call last):
Dec 31 19:03:18 krypton certbot[4849]:   File "/usr/bin/certbot", line 11, in 

Dec 31 19:03:18 krypton certbot[4849]: load_entry_point('certbot==0.31.0', 
'console_scripts', 'certbot')()
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 489, in 
load_entry_point
Dec 31 19:03:18 krypton certbot[4849]: return 
get_distribution(dist).load_entry_point(group, name)
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2793, in 
load_entry_point
Dec 31 19:03:18 krypton certbot[4849]: return ep.load()
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2411, in load
Dec 31 19:03:18 krypton certbot[4849]: return self.resolve()
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2417, in 
resolve
Dec 31 19:03:18 krypton certbot[4849]: module = 
__import__(self.module_name, fromlist=['__name__'], level=0)
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/certbot/main.py", line 10, in 
Dec 31 19:03:18 krypton certbot[4849]: import josepy as jose
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/josepy/__init__.py", line 44, in 
Dec 31 19:03:18 krypton certbot[4849]: from josepy.interfaces import 
JSONDeSerializable
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/josepy/interfaces.py", line 8, in 
Dec 31 19:03:18 krypton certbot[4849]: from josepy import errors, util
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/josepy/util.py", line 4, in 
Dec 31 19:03:18 krypton certbot[4849]: import OpenSSL
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in 
Dec 31 19:03:18 krypton certbot[4849]: from OpenSSL import crypto, SSL
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 12, in 
Dec 31 19:03:18 krypton certbot[4849]: from cryptography import x509
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/cryptography/x509/__init__.py", line 8, in 

Dec 31 19:03:18 krypton certbot[4849]: from cryptography.x509.base import (
Dec 31 19:03:18 krypton certbot[4849]:   File 
"/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 15, in 
Dec 31 19:03:18 krypton certbot[4849]: from 
cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
Dec 31 19:03:18 krypton certbot[4849]: ModuleNotFoundError: No module named 
'cryptography.hazmat.primitives.asymmetric'
Dec 31 19:03:18 krypton systemd[1]: certbot.service: Main process exited, 
code=exited, status=1/FAILURE
Dec 31 19:03:18 krypton systemd[1]: certbot.service: Failed with result 
'exit-code'.
Dec 31 19:03:18 krypton systemd[1]: Failed to start Certbot.

The `python-cryptography` contains the
`cryptography.hazmat.primitives.asymmetric` module.


-- System Information:
Debian Release: 10.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-13-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages certbot depends on:
ii  python3  3.7.3-1
ii  python3-certbot  0.31.0-1

certbot recommends no packages.

Versions of packages certbot suggests:
pn  python-certbot-doc  
ii  python3-certbot-apache  0.31.0-1
pn  python3-certbot-nginx   

-- no debconf information