spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

matrix-bot-maubot logging not functioning

tonytonyistony opened this issue · comments

Describe the bug
The matrix-bot-maubot is not producing any log files and even when trying to view logs on the container, docker outputs Error response from daemon: configured logging driver does not support reading. Also when inside the maubot admin panel, the logs are blank.

I have went into the shell of the container and cannot find any logs being produced. Comparing of the example-config provided in the container against what is being configured in this deployment, it looks to be missing variables.

EXAMPLE CONFIG

# Python logging configuration.
#
# See section 16.7.2 of the Python documentation for more info:
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
logging:
    version: 1
    formatters:
        colored:
            (): maubot.lib.color_log.ColorFormatter
            format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
        normal:
            format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
    handlers:
        file:
            class: logging.handlers.RotatingFileHandler
            formatter: normal
            filename: ./maubot.log
            maxBytes: 10485760
            backupCount: 10
        console:
            class: logging.StreamHandler
            formatter: colored
    loggers:
        maubot:
            level: DEBUG
        mau:
            level: DEBUG
        aiohttp:
            level: INFO
    root:
        level: DEBUG
        handlers: [file, console]

ANSIBLE GENERATED CONFIG

# Python logging configuration.
#
# See section 16.7.2 of the Python documentation for more info:
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
logging:
    version: 1
    formatters:
        colored:
            (): maubot.lib.color_log.ColorFormatter
            format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
        normal:
            format: '[%(asctime)s] [%(levelname)s@%(name)s] %(message)s'
    handlers:
        console:
            class: logging.StreamHandler
            formatter: colored
    loggers:
        maubot:
            level: "WARNING"
        mau:
            level: "WARNING"
        aiohttp:
            level: "WARNING"
    root:
        level: "WARNING"
        handlers: [console]

To Reproduce
My vars.yml file looks like this:

---

matrix_domain: example.com

matrix_homeserver_implementation: synapse

matrix_homeserver_generic_secret_key: '********'

matrix_playbook_reverse_proxy_type: playbook-managed-traefik

matrix_playbook_ssl_enabled: true

devture_traefik_config_entrypoint_web_secure_enabled: false

devture_traefik_container_web_host_bind_port: '0.0.0.0:81'

devture_traefik_config_entrypoint_web_forwardedHeaders_trustedIPs: ['10.133.3.200']
devture_traefik_config_log_level: ERROR

devture_postgres_connection_password: '********'

matrix_coturn_enabled: false

matrix_synapse_turn_uris:
- turns:turn.example.com?transport=udp
- turns:turn.example.com?transport=tcp
- turn:turn.example.com?transport=udp
- turn:turn.example.com?transport=tcp

matrix_homeserver_federation_enabled: false
matrix_synapse_federation_port_enabled: false
matrix_synapse_reverse_proxy_companion_federation_api_enabled: false

matrix_hookshot_enabled: true

matrix_synapse_admin_enabled: true

matrix_bot_matrix_reminder_bot_enabled: true
matrix_bot_matrix_reminder_bot_matrix_user_id_localpart: bot.matrix-reminder-bot
matrix_bot_matrix_reminder_bot_matrix_user_password: "********"
matrix_bot_matrix_reminder_bot_reminders_timezone: America/*****

matrix_bot_maubot_enabled: true
matrix_bot_maubot_admins:
  - maubotadmin: "********"

matrix_synapse_auto_compressor_enabled: true

Expected behavior
View logs for troubleshooting plugins

Matrix Server:

  • OS: Ubuntu22
  • Architecture: amd64

Ansible:
If your problem appears to be with Ansible, tell us:

  • I believe the custom role for matrix-bot-maubot needs updating to add additional logging settings.
  • ansible [core 2.14.3]

Additional context
Federation disabled, Local Traefik enabled for external RP

        location /_matrix/maubot/v1/logs {
                proxy_pass http://10.133.3.225:81;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header X-Forwarded-For $remote_addr;
        }
        location /_matrix/maubot {
                proxy_pass http://10.133.3.225:81;
                proxy_set_header X-Forwarded-For $remote_addr;
        }

Above is added to the RP to handle Maubot endpoints.

We intentionally use --log-driver=none when starting containers, because we don't want double-logging to happen.

Containers are spawned by systemd services and their logs are captured by systemd-journald. You can see the logs for a particular service by doing (example): journalctl -fu matrix-bot-maubot

We intentionally use --log-driver=none when starting containers, because we don't want double-logging to happen.

Containers are spawned by systemd services and their logs are captured by systemd-journald. You can see the logs for a particular service by doing (example): journalctl -fu matrix-bot-maubot

Wouldnt this break the in app log reader?

Which in-app log reader?

journalctl -fu matrix-bot-maubot

Also how would one go about changing logging severity from the playbook?