בעיית Gsuite smtp-relay "end of file reached"

סיכום מבוסס בינה מלאכותית

User agf1997 reports an SMTP relay issue with GSuite, causing 15,547 failed email jobs in Discourse, with error “end of file reached” during mail testing via discourse-doctor. Their app.yml config uses smtp-relay.gmail.com:587 with no credentials, matching GSuite relay settings that allow only domain addresses, require TLS, and restrict IPs to their DigitalOcean server. Syonyk notes similar timing of failures across users and links to a related thread [emails have stopped sending end of file error](https://meta.discourse.org/t/emails-have-stopped-sending-end-of-file -error/176486), but no solution yet. The queue has grown to 130,988 jobs agf1997, which Syonyk confirms is expected since emails can’t send — clearing the queue won’t help unless the root cause is fixed Syonyk. The issue appears to be sudden and widespread, likely related to GSuite’s SMTP relay behavior changes, not configuration or Sidekiq capacity.

Forgive me if this is covered somewhere else.

For the past couple of years I have been using Gsuite as an smtp relay for discourse. Today I found the following error when entering discourse.

There are 15547 email jobs that failed. Check your app.yml and ensure that the mail server settings are correct. See the failed jobs in Sidekiq.

The app.yml is setup like this.

SMTP_ADDRESS=smtp-relay.gmail.com
SMTP_PORT=587
SMTP_PASSWORD=
SMTP_USER_NAME=

The Sidekiq dashboard looks like this:

I tried running discourse-doctor and got the following:

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Sending mail to REDACTED  . . 
Testing sending to admin@acescentral.com using smtp-relay.gmail.com:587.
======================================== ERROR ========================================
                                    UNEXPECTED ERROR

end of file reached

====================================== SOLUTION =======================================
This is not a common error. No recommended solution exists!

Please report the exact error message above to https://meta.discourse.org/
(And a solution, if you find one!)
=======================================================================================

In Gsuite my smtp-relay settings are

Allowed senders: Only addresses in my domains
Only accept mail from the specified IP addresses: Yes
Allowed IP addresses: digital ocean discourse production
Require SMTP Authentication: No
Require TLS encryption: Yes

Is there anything that I’m doing obviously incorrectly?

Thanks in advance
`

There’s some discussion on the same issue going on over here, though no solutions yet.

Looks like the timing on your failures roughly matches (mine started about 5 days ago, looks like yours started ticking up a few days prior).

New message today …

  • The number of queued jobs is 130988, which is high. This could indicate a problem with the Sidekiq process(es), or you may need to add more Sidekiq workers.

It can’t send messages, so they’re queuing up - nothing unexpected there. I’ve still no idea why the Google smtp-relay has suddenly stopped working, though.

Is it worth clearing the queue? Will the backlog crash the server?

It doesn’t matter. Unless the actual issue sending mails is resolved, the backlog will just return.