kamax-matrix / mxisd

Federated Matrix Identity Server
GNU Affero General Public License v3.0
223 stars 115 forks source link

AS: Matrix ID invities: endless email flow due to timeout on synapse side #97

Closed valentinab25 closed 5 years ago

valentinab25 commented 5 years ago

We have recently made the upgrade to mxisd 1.2.0 and implemented the steps described here for synapse: https://github.com/kamax-matrix/mxisd/blob/v1.2.0/docs/features/experimental/application-service.md#email-notification-for-room-invites-by-matrix-id

After the deploy, people started receiving continuously the same old invitations to rooms. This did not stop until we disabled the app in synapse.

In synapse logs we have these messages ( there are more, I just added 2 examples):

2018-11-26 10:02:26,171 - synapse.http.client - 118 - INFO - - Error sending request to  PUT http://identity:8090/transactions/3?access_token=<redacted>: ResponseNeverReceived [<twisted.python.failure.Failure twisted.internet.defer.CancelledError: >]
2018-11-26 10:02:26,183 - synapse.appservice.api - 249 - WARNING - - push_bulk to http://identity:8090/transactions/3 threw exception [<twisted.python.failure.Failure twisted.internet.defer.CancelledError: >]

2018-11-26 10:31:03,380 - synapse.http.client - 118 - INFO - - Error sending request to  PUT http://identity:8090/transactions/3?access_token=<redacted>: ResponseNeverReceived [<twisted.python.failure.Failure twisted.internet.defer.CancelledError: >]
2018-11-26 10:31:03,392 - synapse.appservice.api - 249 - WARNING - - push_bulk to http://identity:8090/transactions/3 threw exception [<twisted.python.failure.Failure twisted.internet.defer.CancelledError: >]

MXISD did not have any errors or warnings and kept sending emails ( ~150 emails per push_bulk ).

I solved the problem by deleting all rows from application_services_txns table from the synapse database related to appservice-mxisd. All new invitations are now sent correctly.

Is there a way to increase the timeout so synapse does not keep sending the same request? Also, can you add in the documentation for this feature how to mark all the old invitations as sent before enabling the app? People should not receive them.

maxidorius commented 5 years ago

Is there a way to increase the timeout so synapse does not keep sending the same request?

No idea. You'll need to check with them.

can you add in the documentation for this feature how to mark all the old invitations as sent before enabling the app? People should not receive them.

That doesn't really make sense I'm afraid. mxisd deals with whatever synapse sends to it, mxisd doesn't choose what is sent.

MXISD did not have any errors or warnings and kept sending emails ( ~150 emails per push_bulk ).

I'll still need to see the mxisd logs for a full transaction that failed. Without them, I can't figure out what and where is the problem if there is one with mxisd. If you don't want to post them in Github, you can send those in a direct chat in Matrix to me (@max:kamax.io) or via e-mail to the one on my profile.

maxidorius commented 5 years ago

Related synapse issue: matrix-org/synapse#4231