Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
Tracked by #5691 ...
Tirokk opened this issue Sep 12, 2023 · 1 comment Β· Fixed by #8167
Closed
1 task
Tracked by #5691 ...
Assignees

Comments

@Tirokk
Copy link
Member

Tirokk commented Sep 12, 2023

πŸ› 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:

  • do bulk sending: login once and send all
  • can the nodemailer buffer the e-mails and send them one by one?
  • send the notification e-mails by the backend themself one by one and not in parallel?
  • establish a cron job for the notification e-mails?
  • for users: Limit the number of mentions per post/comment in the UI. Display an error message if exceeding.

Tasks

  • Update user guide if issue solved (here and here)

Issues and PRs

@Tirokk Tirokk added the bug Something isn't working label Sep 12, 2023
@mahula mahula changed the title πŸ› [Bug] Backend – If one Sends Really a lot of Mentions in a Post the Backend Troughs an Error πŸ› [Bug] Backend – If one Sends Really a lot of Mentions in a Post the Backend Throws an Error Sep 27, 2023
@Tirokk Tirokk moved this to Product Backlog in Kanban Board Ocelot-Social Software Jan 29, 2024
@Tirokk
Copy link
Member Author

Tirokk commented Jun 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants