matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

User directory search fails if your query has `:` in it #14815

Closed MelBourbon closed 1 year ago

MelBourbon commented 1 year ago

Hi, I have a fresh synapse installation as followed and are receiving the following error log when user is searching for other users on federated homeservers. In addition the server can currently not receive messages and establish a encrypted connection to other users. I personally think this may be related to my nginx reverse proxy as I want to use delgation. See nginx conf.d below as well.

System: Ubuntu 22.04.1 LTS Nginx: nginx/1.23.1

/var/log/matrix-synapse/homeserver.log:

2023-01-11 10:49:54,837 - synapse.http.server - 124 - ERROR - POST-240 - Failed handle request via 'UserDirectorySearchRestServlet': <XForwardedForRequest at 0x7f345442f760 method='POST' uri='/_matrix/client/r0/user_directory/search' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/http/server.py", line 307, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/http/server.py", line 513, in _async_render
    callback_return = await raw_callback_return
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/rest/client/user_directory.py", line 74, in on_POST
    results = await self.user_directory_handler.search_users(
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/handlers/user_directory.py", line 99, in search_users
    results = await self.store.search_user_dir(user_id, search_term, limit)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/databases/main/user_directory.py", line 890, in search_user_dir
    await self.db_pool.execute(
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 1033, in execute
    return await self.runInteraction(desc, interaction)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 882, in runInteraction
    return await delay_cancellation(_runInteraction())
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/internet/defer.py", line 1693, in _inlineCallbacks
    result = context.run(
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/python/failure.py", line 518, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 849, in _runInteraction
    result = await self.runWithConnection(
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 977, in runWithConnection
    return await make_deferred_yieldable(
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/python/threadpool.py", line 244, in inContext
    result = inContext.theWork()  # type: ignore[attr-defined]
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
    inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/python/context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/python/context.py", line 82, in callWithContext
    return func(*args, **kw)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/twisted/enterprise/adbapi.py", line 282, in _runWithConnection
    result = func(conn, *args, **kw)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 970, in inner_func
    return func(db_conn, *args, **kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 711, in new_transaction
    r = func(cursor, *args, **kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 1027, in interaction
    txn.execute(query, args)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 388, in execute
    self._do_execute(self.txn.execute, sql, *args)
  File "/opt/venvs/matrix-synapse/lib/python3.10/site-packages/synapse/storage/database.py", line 436, in _do_execute
    return func(sql, *args, **kwargs)
psycopg2.errors.SyntaxError: syntax error in tsquery: "frr:t"

nginx config domain.com:

server {
    server_name domain.com;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    merge_slashes off;
    client_max_body_size 50M;

    # SSL configuration
    # RSA certificates
    ssl_certificate /etc/letsencrypt/domain.com/rsa/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/domain.com/rsa/key.pem;
    # ECC certificates
    ssl_certificate /etc/letsencrypt/domain.com/ecc/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/domain.com/ecc/key.pem;

    # This should be ca.pem (certificate with the additional intermediate certificate)
    # See here: https://certbot.eff.org/docs/using.html
    # ECC
    ssl_trusted_certificate /etc/letsencrypt/domain.com/ecc/ca.pem;

    # Include SSL configuration
    include /etc/nginx/snippets/ssl.conf;

    # Include headers
    include /etc/nginx/snippets/headers.conf;

    # Disable error and access log.
    # This way, no IP will be logged by nginx
    #access_log off;
    #error_log off;

    # If you don't wanna serve a site, comment this out
    #root /var/www/html;
    #index index.html index.htm;

    # Redirect
    location ~ ^(/_matrix|/_synapse/client) {
            return 301 "https://m.domain.com$request_uri";
    }

    # Client homeserver autodiscovery
    location /.well-known/matrix/client {
        return 200 '{ "m.homeserver": { "base_url": "https://sub.domain.com" } }';
        add_header Content-Type application/json;
        add_header "Access-Control-Allow-Origin" *;
    }

    # Domain delegation
    location /.well-known/matrix/server {
        return 200 '{ "m.server": "sub.domain.com" }';
        add_header Content-Type application/json;
    }
}

nginx conf sub.domain.com:

server {
    server_name sub.domain.com;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    listen 8448 ssl;
    listen [::]:8448 ssl;

    merge_slashes off;
    client_max_body_size 20M;

    # SSL configuration
    # RSA certificates
    ssl_certificate /etc/letsencrypt/sub.domain.com/rsa/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/sub.domain.com/rsa/key.pem;
    # ECC certificates
    ssl_certificate /etc/letsencrypt/sub.domain.com/ecc/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/sub.domain.com/ecc/key.pem;

    # This should be ca.pem (certificate with the additional intermediate certificate)
    # See here: https://certbot.eff.org/docs/using.html
    # ECC
    ssl_trusted_certificate /etc/letsencrypt/sub.domain.com/ecc/ca.pem;

    # Include SSL configuration
    include /etc/nginx/snippets/ssl.conf;

    # Include headers
    include /etc/nginx/snippets/headers.conf;

    # Disable error and access log.
    # This way, no IP will be logged by nginx
    #access_log off;
    #error_log off;

    # Increase timeout values
    # Useful if rooms (on different server) act very slowly.
    proxy_connect_timeout 300s;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;

    # If you don't wanna serve a site, comment this out
    #root /var/www/html;
    #index index.html index.htm;

    location ~ ^(/_matrix|/_synapse/client) {
            proxy_pass http://127.0.0.1:8008;
            proxy_http_version 1.1;

            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $host;

            # Default Synapse upload size.
            # If you change max_upload_size in Synapse config, update it here too.
            client_max_body_size 50M;
    }
}

yaml config files:

homeserver.yaml

# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
#
# This is set in /etc/matrix-synapse/conf.d/server_name.yaml for Debian installations.
# server_name: "SERVERNAME"
pid_file: "/var/run/matrix-synapse.pid"
listeners:
  - port: 8008
    tls: false
    type: http
    x_forwarded: true
    bind_addresses: ['::1', '127.0.0.1']
    resources:
      - names: [client, federation]
        compress: false
database:
  name: sqlite3
  args:
    database: /var/lib/matrix-synapse/homeserver.db
log_config: "/etc/matrix-synapse/log.yaml"
media_store_path: /var/lib/matrix-synapse/media
signing_key_path: "/etc/matrix-synapse/homeserver.signing.key"
trusted_key_servers:
  - server_name: "matrix.org"

database yaml:

database:
  name: psycopg2
  args:
    user: matrixdbuser
    password: password
    database: matrixdb
    host: localhost
    port: 5432
    cp_min: 5
    cp_max: 10

rooms.yaml

user_directory:
    enabled: true
    search_all_users: true
    prefer_local_users: true
encryption_enabled_by_default_for_room_type: all

server.yaml

public_baseurl: https://sub.domain.com/
max_upload_size: 50M
url_preview_enabled: true
url_preview_ip_range_blacklist:
  - '127.0.0.0/8'
  - '10.0.0.0/8'
  - '172.16.0.0/12'
  - '192.168.0.0/16'
  - '100.64.0.0/10'
  - '192.0.0.0/24'
  - '169.254.0.0/16'
  - '192.88.99.0/24'
  - '198.18.0.0/15'
  - '192.0.2.0/24'
  - '198.51.100.0/24'
  - '203.0.113.0/24'
  - '224.0.0.0/4'
  - '::1/128'
  - 'fe80::/10'
  - 'fc00::/7'
  - '2001:db8::/32'
  - 'ff00::/8'
  - 'fec0::/10'
enable_registration: false
registration_shared_secret: <REDACTED>
enable_metrics: false
clokep commented 1 year ago

Can you please provide the version of your postgres database?

Is frr:t the text being typed in? (No quotes, no other symbols?)

DMRobertson commented 1 year ago

Publicly reported here.

@MelBourbon You have publicly posted registration_shared_secret from your server.yaml. Assume this token is compromised; rotate it immediately.

MelBourbon commented 1 year ago

Publicly reported here.

@MelBourbon You have publicly posted registration_shared_secret from your server.yaml. Assume this token is compromised; rotate it immediately.

Damn, sorry. I thought I removed everything. Secret is rotated.

MelBourbon commented 1 year ago

Can you please provide the version of your postgres database?

Is frr:t the text being typed in? (No quotes, no other symbols?)

PostgreSQL 14.5 (Ubuntu 14.5-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit

The issue is occuring independent of search criteria. So when adding @user:host or #room:host the element app shows "internal server error" and the issue is shown in logs.

clokep commented 1 year ago

I think postgres is interpreting this using it's tsquery syntax, if you search for just user (or user room -- space, not a colon) it should work.

Obviously a bug though. 👍 We might want to use the same websearch_to_tsquery bits as #11635.

MelBourbon commented 1 year ago

I think postgres is interpreting this using it's tsquery syntax, if you search for just user (or user room -- space, not a colon) it should work.

Obviously a bug though. 👍 We might want to use the same websearch_to_tsquery bits as #11635.

Tested, can not find any user. Even with simple characters. On other instance it's working. In addition I have the problem that server can not receive any messages.

H-Shay commented 1 year ago

Is this still an issue?

MelBourbon commented 1 year ago

Due to the issue I deinstalled synapse and can support this issue anymore.

Sampozzo commented 1 year ago

Hello i have the exact issue on a fresh install on ubuntu 20.04 and postgres 12.13-0ubuntu0.20.04.1 The problem start after adding the colon at every next char

2023-02-11 01:36:48,617 - synapse.http.server - 124 - ERROR - POST-50 - Failed handle request via 'UserDirectorySearchRestServlet': <XForwardedForRequest at 0x7f1bb018a490 method='POST' uri='/_matrix/client/r0/user_directory/search' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/server.py", line 307, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/http/server.py", line 513, in _async_render
    callback_return = await raw_callback_return
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/rest/client/user_directory.py", line 74, in on_POST
    results = await self.user_directory_handler.search_users(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/handlers/user_directory.py", line 99, in search_users
    results = await self.store.search_user_dir(user_id, search_term, limit)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/databases/main/user_directory.py", line 890, in search_user_dir
    await self.db_pool.execute(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 1033, in execute
    return await self.runInteraction(desc, interaction)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 882, in runInteraction
    return await delay_cancellation(_runInteraction())
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/internet/defer.py", line 1693, in _inlineCallbacks
    result = context.run(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/python/failure.py", line 518, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 849, in _runInteraction
    result = await self.runWithConnection(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 977, in runWithConnection
    return await make_deferred_yieldable(
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/python/threadpool.py", line 244, in inContext
    result = inContext.theWork()  # type: ignore[attr-defined]
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
    inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/python/context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/python/context.py", line 82, in callWithContext
    return func(*args, **kw)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/twisted/enterprise/adbapi.py", line 282, in _runWithConnection
    result = func(conn, *args, **kw)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 970, in inner_func
    return func(db_conn, *args, **kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 711, in new_transaction
    r = func(cursor, *args, **kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 1027, in interaction
    txn.execute(query, args)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 388, in execute
    self._do_execute(self.txn.execute, sql, *args)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 436, in _do_execute
    return func(sql, *args, **kwargs)
psycopg2.errors.SyntaxError: syntax error in tsquery: "user:domain.com"

with element web app finally it can find the @user:domain.com but on the element android app it show a message "internal server error" and can't find the user.

Replacing colon with space, no error but can't find the user

Any help?

Sampozzo commented 1 year ago

correction: replacing the colon with space now works, but it's not a good solution because people will try to use the colon

alangecker commented 1 year ago

just got the experienced the same error with

maybe the issue could be reopened? :) @H-Shay

H-Shay commented 1 year ago

@alangecker - did you try the workaround listed above? If you did and it still doesn't work, can you provide logs for the failure?

Sampozzo commented 1 year ago

@H-Shay hello, i've already posted the logs

H-Shay commented 1 year ago

@Sampozzo right, I see those, I was asking the other user who reported this a. if the workaround was not successful and b. if it wasn't successful if we could get logs for the failure

reivilibre commented 1 year ago

Can easily reproduce just by going to 'create chat' in Element and typing in e.g. ay:matrix:

Feb 15 18:11:38 sallie.librepush.net synapse[228598]: 2023-02-15 18:11:38,615 - synapse.http.server - 124 - ERROR - POST-4929117 - Failed handle request via 'UserDirectorySearchRestServlet': <XForwardedForRequest at 0x7f9b25a1b400 method='POST' uri='/_matrix/client/r0/user_directory/search' clientproto='HTTP/1.0' site='8008'>
Feb 15 18:11:38 sallie.librepush.net synapse[228598]: Traceback (most recent call last):
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/http/server.py", line 307, in _async_render_wrapper
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     callback_return = await self._async_render(request)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/http/server.py", line 513, in _async_render
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     callback_return = await raw_callback_return
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/rest/client/user_directory.py", line 74, in on_POST
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     results = await self.user_directory_handler.search_users(
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/handlers/user_directory.py", line 99, in search_users
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     results = await self.store.search_user_dir(user_id, search_term, limit)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/databases/main/user_directory.py", line 890, in search_user_dir
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     await self.db_pool.execute(
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 1033, in execute
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return await self.runInteraction(desc, interaction)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 882, in runInteraction
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return await delay_cancellation(_runInteraction())
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 1656, in _inlineCallbacks
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     result = current_context.run(
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/python/failure.py", line 514, in throwExceptionIntoGenerator
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return g.throw(self.type, self.value, self.tb)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 849, in _runInteraction
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     result = await self.runWithConnection(
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 977, in runWithConnection
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return await make_deferred_yieldable(
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/python/threadpool.py", line 244, in inContext
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     result = inContext.theWork()  # type: ignore[attr-defined]
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/python/context.py", line 117, in callWithContext
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return self.currentContext().callWithContext(ctx, func, *args, **kw)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/python/context.py", line 82, in callWithContext
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return func(*args, **kw)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/twisted/enterprise/adbapi.py", line 282, in _runWithConnection
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     result = func(conn, *args, **kw)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 970, in inner_func
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return func(db_conn, *args, **kwargs)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 711, in new_transaction
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     r = func(cursor, *args, **kwargs)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 1027, in interaction
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     txn.execute(query, args)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 388, in execute
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     self._do_execute(self.txn.execute, sql, *args)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:   File "/home/synapse/venv/lib/python3.10/site-packages/synapse/storage/database.py", line 436, in _do_execute
Feb 15 18:11:38 sallie.librepush.net synapse[228598]:     return func(sql, *args, **kwargs)
Feb 15 18:11:38 sallie.librepush.net synapse[228598]: psycopg2.errors.SyntaxError: syntax error in tsquery: "ay:matrix"
Feb 15 18:11:38 sallie.librepush.net synapse[228598]: 2023-02-15 18:11:38,618 - synapse.access.http.8008 - 460 - INFO - POST-4929117 - 84.9.79.232 - 8008 - {@reivilibre.element:librepush.net} Processed request: 0.011sec/0.001sec (0.004sec, 0.000sec) (0.001sec/0.003sec/1) 55B 500 "POST /_matrix/client/r0/user_directory/search HTTP/1.0" "Mozilla/5.0 (X11; Linux x86_64; Ubuntu; rv:101.0) Gecko/20100101 Firefox/101.0" [0 dbevts]