Преглед на файлове

Add retry logic for Synapse user registration on Connection refused

When DB credentials change (derived from matrix_synapse_macaroon_secret_key),
a running Synapse container may fail to connect to its database and stop
serving requests. This causes register_new_matrix_user to fail with
"Connection refused" when the matrix-user-creator role tries to register users.

This extends the retry logic from 44b43a51b (which handled HMAC failures)
to also handle Connection refused errors: restart Synapse (picking up the
new config with updated credentials), wait for it to start, and retry.

Caused by c21a80d232

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pull/4905/head
Slavi Pantaleev преди 3 седмици
родител
ревизия
0e8ef8ef10
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. +5
    -2
      roles/custom/matrix-user-creator/tasks/util/ensure_user_registered_synapse.yml

+ 5
- 2
roles/custom/matrix-user-creator/tasks/util/ensure_user_registered_synapse.yml Целия файл

@@ -31,10 +31,13 @@
matrix_synapse_register_user_result.rc != 0
and 'User ID already taken' not in matrix_synapse_register_user_result.stdout
and 'HMAC incorrect' not in matrix_synapse_register_user_result.stdout
and 'Connection refused' not in matrix_synapse_register_user_result.stderr | default('')

- when: "'HMAC incorrect' in matrix_synapse_register_user_result.stdout | default('')"
- when: >-
'HMAC incorrect' in matrix_synapse_register_user_result.stdout | default('')
or 'Connection refused' in matrix_synapse_register_user_result.stderr | default('')
block:
- name: Restart Synapse due to HMAC failure (likely a registration_shared_secret change)
- name: Restart Synapse due to registration failure (likely a registration_shared_secret or DB credentials change)
ansible.builtin.service:
name: "matrix-synapse.service"
state: restarted


Зареждане…
Отказ
Запис