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

Error when sending GET request to _synapse/admin/v1/rooms with curl #8301

Closed
dngray opened this issue Sep 12, 2020 · 1 comment
Closed

Error when sending GET request to _synapse/admin/v1/rooms with curl #8301

dngray opened this issue Sep 12, 2020 · 1 comment

Comments

@dngray
Copy link

dngray commented Sep 12, 2020

Description

When sending a GET /_synapse/admin/v1/rooms using the admin_api with curl I hit an internal error.

Ie:

curl -v -H "Authorization: Bearer $accessToken" \
    -X GET 'https://chat.example.com:8448/_synapse/admin/v1/rooms'
{
    "errcode": "M_UNKNOWN",
    "error": "Internal server error"
}

The synapse logs produce this exception:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/http/server.py", line 233, in _async_render_wrapper
    self._send_response(request, code, response)
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/http/server.py", line 295, in _send_response
    canonical_json=self.canonical_json,
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/synapse/http/server.py", line 536, in respond_with_json
    json_bytes = encode_pretty_printed_json(json_object) + b"\n"
  File "/opt/venvs/matrix-synapse/lib/python3.6/site-packages/canonicaljson.py", line 96, in encode_pretty_printed_json
    return _pretty_encoder.encode(json_object).encode("ascii")
UnicodeEncodeError: 'ascii' codec can't encode character '\u2122' in position 44668: ordinal not in range(128)
2020-09-11 18:01:21,239 - synapse.access.http.8008 - 311 - INFO - GET-32809 - <IP>- 8008 - {@user:example.com} Processed request: 0.041sec/0.000sec (0.004sec, 0.000sec) (0.000sec/0.034sec/2) 69B 500 "GET /_synapse/admin/v1/rooms HTTP/1.0" "curl/7.64.1" [0 dbevts]

I do have longer logs, but they may contain private information. I am available on Matrix dngray:privacytools.io

Steps to reproduce

  • Use curl to send a request to GET /_synapse/admin/v1/rooms

When we used Postman we don't get the error.

Version information

  • Version:
    1.19.1

  • Install method:
    pip

  • Platform:
    Debian

@auscompgeek
Copy link
Contributor

Duplicate of #8188

@richvdh richvdh closed this as completed Sep 12, 2020
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

3 participants