spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.9k stars 1.04k forks source link

Signal: No double puppeting with shared secrets enabled #995

Closed buxel closed 2 years ago

buxel commented 3 years ago

For some time, double puppeting did not work on my setup. Initially I assumed that i broke something because it worked in the beginning. Now, i deployed the bridge on a new machine and still have puppeting issues.

Setup

This is a completely new setup with the following configuration:

matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: '<secret>'
matrix_synapse_password_config_localdb_enabled: false

I also have some configuration overrides, but from my understanding, this shouldn't matter:

matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_configuration_extension_yaml: | 
  bridge:
    sync_direct_chat_list: true

Running containers:

ubuntu@matrix-synapse:~$ sudo docker ps --format "{{.Names}} \t {{.CreatedAt}} \t {{.Command}}"
matrix-mx-puppet-discord        2021-04-12 12:08:31 +0000 UTC   "/opt/mx-puppet-disc…"
matrix-mautrix-whatsapp         2021-04-12 12:08:18 +0000 UTC   "/usr/bin/mautrix-wh…"
matrix-mautrix-signal           2021-04-12 12:08:05 +0000 UTC   "python3 -m mautrix_…"
matrix-mautrix-signal-daemon    2021-04-12 12:07:59 +0000 UTC   "/usr/local/bin/sign…"
matrix-synapse                  2021-04-12 12:07:54 +0000 UTC   "/start.py run -m sy…"
matrix-nginx-proxy              2021-04-12 12:07:54 +0000 UTC   "/docker-entrypoint.…"
matrix-coturn                   2021-04-12 12:07:54 +0000 UTC   "turnserver -c /turn…"
matrix-ma1sd                    2021-04-12 12:07:54 +0000 UTC   "/start.sh"
matrix-postgres                 2021-04-12 12:07:51 +0000 UTC   "docker-entrypoint.s…"

Error

When is send a message with the Signal app, it is not visible in Element. Checking the logs, i found:

[DEBUG@mau.portal.5850c994-7080-4e4b-9b20-74daeaf4b0af] Ignoring own message <phone-nr> as user doesn't have double puppeting enabled

This one seems suspicious:

[2021-01-25 18:15:05,260] [DEBUG@mau.puppet.d8fa960d-5b5c-4fca-ab67-04705003e2c7] Migrating memberships @signap_phone_1234567:my.domain -> @signal_d8fa960d-5b5c-4fca-ab67->Jan 25 18:15:07 matrix-synapse matrix-mautrix-signal[28477]: [2021-01-25 18:15:07,161] [INFO@aiohttp.access] 172.18.0.3 [25/Jan/2021:18:15:07 +0000] "PUT /transactions/49?access_token=1042d3f7-42f8-53fa-9704-f61dd0cc3d2a HTTP/1.1" 200 1>Jan 25 18:15:08 matrix-synapse matrix-mautrix-signal[28477]: [2021-01-25 18:15:08,073] [INFO@aiohttp.access] 172.18.0.3 [25/Jan/2021:18:15:08 +0000] "PUT /transactions/50?access_token=1042d3f7-42f8-53fa-9704-f61dd0cc3d2a HTTP/1.1" 200 1>Jan 25 18:15:08 matrix-synapse matrix-mautrix-signal[28477]: [2021-01-25 18:15:08,139] [ERROR@mausignald] Exception in event handler
Traceback (most recent call last):
  File "/opt/mautrix-signal/mausignald/signald.py", line 51, in _run_event_handler
    await handler(event)
  File "/usr/lib/python3.8/site-packages/mautrix_signal/signal.py", line 45, in on_message
    sender = await pu.Puppet.get_by_address(evt.source)
  File "/usr/lib/python3.8/site-packages/mautrix_signal/puppet.py", line 278, in get_by_address
    await puppet.handle_uuid_receive(address.uuid)
  File "/usr/lib/python3.8/site-packages/mautrix_signal/puppet.py", line 118, in handle_uuid_receive
    await self._handle_uuid_receive(uuid)
  File "/usr/lib/python3.8/site-packages/mautrix_signal/puppet.py", line 150, in _handle_uuid_receive
    await self.default_mxid_intent.join_room_by_id(room_id)
  File "/usr/lib/python3.8/site-packages/mautrix/appservice/api/intent.py", line 83, in wrapper
    return await __method(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/mautrix/client/api/rooms.py", line 213, in join_room_by_id
    content = await self.api.request(Method.POST, Path.rooms[room_id].join, {
  File "/usr/lib/python3.8/site-packages/mautrix/api.py", line 233, in request
    return await self._send(method, full_url, content, query_params, headers or {})
  File "/usr/lib/python3.8/site-packages/mautrix/api.py", line 158, in _send
    raise make_request_error(http_status=response.status,
mautrix.errors.request.MUnknown: No known servers

There is also a lot of those errors, but i don't think they are related

[2021-01-25 19:36:04,807] [ERROR@mau.portal.d8fa960d-5b5c-4fca-ab67-04705003e2c7] Failed to update portal                                                                       
Traceback (most recent call last):                                                                                                                                              
  File "/usr/lib/python3.8/site-packages/mautrix/appservice/api/intent.py", line 329, in ensure_joined                                                                          
    await self.join_room(room_id, max_retries=0)                                                                                                                                
  File "/usr/lib/python3.8/site-packages/mautrix/appservice/api/intent.py", line 83, in wrapper                                                                                 
    return await __method(*args, **kwargs)                                                                                                                                      
  File "/usr/lib/python3.8/site-packages/mautrix/client/api/rooms.py", line 252, in join_room                                                                                   
    content = await self.api.request(Method.POST, Path.join[room_id_or_alias],                                                                                                  
  File "/usr/lib/python3.8/site-packages/mautrix/api.py", line 233, in request                                                                                                  
    return await self._send(method, full_url, content, query_params, headers or {})                                                                                             
  File "/usr/lib/python3.8/site-packages/mautrix/api.py", line 158, in _send                                                                                                    
    raise make_request_error(http_status=response.status,                                                                                                                       
mautrix.errors.request.MUnknown: No known servers                                                                                                                               
The above exception was the direct cause of the following exception:                                                                                                            
Traceback (most recent call last):                                                                                                                                              
  File "/usr/lib/python3.8/site-packages/mautrix_signal/portal.py", line 578, in update_matrix_room                                                                             
    await self._update_matrix_room(source, info)                                                                                                                                
  File "/usr/lib/python3.8/site-packages/mautrix_signal/portal.py", line 604, in _update_matrix_room                                                                            
    await self.main_intent.invite_user(self.mxid, source.mxid, check_cache=True)                                                                                                
  File "/usr/lib/python3.8/site-packages/mautrix/appservice/api/intent.py", line 94, in wrapper                                                                                 
    await __self.ensure_joined(room_id)                                                                                                                                         
  File "/usr/lib/python3.8/site-packages/mautrix/appservice/api/intent.py", line 351, in ensure_joined                                                                          
    raise IntentError(f"Failed to join room {room_id} as {self.mxid}") from e                                                                                                   
mautrix.errors.base.IntentError: Failed to join room !oQOYiTuZCrjVfuHVAV:loqui.tk as @signal_yxyx:my.domain

What I tried

Just-Insane commented 3 years ago

Were you able to resolve this issue?

buxel commented 2 years ago

Sorry, i missed the message. I resorted to a full reset of my homeserver to sort this out