Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registration-bot: Invalid Homeserver #3939

Open
Wunderharke opened this issue Jan 15, 2025 · 2 comments
Open

registration-bot: Invalid Homeserver #3939

Wunderharke opened this issue Jan 15, 2025 · 2 comments
Labels

Comments

@Wunderharke
Copy link
Contributor

Describe the bug
I enabled the bot following the official documentation. However, the bot fails to start, and the service logs indicate a configuration issue. Below is the error output from the service logs.

To Reproduce
My vars.yml file looks like this:

#https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-bot-matrix-registration-bot.md
matrix_bot_matrix_registration_bot_enabled: true
# By default, the playbook will set use the bot with a username like this: `@bot.matrix-registration-bot:example.com`.
# Uncomment and adjust this part if you'd like to use a username different than the default
# matrix_bot_matrix_registration_bot_matrix_user_id_localpart: bot.matrix-registration-bot
# Generate a strong password for the bot. You can create one with a command like `pwgen -s 64 1`.
matrix_bot_matrix_registration_bot_bot_password: "XXX"
# Enables registration
matrix_synapse_enable_registration: true
# Restrict registration to users with a token
matrix_synapse_registration_requires_token: true

Expected behavior
A clear and concise description of what you expected to happen.

Matrix Server:

  • OS: Ubuntu 22.04
  • Architecture amd64

Service Log

Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,190 INFO:Tying to load bot configuration from /config/config.yml
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,191 DEBUG:BOT_SERVER not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 DEBUG:BOT_USERNAME not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 DEBUG:BOT_PASSWORD not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 DEBUG:BOT_ACCESS_TOKEN not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 DEBUG:API_BASE_URL not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 DEBUG:API_TOKEN not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 DEBUG:LOGGING_LEVEL not set in environment
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,192 INFO:Using password based authentication for the bot
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,243 INFO:Loaded the simple-matrix-bot config file config.toml
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: 2025-01-15 18:58:03,243 INFO:Using username/password from bot section of config
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: Traceback (most recent call last):
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/opt/venv/bin/matrix-registration-bot", line 8, in <module>
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     sys.exit(run_bot())
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:              ^^^^^^^^^
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/opt/venv/lib/python3.11/site-packages/matrix_registration_bot/bot.py", line 222, in run_bot
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     bot.run()
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/opt/venv/lib/python3.11/site-packages/simplematrixbotlib/bot.py", line 96, in run
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     asyncio.run(self.main())
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     return runner.run(main)
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:            ^^^^^^^^^^^^^^^^
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     return self._loop.run_until_complete(task)
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     return future.result()
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:            ^^^^^^^^^^^^^^^
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:   File "/opt/venv/lib/python3.11/site-packages/simplematrixbotlib/bot.py", line 56, in main
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]:     raise ValueError("Invalid Homeserver")
Jan 15 19:58:03 matrix matrix-bot-matrix-registration-bot[83712]: ValueError: Invalid Homeserver
Jan 15 19:58:03 matrix systemd[1]: matrix-bot-matrix-registration-bot.service: Main process exited, code=exited, status=1/FAILURE
@luixxiul
Copy link
Collaborator

@spantaleev
Copy link
Owner

There may be some playbook configuration issue at play here, but..


I cannot test this, because I'm on arm64 which requires self-building.

matrix-registration-bot is currently pinned to v1.3.0 for the playbook, so this Dockerfile is being used.

This Dockerfile specifies an unpinned container image (python:3-slim) as its starting point, which is very common, but always a bad practice that comes back to bite people. As it stands, python:3-slim used to refer to some old Python version, but now points to a very new one (currently 3.13.1).

To resulting container image fails when running with an error:

ModuleNotFoundError: No module named 'imp'

This is because the imp module is:

Deprecated since version 3.4, removed in version 3.12.

I'm not sure which matrix-registration-bot dependency tries to pull imp and why, etc. It seems like matrix-registration-bot hasn't seen any commits in 2 years. It's likely unmaintained, but I'd rather wait for @moan0s to tell us what the status of the project is and whether potential fixes for this new problem will be done.

This issue has already been reported upstream in moan0s/matrix-registration-bot#35

This issue has also been mentioned by another matrix-docker-ansible-deploy user in #3064

Unless there's a plan to fix this, I believe we should mark matrix-registration-bot as unmaintained and plan its removal from the playbook to avoid any such future issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants