Describe the bug

Sliding Sync does not seem to enjoy connecting to an external Postgres server:

Mar 18 22:45:25 matrix systemd[1]: Starting matrix-sliding-sync...
Mar 18 22:45:26 matrix matrix-sliding-sync[26100]: 1443b084b4c073689c684f3427ef69e0b753940a6c6e34b23acb6c4962a5b030
Mar 18 22:45:26 matrix systemd[1]: Started matrix-sliding-sync.
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: Sync v3 [0.99.1] (2f8e3313d8df1a6df39b3ea6e083992de7a8c5e3)
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: panic: dial tcp: lookup port=5432: no such host
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: goroutine 1 [running]:
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: github.com/jmoiron/sqlx.MustExec(...)
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]:         github.com/jmoiron/[email protected]/sqlx.go:722
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: github.com/jmoiron/sqlx.(*DB).MustExec(0xb2b95a?, {0xb5560d?, 0xc00004200a?}, {0x0?, 0x0?, 0x7fc4263c6238?})
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]:         github.com/jmoiron/[email protected]/sqlx.go:366 +0x46
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: github.com/matrix-org/sliding-sync/state.NewRoomsTable(...)
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]:         github.com/matrix-org/sliding-sync/state/rooms_table.go:24
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: github.com/matrix-org/sliding-sync/state.NewStorage({0xc00004200a, 0x81})
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]:         github.com/matrix-org/sliding-sync/state/storage.go:52 +0xd3
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: github.com/matrix-org/sliding-sync.Setup({0xc00003e00e, 0x1f}, {0xc00004200a, 0x81}, {0xc00004400e, 0x24}, {0x0, 0x0, 0x0, 0x0})
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]:         github.com/matrix-org/sliding-sync/v3.go:75 +0x10f
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]: main.main()
Mar 18 22:45:27 matrix matrix-sliding-sync[26163]:         github.com/matrix-org/sliding-sync/cmd/syncv3/main.go:100 +0x925
Mar 18 22:45:28 matrix systemd[1]: matrix-sliding-sync.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Mar 18 22:45:28 matrix systemd[1]: matrix-sliding-sync.service: Failed with result 'exit-code'.

To Reproduce

I need only enable the sliding sync service. My playbook uses both S3 storage and external Postgres.

Expected behavior

The server should obviously be able to connect to the external Postgres server.

Additional context

I don't really think there's any more to say, the log is pretty clear on the problem! 😄

0

External Postgres means you're on your own when it comes to initializing the extra databases and credentials for each service and for hooking things together.

You then need to configure matrix_sliding_sync_database_hostname and all the other matrix_sliding_sync_database_* variables: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/2c233492dbf587fe88abc87b0758e757c4a2ea8d/roles/custom/matrix-sliding-sync/defaults/main.yml#L87-L91

1

Ah! Okay. I should have probably dug into the role. It would be nice if there was a teeny bit of documentation mentioning this. Lemme get this working...

0
© 2022 pullanswer.com - All rights reserved.