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

baibot and postmoogle don't work on IPv6-only host #3764

Open
nolith opened this issue Nov 11, 2024 · 2 comments
Open

baibot and postmoogle don't work on IPv6-only host #3764

nolith opened this issue Nov 11, 2024 · 2 comments
Labels

Comments

@nolith
Copy link

nolith commented Nov 11, 2024

Describe the bug
A clear and concise description of what the bug is.

My homeserver is IPv6 only, the machine is dualstack but only ipv6 is public and part of my DNS entry.

Both baibot and postmoogle fail to boot because they resolve my matrix.example.com to IPv6 no have no way to reach it.

I had to add the following lines to my vars to trick the services into resolve the homeserver address using the local address

matrix_postmoogle_container_extra_arguments:
  - "--add-host='{{matrix_server_fqn_matrix}}:{{ansible_default_ipv4.address}}'"
matrix_bot_baibot_container_extra_arguments:
  - "--add-host='{{matrix_server_fqn_matrix}}:{{ansible_default_ipv4.address}}'"

To Reproduce

matrix_server_fqn_matrix must only have an IPv6 entry, no ipv4

My vars.yml file looks like this:

---
matrix_domain: redacted
matrix_homeserver_implementation: synapse
matrix_homeserver_generic_secret_key: "{{ lookup('env', 'matrix_homeserver_generic_secret_key') }}"
matrix_playbook_reverse_proxy_type: playbook-managed-traefik
traefik_config_certificatesResolvers_acme_email: 'redacted'
postgres_connection_password: "{{ lookup('env', 'postgres_connection_password') }}"
matrix_sliding_sync_enabled: true
matrix_admin: "@alessio:{{ matrix_domain }}"
matrix_appservice_double_puppet_enabled: true
matrix_bridges_encryption_enabled: true
matrix_bridges_encryption_default: true
matrix_static_files_container_labels_base_domain_enabled: true


matrix_bot_baibot_enabled: true
matrix_bot_baibot_config_user_password: "{{ lookup('env', 'matrix_bot_baibot_config_user_password') }}"

matrix_bot_baibot_config_user_encryption_recovery_passphrase: "{{ lookup('env', 'matrix_bot_baibot_config_user_encryption_recovery_passphrase') }}"
matrix_bot_baibot_config_persistence_session_encryption_key: "{{ lookup('env', 'matrix_bot_baibot_config_persistence_session_encryption_key') }}"
matrix_bot_baibot_config_persistence_config_encryption_key: "{{ lookup('env', 'matrix_bot_baibot_config_persistence_config_encryption_key') }}"

matrix_bot_baibot_config_initial_global_config_user_patterns:
  - "@alessio:{{ matrix_bot_baibot_config_homeserver_server_name }}"

matrix_bot_baibot_config_agents_static_definitions_openai_enabled: true
matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key: "{{ lookup('env', 'matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key') }}"
matrix_bot_baibot_config_initial_global_config_handler_catch_all: static/openai


matrix_postmoogle_enabled: true
matrix_postmoogle_password: "{{ lookup('env', 'matrix_postmoogle_password') }}"

Expected behavior

baibot and postmoogle starts.

I forgot to take the exact error of postmoogle, but for baibot the error in the logs is this one

Nov 10 13:25:10 matrix matrix-bot-baibot[774446]: Error: Error creating a new login session: Error recovering encryption keys: Failed to recover with an unknown error: Failed to recover with an unknown error: SecretStorage(Sdk(Http(Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("matrix.REDACTED")), port: None, path: "/_matrix/client/v3/user/@baibot:REDACTED/account_data/m.secret_storage.default_key", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" })) }))))

Matrix Server:

  • OS: Debian 12
  • Architecture amd64

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

  • where you run Ansible -- e.g. on the Matrix server itself; on another computer (which OS? distro? standard installation or containerized Ansible?)
  • what version of Ansible you're running (see ansible --version)

Additional context
Add any other context about the problem here.

@nolith nolith added the bug label Nov 11, 2024
@nolith
Copy link
Author

nolith commented Nov 12, 2024

I'm trying other options like setting

docker_daemon_options:
  experimental: true
  ipv6: true
  ip6tables: true
  fixed-cidr-v6: "REDACTED::/64" # get something from https://simpledns.plus/private-ipv6

With this I was able to remove the baibot extra hosts

matrix_bot_baibot_container_extra_arguments:
  - "--add-host='{{matrix_server_fqn_matrix}}:{{ansible_default_ipv4.address}}'"

But could not do the same for postmoogle, I have the impression that the software only works with ipv4

@aine-etke
Copy link
Collaborator

Any component in a docker container relies on the docker networking because all components are connected via bridged networks
Any component that makes discovery of the matrix server itself will use the DNS records returned by docker
If docker (and/or its bridged networks) have IPv4-only, then you won't get IPv6 working inside the containers.

Both Baibot and Postmoogle are capable of working with IPv4 and IPv6, the question is proper network configuration. Unfortunately, IPv6 doesn't always work well with docker.

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

2 participants