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

500 error when attempting to remove non-existent alias from directory #2782

Closed
jansol opened this issue Jan 14, 2018 · 8 comments
Closed

500 error when attempting to remove non-existent alias from directory #2782

jansol opened this issue Jan 14, 2018 · 8 comments
Labels
A-Room-Directory Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution

Comments

@jansol
Copy link

jansol commented Jan 14, 2018

Trying to remove a (non-canonical) room alias results in an internal server error.

Synapse 0.26.0 on Debian (from matrix.org repo)

python[834]: 2018-01-14 15:19:11,922 - synapse.api.auth - 512 - WARNING - DELETE-65243- Unrecognised appservice access token: <my *user* access token>
python[834]: 2018-01-14 15:19:11,959 - synapse.http.server - 145 - ERROR - DELETE-65243- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f1e22097090>: <XForwardedForRequest at 0x7f1df6f3f758 method=DELETE uri=/_matrix/client/r0/directory/room/%23room%3Aali.as?access_token=<redacted> clientproto=HTTP/1.0 site=8008>: Traceback (most recent call last):
python[834]: File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1274, in unwindGenerator
python[834]: return _inlineCallbacks(None, gen, Deferred())
python[834]: File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
python[834]: result = g.send(result)
python[834]: File "/usr/lib/python2.7/dist-packages/synapse/handlers/message.py", line 326, in create_and_send_nonmember_event
python[834]: txn_id=txn_id
python[834]: File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1274, in unwindGenerator
python[834]: return _inlineCallbacks(None, gen, Deferred())
python[834]: --- <exception caught here> ---
python[834]: File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
python[834]: result = g.send(result)
python[834]: File "/usr/lib/python2.7/dist-packages/synapse/handlers/message.py", line 209, in create_event
python[834]: self.validator.validate_new(builder)
python[834]: File "/usr/lib/python2.7/dist-packages/synapse/events/validator.py", line 69, in validate_new
python[834]: self.validate(event)
python[834]: File "/usr/lib/python2.7/dist-packages/synapse/events/validator.py", line 25, in validate
python[834]: RoomID.from_string(event.room_id)
python[834]: File "/usr/lib/python2.7/dist-packages/synapse/types.py", line 102, in from_string
python[834]: if len(s) < 1 or s[0] != cls.SIGIL:
python[834]: exceptions.TypeError: object of type 'NoneType' has no len()
@richvdh
Copy link
Member

richvdh commented Jan 30, 2018

any more info to help repro this? What uri did you hit, what was the request content?

@jansol
Copy link
Author

jansol commented Jan 30, 2018

Whatever riot uses (desktop/ios, happens with both). I can check the exact request later.

@jansol
Copy link
Author

jansol commented Feb 5, 2018

Riot-desktop dev tools give me this:

curl 'https://myhome.serv.er/_matrix/client/r0/directory/room/%23myroom%3Aserv.er?access_token=[REDACTED]' \
-X DELETE \
-H 'origin: file://' \
-H 'accept-encoding: gzip, deflate' \
-H 'accept-language: en-GB' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Riot/0.13.4 Chrome/58.0.3029.110 Electron/1.7.9 Safari/537.36' \
-H 'accept: */*' \
-H 'authority: myhome.serv.er' \
-H 'x-devtools-request-id: 12345.678' \
--compressed

@richvdh
Copy link
Member

richvdh commented Feb 5, 2018

ok yup it looks like you will hit this if you try to delete a non-existent room alias from the directory

@richvdh
Copy link
Member

richvdh commented Feb 5, 2018

[The 'unrecognised appservice access token' warning is a complete red herring]

@richvdh richvdh changed the title Unable to remove room alias 500 error when attempting to remove non-existent alias from directory Feb 5, 2018
@richvdh richvdh added the Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution label Feb 5, 2018
@turt2live
Copy link
Member

@richvdh I think this was fixed?

@jansol
Copy link
Author

jansol commented Sep 18, 2018

I still can't remove the problematic aliases though... (0.33.4-1mx1)

@richvdh
Copy link
Member

richvdh commented Sep 18, 2018

yup fixed by #3889, which is in current develop (not 0.33.4).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Room-Directory Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution
Projects
None yet
Development

No branches or pull requests

4 participants