polychatproject / polychat-appservice

A Matrix AppService to connect people via Polychats
https://www.polychat.de
GNU Affero General Public License v3.0
0 stars 1 forks source link

Prevent appservice from crashing #15

Open yncyrydybyl opened 9 months ago

yncyrydybyl commented 9 months ago

The appservices is crashing and when it starts it is trying to fill the room pool. That leads running into the room limits after a while.

The last crash I have seen was:

Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: Appservice Processing transaction 36678
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: Appservice Processing event of type m.room.member
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: MatrixHttpClient (REQ-47) {
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]:   errcode: "M_FORBIDDEN",
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]:   error: "Application service has not registered this user (@polychat_0000000007:polychat.de)",
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: }
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: 10 |      * Creates a new Matrix Error
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: 11 |      * @param body The error body.
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: 12 |      * @param statusCode The HTTP status code.
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: 13 |      */
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: 14 |     constructor(body, statusCode) {
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: 15 |         super();
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]:              ^
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]: error: M_FORBIDDEN: Application service has not registered this user (@polychat_0000000007:polychat.de)
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]:       at new MatrixError (/app/node_modules/matrix-bot-sdk/lib/models/MatrixError.js:15:9)
Feb 16 00:28:04 alpha matrix-appservice-polychat[3279884]:       at /app/node_modules/matrix-bot-sdk/lib/http.js:95:15
Feb 16 00:28:04 alpha systemd[1]: matrix-appservice-polychat.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 00:28:04 alpha systemd[1]: matrix-appservice-polychat.service: Failed with result 'exit-code'.
jaller94 commented 9 months ago

Hotfix: Calling .ensureRegistered() before using the account.

https://github.com/polychatproject/polychat-appservice/commit/18759d030c8177d70e73c3abbc6c32f7acb4bbfd

Todo:

jaller94 commented 9 months ago

Back to development, as the error still occurs:

Feb 16 15:45:07 alpha systemd[1]: Started matrix-appservice-polychat.service - Matrix Appservice polychat bridge.
Feb 16 15:45:08 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094708620,"pid":1,"hostname":"3571fc3823ab","name":"logger","msg":"pino.json does not exist. Use it to configure the logger. See https://getpino.io/#/docs/api?id=options"}
Feb 16 15:45:08 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094708670,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"AppService: Listening on 0.0.0.0:9998"}
Feb 16 15:45:08 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094708670,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"Sub Room Pool: Creating 2 sub rooms for telegram"}
Feb 16 15:45:08 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094708677,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"Sub Room Pool: Creating 2 sub rooms for whatsapp"}
Feb 16 15:45:08 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094708678,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"API: Listening on 0.0.0.0:9999"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709474,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Invite DEBUG_MXID to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709476,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Invite DEBUG_MXID to !aBeDkTlUwRmrYQSWxE:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709477,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Invite DEBUG_MXID to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709478,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Invite DEBUG_MXID to !NjcgZaMUBCZvcONXiV:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709945,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Invite WHATSAPP_BRIDGE_MXID to !aBeDkTlUwRmrYQSWxE:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709952,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Invite WHATSAPP_BRIDGE_MXID to !NjcgZaMUBCZvcONXiV:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709961,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Invite TELEGRAM_BRIDGE_MXID to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:09 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094709967,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Invite TELEGRAM_BRIDGE_MXID to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710117,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Set power level of WHATSAPP_BRIDGE_MXID to 50 in !aBeDkTlUwRmrYQSWxE:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710119,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Set power level of WHATSAPP_BRIDGE_MXID to 50 in !NjcgZaMUBCZvcONXiV:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710127,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Set power level of TELEGRAM_BRIDGE_MXID to 50 in !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710134,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Set power level of TELEGRAM_BRIDGE_MXID to 50 in !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710386,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Invite TELEGRAM_BRIDGE_TUG_MXID to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710404,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Invite TELEGRAM_BRIDGE_TUG_MXID to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710409,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Join as WHATSAPP_BRIDGE_TUG_MXID to !NjcgZaMUBCZvcONXiV:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710413,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Join as WHATSAPP_BRIDGE_TUG_MXID to !aBeDkTlUwRmrYQSWxE:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710933,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Join as TELEGRAM_BRIDGE_TUG_MXID to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:10 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094710940,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Join as TELEGRAM_BRIDGE_TUG_MXID to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:25 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094725427,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Send \"create group\" command to !NjcgZaMUBCZvcONXiV:polychat.de"}
Feb 16 15:45:25 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094725429,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Send \"create group\" command to !aBeDkTlUwRmrYQSWxE:polychat.de"}
Feb 16 15:45:26 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094726128,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Send \"create group\" command to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:26 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094726130,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Send \"create group\" command to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:26 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094726201,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Sent \"create group\" to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:26 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094726205,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Sent \"create group\" to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:40 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094740442,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Send \"invite-link\" to !NjcgZaMUBCZvcONXiV:polychat.de"}
Feb 16 15:45:40 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094740448,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (whatsapp): Send \"invite-link\" to !aBeDkTlUwRmrYQSWxE:polychat.de"}
Feb 16 15:45:41 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094741205,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Send \"invite-link\" to !esweobkHgswzTCzqor:polychat.de"}
Feb 16 15:45:41 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094741206,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Send \"invite-link\" to !pNEHYWqpAsAgZlNApq:polychat.de"}
Feb 16 15:45:41 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094741418,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Left !pNEHYWqpAsAgZlNApq:polychat.de as TELEGRAM_BRIDGE_TUG_MXID"}
Feb 16 15:45:41 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708094741419,"pid":1,"hostname":"3571fc3823ab","name":"appservice","msg":"createSubRoom (telegram): Left !esweobkHgswzTCzqor:polychat.de as TELEGRAM_BRIDGE_TUG_MXID"}
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708095108265,"pid":1,"hostname":"3571fc3823ab","module":"Appservice","msg":"Processing transaction 36678"}
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: {"level":30,"time":1708095108267,"pid":1,"hostname":"3571fc3823ab","module":"Appservice","msg":"Processing event of type m.room.member"}
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: {"level":50,"time":1708095108334,"pid":1,"hostname":"3571fc3823ab","0":"(","1":"R","2":"E","3":"Q","4":"-","5":"4","6":"7","7":")","errcode":"M_FORBIDDEN","error":"Application service has not registered this user (@polychat_0000000007:polychat.de)","module":"MatrixHttpClient"}
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: 10 |      * Creates a new Matrix Error
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: 11 |      * @param body The error body.
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: 12 |      * @param statusCode The HTTP status code.
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: 13 |      */
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: 14 |     constructor(body, statusCode) {
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: 15 |         super();
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]:              ^
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]: error: M_FORBIDDEN: Application service has not registered this user (@polychat_0000000007:polychat.de)
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]:       at new MatrixError (/app/node_modules/matrix-bot-sdk/lib/models/MatrixError.js:15:9)
Feb 16 15:51:48 alpha matrix-appservice-polychat[3681348]:       at /app/node_modules/matrix-bot-sdk/lib/http.js:95:15
Feb 16 15:51:48 alpha systemd[1]: matrix-appservice-polychat.service: Main process exited, code=exited, status=1/FAILURE