While installing self hosted matrix via the ansible docker installation I faced an issue with registration bot.
As I am running on arm architecture, so ansible is relying on building the image from source instead of pulling from docker hub, hence, pulling the new image for python:3-slim, that used to be 3.11 and now is 3.12
TASK [galaxy/systemd_service_manager : Fail if service isn't detected to be running] ************************************************************************************************
failed: [matrix.rocuevas.mx] (item=matrix-bot-matrix-registration-bot.service) => changed=false
ansible_loop_var: item
item: matrix-bot-matrix-registration-bot.service
msg: matrix-bot-matrix-registration-bot.service was not detected to be running. It's possible that there's a configuration problem or another service on your server interferes with it (uses the same ports, etc.). Try running `systemctl status matrix-bot-matrix-registration-bot.service` and `journalctl -fu matrix-bot-matrix-registration-bot.service` on the server to investigate. If you're on a slow or overloaded server, it may be that services take a longer time to start and that this error is a false-positive. You can consider raising the value of the `devture_systemd_service_manager_up_verification_delay_seconds` variable. See `/home/rocuevas/matrix-docker-ansible-deploy/roles/galaxy/systemd_service_manager/defaults/main.yml` for more details about that.
Dec 15 17:45:07 matrixsynapseubuntuminimal systemd[1]: matrix-bot-matrix-registration-bot.service: Scheduled restart job, restart counter is at 21365.
Dec 15 17:45:07 matrixsynapseubuntuminimal systemd[1]: Stopped Matrix registration bot.
Dec 15 17:45:07 matrixsynapseubuntuminimal systemd[1]: Starting Matrix registration bot...
Dec 15 17:45:07 matrixsynapseubuntuminimal systemd[1]: Started Matrix registration bot.
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: Traceback (most recent call last):
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/bin/matrix-registration-bot", line 5, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from matrix_registration_bot.bot import run_bot
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/matrix_registration_bot/bot.py", line 2, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: import simplematrixbotlib as botlib
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/simplematrixbotlib/__init__.py", line 1, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from simplematrixbotlib.api import Api
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/simplematrixbotlib/api.py", line 3, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from nio import (AsyncClient, AsyncClientConfig)
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/nio/__init__.py", line 9, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from .client import *
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/nio/client/__init__.py", line 3, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from .base_client import Client, ClientConfig
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/nio/client/base_client.py", line 36, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from ..crypto import ENCRYPTION_ENABLED, DeviceStore, OlmDevice, OutgoingKeyRequest
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/nio/crypto/__init__.py", line 38, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from .olm_machine import Olm
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/nio/crypto/olm_machine.py", line 87, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from .sas import Sas
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/nio/crypto/sas.py", line 26, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from future.moves.itertools import zip_longest
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/future/moves/__init__.py", line 5, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: from future.standard_library import import_top_level_modules
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: File "/opt/venv/lib/python3.12/site-packages/future/standard_library/__init__.py", line 65, in <module>
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: import imp
Dec 15 17:45:08 matrixsynapseubuntuminimal matrix-bot-matrix-registration-bot[1637936]: ModuleNotFoundError: No module named 'imp'
Dec 15 17:45:08 matrixsynapseubuntuminimal systemd[1]: matrix-bot-matrix-registration-bot.service: Main process exited, code=exited, status=1/FAILURE
Dec 15 17:45:08 matrixsynapseubuntuminimal systemd[1]: matrix-bot-matrix-registration-bot.service: Failed with result 'exit-code'.
While installing self hosted matrix via the ansible docker installation I faced an issue with registration bot. As I am running on arm architecture, so ansible is relying on building the image from source instead of pulling from docker hub, hence, pulling the new image for python:3-slim, that used to be 3.11 and now is 3.12
systemclt
journalctl
looks like this is an issue with python 3.12 dropping imp module , https://stackoverflow.com/questions/77274572/multiqc-modulenotfounderror-no-module-named-imp
the 3-slim python image is now using 3.12 https://github.com/docker-library/python/blob/ab3d095cb74ee82f11b6dc59f113ad01b60d41c1/3.12/slim-bookworm/Dockerfile
so expliciting setting this to 3.11-slim should avoid this issue https://github.com/docker-library/python/blob/8bc80d1109001365559eded16423ba3692eff1ff/3.11/slim-bookworm/Dockerfile