Closed MelBourbon closed 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?)
Publicly reported here.
@MelBourbon You have publicly posted registration_shared_secret
from your server.yaml
. Assume this token is compromised; rotate it immediately.
Publicly reported here.
@MelBourbon You have publicly posted
registration_shared_secret
from yourserver.yaml
. Assume this token is compromised; rotate it immediately.
Damn, sorry. I thought I removed everything. Secret is rotated.
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.
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.
I think postgres is interpreting this using it's
tsquery
syntax, if you search for justuser
(oruser 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.
Is this still an issue?
Due to the issue I deinstalled synapse and can support this issue anymore.
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?
correction: replacing the colon with space now works, but it's not a good solution because people will try to use the colon
just got the experienced the same error with
1.76.0+bullseye1
12.13-1
maybe the issue could be reopened? :) @H-Shay
@alangecker - did you try the workaround listed above? If you did and it still doesn't work, can you provide logs for the failure?
@H-Shay hello, i've already posted the logs
@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
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]
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:
nginx config domain.com:
nginx conf sub.domain.com:
yaml config files:
homeserver.yaml
database yaml:
rooms.yaml
server.yaml