Ocelot-Social-Community / Ocelot-Social

Free and open-source social network for active citizenship.
https://ocelot.social
Other
96 stars 38 forks source link

🐛 [Bug] Backend – If one Sends Really a lot of Mentions in a Post the Backend Throws an Error #6726

Open Tirokk opened 1 year ago

Tirokk commented 1 year ago

🐛 Bugreport

Backend – If a user puts a lot of mentions in a post/comment the backend throws an error (see below) and no notifactions are sent.

Additional Information

An error on the backend of wir.social:

yarn run v1.22.19
$ node dist/
Warning: Sentry middleware inactive.
🚀 Server ready at http://localhost:4000/
🚀 Subscriptions ready at ws://localhost:4000/graphql
/app/node_modules/nodemailer/lib/smtp-connection/index.js:1199
            this._onError(new Error('Invalid greeting. response=' + str), 'EPROTOCOL', str, 'CONN');
                          ^

Error: Invalid greeting. response=421 4.7.0 mail.webcraft-media.de Error: too many connections from 164.92.142.135: 421 4.7.0 mail.webcraft-media.de Error: too many connections from 164.92.142.135
    at SMTPConnection._actionGreeting (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1199:27)
    at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:942:20)
    at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
    at SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 'EPROTOCOL',
  response: '421 4.7.0 mail.webcraft-media.de Error: too many connections from 164.92.142.135',
  responseCode: 421,
  command: 'CONN'
}

Node.js v19.9.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Solution

It seems that the nodemailer has to many connections in parallel at one time and that there are limits on the other side on the e-mail server. And that limit seems different by server. It's the simultaneous login limit, possibly.

Possibilities:

Tasks

Issues and PRs

Tirokk commented 5 months ago

Error log just today on yunite.me:

yarn run v1.22.19
$ node build/src/
Warning: Sentry middleware inactive.
🚀 Server ready at http://localhost:4000/
🚀 Subscriptions ready at ws://localhost:4000/graphql
(node:27) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
/app/node_modules/nodemailer/lib/smtp-connection/index.js:1199
            this._onError(new Error('Invalid greeting. response=' + str), 'EPROTOCOL', str, 'CONN');
                          ^
Error: Invalid greeting. response=421-4.7.0 Error: too many connections
421 4.7.0 please see https://kasserver.com/rbl/: 421-4.7.0 Error: too many connections
421 4.7.0 please see https://kasserver.com/rbl/
    at SMTPConnection._actionGreeting (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1199:27)
    at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:942:20)
    at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
    at SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)
    at Socket.emit (node:events:511:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:332:12)
    at readableAddChunk (node:internal/streams/readable:305:9)
    at Readable.push (node:internal/streams/readable:242:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 'EPROTOCOL',
  response: '421-4.7.0 Error: too many connections\n' +
    '421 4.7.0 please see https://kasserver.com/rbl/',
  responseCode: 421,
  command: 'CONN'
}
Node.js v20.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.