Magnum fails with "ModuleNotFoundError: No module named 'encodings'"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack-Ansible |
Fix Released
|
Undecided
|
Dmitriy Rabotyagov |
Bug Description
The installation of openstack magnum with openstack-ansible succeeds.
But it looks that the magnum-api.service is left in an failure state.
# systemctl status magnum-api.service
● magnum-api.service - magnum-api service
Loaded: loaded (/etc/systemd/
Active: failed (Result: signal) since Tue 2019-12-31 18:42:53 UTC; 23h ago
Process: 2087 ExecStart=
Main PID: 2087 (code=killed, signal=ABRT)
CPU: 20ms
Dec 31 18:42:51 controller0-
Dec 31 18:42:53 controller0-
Dec 31 18:42:53 controller0-
Dec 31 18:42:53 controller0-
Dec 31 18:42:53 controller0-
Dec 31 18:42:53 controller0-
Dec 31 18:42:53 controller0-
Dec 31 18:42:53 controller0-
A bit of research revealed that the root cause might be a problem within uwsgi:
# /openstack/
[uWSGI] getting INI configuration from /etc/uwsgi/
*** Starting uWSGI 2.0.18 (64bit) on [Wed Jan 1 17:54:27 2020] ***
compiled with version: 7.4.0 on 31 December 2019 14:38:20
os: Linux-4.
nodename: controller0-
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 48
current working directory: /root
detected binary path: /openstack/
*** dumping internal routing table ***
[rule: 0] subject: user_agent regexp: ^osa-haproxy-
*** end of the internal routing table ***
setgid() to 999
setuid() to 999
your processes number limit is 768209
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to TCP address 0.0.0.0:9511 fd 3
Python version: 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0]
Set PythonHome to /openstack/
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundE
Current thread 0x00007ff521e27240 (most recent call first):
Aborted
Using openstack-ansible 20.0.0 on Ubuntu 18.04 LTS systems.
N.B.:
I'm not really sure if this is a problem of openstack-ansible or magnum.
Changed in openstack-ansible: | |
assignee: | nobody → Dmitriy Rabotyagov (noonedeadpunk) |
status: | New → In Progress |
It looks that this might be a mixture between python3 and python2?
/var/log/ python_ venv_build. log:
Ignoring argparse: markers 'python_version == "2.7"' don't match your environment
and also in /etc/uwsgi/ magnum- api.ini:
wsgi-file = /openstack/ venvs/magnum- 20.0.0/ lib/python2. 7/site- packages/ magnum/ api/app. wsgi
but /openstack/ venvs/magnum- 20.0.0/ lib/python2. 7 does not exists at all - only the 3.6 version.
# /openstack/ venvs/magnum- 20.0.0/ bin/python --version
Python 3.6.9