matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Some issues on my dendrite homeserver #1951

Closed r3k2 closed 3 years ago

r3k2 commented 3 years ago

First of all, very sorry to post this here. but since Monday night I can't read or post anything on the dendrite channel :( So this led me to check whats going on in the logs.. so far I seen this:

time="2021-07-30T13:37:19.676875500Z" level=error msg="matrix.org pushed us an event but 1 server(s) couldn't give us details about prev_events via /get_missing_events - dropping this event until it can" func="github.com/matrix-org/dendrite/federationapi/routing.(*txnReq).getMissingEvents" file="github.com/matrix-org/dendrite/federationapi/routing/send.go:1067" context=missing error="contents=[123 34 101 114 114 99 111 100 101 34 58 34 77 95 70 79 82 66 73 68 68 69 78 34 44 34 101 114 114 111 114 34 58 34 83 101 114 118 101 114 32 105 115 32 98 97 110 110 101 100 32 102 114 111 109 32 114 111 111 109 34 125] msg=Failed to POST JSON (hostname \"matrix.org\" path \"/_matrix/federation/v1/get_missing_events/!OGEhHVWSdvArJzumhm:matrix.org\") code=403 wrapped=M_FORBIDDEN: Server is banned from room" event_id="$1D9qIbe4mqA1pA6PcH3l31JdeB7vZ0nUPuFo47UJb_0" room_id="!OGEhHVWSdvArJzumhm:matrix.org"
time="2021-07-30T13:37:19.677015832Z" level=warning msg="Failed to process incoming federation event, skipping" func="github.com/matrix-org/dendrite/federationapi/routing.(*inputWorker).run.func1" file="github.com/matrix-org/dendrite/federationapi/routing/send.go:391" error="unable to get prev_events for event \"$1D9qIbe4mqA1pA6PcH3l31JdeB7vZ0nUPuFo47UJb_0\": contents=[123 34 101 114 114 99 111 100 101 34 58 34 77 95 70 79 82 66 73 68 68 69 78 34 44 34 101 114 114 111 114 34 58 34 83 101 114 118 101 114 32 105 115 32 98 97 110 110 101 100 32 102 114 111 109 32 114 111 111 109 34 125] msg=Failed to POST JSON (hostname \"matrix.org\" path \"/_matrix/federation/v1/get_missing_events/!OGEhHVWSdvArJzumhm:matrix.org\") code=403 wrapped=M_FORBIDDEN: Server is banned from room" event_id="$1D9qIbe4mqA1pA6PcH3l31JdeB7vZ0nUPuFo47UJb_0" rejected=false req.id=sGhiWNaVio0O req.method=PUT req.path=/_matrix/federation/v1/send/1627470674765

not sure if this is related or another issue in any case will like to know if is an issue on my end.

also when I invite someone to join a space I created was working also until around that same time. I am going to create a dummy account and do the process and link it to this issue. Hope we can clear the issues, specially the #dendrite channel so I can ask there and not waste space here.

[update] ok I did that, and when I got the error and the option to sent it to you guys and link it to a "issue" I did and linked it to this one. thanks

neilalexander commented 3 years ago

The salient part of the error here is M_FORBIDDEN: Server is banned from room.

Have you got open registration enabled? It's possible that your server has been ACL'd if someone has been spamming from your homeserver.

r3k2 commented 3 years ago

@neilalexander hmmm yeah registration is open, any way to find the spammer or get myself out of the ACL's?

neilalexander commented 3 years ago

Look at the account_accounts table to see if there are any accounts you don't expect. Open registration probably isn't a great idea at the moment so you may want to revisit that until we get some email verification mechanism or something working properly.

You will need to contact support@matrix.org about the ACLs, since the Dendrite community room ACLs are managed by them.

r3k2 commented 3 years ago

Look at the account_accounts table to see if there are any accounts you don't expect. Open registration probably isn't a great idea at the moment so you may want to revisit that until we get some email verification mechanism or something working properly.

You will need to contact support@matrix.org about the ACLs, since the Dendrite community room ACLs are managed by them.

ok, registration is disabled, will ask my friends to use the "registration shared secret" instead. not sure how they will use that from the element client(for example)

About contacting them, will they ignore the email or they actually read it? thanks

neilalexander commented 3 years ago

It's probably easier just to create accounts for your friends using the create-accounts binary for now, shared secret registration is mostly for appservices I think.

The support mailbox is manned so you should get a response.

r3k2 commented 3 years ago

@neilalexander is there a safe way to delete accounts I can't recall for? or a simple row remove is ok? I found (437 rows) so that means that is like 300 more accounts that I know of should be using the server O_o [edit] I also just sent them an email support@matrix.org

neilalexander commented 3 years ago

You can just drop the rows, yes — to do a full clean up you really should delete the localparts that you don't recognise from the account_accounts, account_data, account_profiles and device_devices tables.

In particular, removing them from the device_devices table will ensure that any access tokens they took are well and truly nuked.

r3k2 commented 3 years ago

here is the script I used to remove all the non-friends accounts:

!/bin/bash
# psql -U dendrite -d dendrite_userapi_accounts -c "SELECT localpart FROM account_accounts" > users.txt
# remove good ones
export PGPASSWORD=XXXXXX

for user in $(cat users.txt); do
  psql -U dendrite -d dendrite_userapi_accounts -c "DELETE FROM account_accounts WHERE localpart = '$user'"
  psql -U dendrite -d dendrite_userapi_accounts -c "DELETE FROM account_data WHERE localpart = '$user'"
  psql -U dendrite -d dendrite_userapi_accounts -c "DELETE FROM account_profiles WHERE localpart = '$user'"
  psql -U dendrite -d dendrite_userapi_devices -c "DELETE FROM device_devices WHERE localpart = '$user'"
done

posted it in case someone ever needs to delete in bulk spam accounts. etc.

r3k2 commented 3 years ago

@neilalexander Just got a reply, they removed the block in the ACL' I can see #dendrite again. Thanks