synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Could not connect after a migration of server

Open aukfood opened this issue 1 year ago • 6 comments

Description

Hello,

I try to migrate matrix-synapse from a server to another but I couldn't reconnect to matrix in new one server.

Steps to reproduce

I do this

  • rsync configuration files
  • rsync media data
  • dump and restore database on other server
  • change url_old to url_new in file and in database

Homeserver

homeserver

Synapse Version

1.87.0+bullseye1

Installation Method

Debian packages from packages.matrix.org

Database

Postgresql

Workers

Single process

Platform

Debian 11 server

Configuration

No response

Relevant log output

Sep 26 15:54:37 agrobio synapse[374173]: synapse.access.http.8008: [OPTIONS-2] 91.175.148.239 - 8008 - Received request: OPTIONS /_matrix/client/v3/login
Sep 26 15:54:37 agrobio synapse[374173]: synapse.access.http.8008: [OPTIONS-2] 91.175.148.239 - 8008 - {None} Processed request: 0.001sec/-0.000sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 0B 204 "OPTIONS /_matrix/client/v3/login HTTP/1.1" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Element/1.11.43 Chrome/116.0.5845.188 Electron/26.2.1 Safari/537.36" [0 dbevts]
Sep 26 15:54:37 agrobio synapse[374173]: synapse.access.http.8008: [POST-3] 91.175.148.239 - 8008 - Received request: POST /_matrix/client/v3/login
Sep 26 15:54:37 agrobio synapse[374173]: synapse.rest.client.login: [POST-3] Got login request with identifier: {'type': 'm.id.user', 'user': 'myadminuser'}, medium: None, address: None, user: None
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN START] {get_users_by_id_case_insensitive-7a}
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL] {get_users_by_id_case_insensitive-7a} SELECT name, password_hash FROM users WHERE lower(name) = lower(?)
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL values] {get_users_by_id_case_insensitive-7a} ('@myadminuser:mymatrixdomain',)
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL time] {get_users_by_id_case_insensitive-7a} 0.005480 sec
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN END] {get_users_by_id_case_insensitive-7a} 0.007555 sec
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN START] {get_user_deactivated_status-7b}
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL] {get_user_deactivated_status-7b} SELECT deactivated FROM users WHERE name = ?
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL values] {get_user_deactivated_status-7b} ['@myadminuser:mymatrixdomain']
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL time] {get_user_deactivated_status-7b} 0.000457 sec
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN FAIL] {get_user_deactivated_status-7b} 404: No row found
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN END] {get_user_deactivated_status-7b} 0.003969 sec
Sep 26 15:54:37 agrobio synapse[374173]: synapse.http.server: [POST-3] <XForwardedForRequest at 0x7fa22c1426a0 method='POST' uri='/_matrix/client/v3/login' clientproto='HTTP/1.1' site='8008'> SynapseError: 404 - No row found
Sep 26 15:54:37 agrobio synapse[374173]: synapse.access.http.8008: [POST-3] 91.175.148.239 - 8008 - {None} Processed request: 0.350sec/0.001sec (0.336sec, 0.000sec) (0.001sec/0.012sec/2) 62B 404 "POST /_matrix/client/v3/login HTTP/1.1" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Element/1.11.43 Chrome/116.0.5845.188 Electron/26.2.1 Safari/537.36" [0 dbevts]

Anything else that would be useful to know?

If I create a new user in the new one serveur it could connecte

aukfood avatar Sep 26 '23 14:09 aukfood

change url_old to url_new in file and in database

You can't change a server's server name once it is running. Is that what you attempted to do?

clokep avatar Sep 26 '23 15:09 clokep

Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL] {get_user_deactivated_status-7b} SELECT deactivated FROM users WHERE name = ?
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL values] {get_user_deactivated_status-7b} ['@myadminuser:mymatrixdomain']
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.SQL: [POST-3] [SQL time] {get_user_deactivated_status-7b} 0.000457 sec
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN FAIL] {get_user_deactivated_status-7b} 404: No row found
Sep 26 15:54:37 agrobio synapse[374173]: synapse.storage.txn: [POST-3] [TXN END] {get_user_deactivated_status-7b} 0.003969 sec

This suggests that there is no admin user in the users table.

@aukfood did you manage to resolve this? If so, please let us know how you did so. If not, please can you answer Patrick's question above:

You can't change a server's server name once it is running. Is that what you attempted to do?

DMRobertson avatar Oct 27 '23 14:10 DMRobertson

@DMRobertson sorry for this long response time.

After an other migration test now we could connect to synapse server but we couln't list rooms on local server.

Before migration on old server : before

After migration on another server : after

Why ? My migration process seams to be good :

  1. dump and restore database
  2. sync files on /var/lib/matrix-synapse/
  3. move dns

I don't understand

aukfood avatar Nov 07 '23 15:11 aukfood

@clokep @DMRobertson @all no idea why ?

aukfood avatar Nov 14 '23 14:11 aukfood

no idea why ?

We need more information to understand what you have done in order to diagnose your problem. We asked you for information here:

You can't change a server's server name once it is running. Is that what you attempted to do?

and again here if you have tried to change your server name.

If not, please can you answer Patrick's question above:

You can't change a server's server name once it is running. Is that what you attempted to do?

Since you wrote

  1. move dns

it certainly sounds like you tried to change the server name! Please can you confirm if that's the case?

DMRobertson avatar Nov 14 '23 16:11 DMRobertson

@DMRobertson in my last case I don't change dns I done migration like that from old serve to new one :

  • dump database on old server and restore database in new server
  • sync files on /var/lib/matrix-synapse/
  • move dns record from old server to new one

aukfood avatar Nov 28 '23 16:11 aukfood