matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

/_dendrite/ endpoints are inaccessible

Open array-in-a-matrix opened this issue 1 year ago • 4 comments

Describe the bug: The Dendrite /_dendrite/ endpoints, which includes the admin API and some /_synapse/ endpoints are inaccessible.

To Reproduce: curling any endpoint will prompt nginx to return a 404 error.

For example: curl --header "Authorization: Bearer <TOKEN> -X GET "https://matrix.<DOMAIN>.<TLD>/_dendrite/admin/evacuateRoom/{<ROOMID>}"

returns:

<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

Expected behavior: A JSON body should be returned.

Matrix Server:

  • OS: Ubuntu 22.04 LTS
  • Architecture: amd64

Ansible: If your problem appears to be with Ansible, tell us:

  • where you run Ansible -- e.g. on the Matrix server itself; on another computer (which OS? distro? standard installation or containerized Ansible?) On server itself.

  • what version of Ansible you're running (see ansible --version) Ansible core 2.14.3

array-in-a-matrix avatar Mar 28 '23 19:03 array-in-a-matrix

Everything is sent to the Dendrite container, https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/755a32f09cbae8b4093c21351dcd0c267a680a0c/roles/custom/matrix-nginx-proxy/templates/nginx/conf.d/matrix-dendrite.conf.j2#L27-L44

If it's giving you a 404, then it may be that these APIs are disabled in the Dendrite configuration or something.

spantaleev avatar Mar 29 '23 07:03 spantaleev

The endpoint /_matrix/client/v3/admin/whois/{userId} works, which means they are enabled. I also do not see any way to enable these APIs in the config.

array-in-a-matrix avatar Mar 29 '23 15:03 array-in-a-matrix

The endpoint /_matrix/client/v3/admin/whois/{userId} works which means they are enabled. I also do not see any way to enable these APIs in the config.

I'm having the same issue but even this endpoint is not working. When making this request: curl --location --request GET 'https://matrix.<DOMAIN>.<TLD>/_matrix/client/v3/admin/whois/<USERNAME>' \ --header 'Authorization: Bearer <TOKEN>' \ }'

I'm getting the following error: { "errcode": "M_UNKNOWN", "error": "Internal Server Error" }

I'm trying to update password for a user. Is there some workaround I can use before I figure this is out? E.g. can I update the password manually in userapi_accounts table?

pekkalaaksonen avatar Apr 30 '23 20:04 pekkalaaksonen

Looks like adding the port to the domain works.

curl --header "Authorization: Bearer <token>" -X POST https://matrix.<domain>.<tld>:8448/_dendrite/admin/purgeRoom/\{\<room_id>\}
curl --header "Authorization: Bearer <token>" -X POST https://matrix.<domain>.<tld>:8448/_dendrite/admin/evacuateUser/\{\<user_mxid>\}

array-in-a-matrix avatar Aug 17 '23 21:08 array-in-a-matrix