Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

API: v1/join/<room_id_or_alias> fails for room alias #9527

Closed
rht opened this issue Mar 2, 2021 · 5 comments
Closed

API: v1/join/<room_id_or_alias> fails for room alias #9527

rht opened this issue Mar 2, 2021 · 5 comments

Comments

@rht
Copy link
Contributor

rht commented Mar 2, 2021

Description

I discovered this bug while implementing a room join feature for this Matrix admin CLI: JOJ0/synadm#32.
While room id works for joining a user into a room, room alias fails. Probably because # is a special character.

Steps to reproduce

Version information

  • Homeserver: own homeserver

If not matrix.org:

  • Version: {"server_version":"1.27.0","python_version":"3.8.5"}

  • Install method: apt-get

  • Platform: Ubuntu

@rht
Copy link
Contributor Author

rht commented Mar 2, 2021

I tried !testing:domain, got {"errcode":"M_UNKNOWN","error":"!testing:domain\\ was not legal room ID or room alias"}, which was the same type of error I got in JOJ0/synadm#32.

@dklimpel
Copy link
Contributor

dklimpel commented Mar 2, 2021

Did you tried to escape the # with %23.
You can show details of your request with -v.
There you can see the request like:
POST /_synapse/admin/v1/join/%23testing:domain?access_token=token HTTP/2

@clokep
Copy link
Member

clokep commented Mar 2, 2021

This is a duplicate of #9505. It will be fixed in the next Synapse release.

@clokep clokep closed this as completed Mar 2, 2021
@rht
Copy link
Contributor Author

rht commented Mar 3, 2021

I got an internal server error when I tried %23. The error in the server log:

  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 319, in _do_execute
    return func(sql, *args)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/psycopg2/extensions.py", line 121, in getquoted
    pobjs = [adapt(o) for o in self._seq]
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/types.py", line 220, in __iter__
    raise ValueError("Attempted to iterate a %s" % (type(self).__name__,))
ValueError: Attempted to iterate a RoomID

@dharmendrakariya
Copy link

any lead here guys? facing same issue Could not join room undefined - M_UNKNOWN: undefined was not legal room ID or room alias

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants