Bucle infinito en el envío de correos electrónicos de resumen

Hola a todos.

Nuestro servidor de Discourse entró en un bucle infinito enviando correos electrónicos sin parar. Aquí está la salida de shared/standalone/log/rails/production.log:

Entregado correo 7db8eecd-c36a-419c-ae34-0561b08bae25@community.xx.cc (1322.2ms)
  Renderizado user_notifications/digest.text.erb (Duración: 50.1ms | Asignaciones: 12577)
  Renderizando user_notifications/digest.html.erb dentro de layouts/email_template
  Renderizado user_notifications/digest.html.erb dentro de layouts/email_template (Duración: 139.5ms | Asignaciones: 26910)
  Renderizando user_notifications/digest.text.erb
  Renderizado user_notifications/digest.text.erb (Duración: 71.7ms | Asignaciones: 13505)
Entregado correo 5bbf2e54-96a8-437d-a032-69f98a00f22a@community.xx.cc (1485.2ms)
  Renderizando user_notifications/digest.html.erb dentro de layouts/email_template
  Renderizado user_notifications/digest.html.erb dentro de layouts/email_template (Duración: 70.9ms | Asignaciones: 20613)
  Renderizando user_notifications/digest.text.erb
  Renderizado user_notifications/digest.text.erb (Duración: 38.2ms | Asignaciones: 11390)

Esto comenzó a ocurrir de repente (probablemente cuando se inició el cron de digestos:

)

Ahora, un núcleo está completamente ocupado enviando correos de digestos.

  • Reconstruir la aplicación no ayuda;

  • Actualizar a la última versión: sin cambios;

  • Activar “Deshabilitar correos de resumen para todos los usuarios” y reconstruir la aplicación: sin cambios;

    #### Instalado
    
    ### 2.4.0.beta5
    

¿Qué más puedo hacer? ¿Cómo puedo detener esto?
Gracias de antemano.

1 me gusta

I could be wrong, but I think that what happened is that the summary emails got queued and now it’s delivering them. It’s going to keep going until it delivers them.

If I’m right, You can disable emails then find the table that has them and delete them. But it’s just going to happen again the next time that summary emails go out.

1 me gusta

Yes, but this happens for 3 days already. All other mails (register, for example are not delivered anymore. Community works, but all emailing - not).
I found very similar issue - Extreme memory usage due to bad mail credentials. So look like this is some kind of tricky bug.

The only way I found in order to stop this - I removed the auth token in my SMTP provider. Discourse start showing hundreds of errors and only after that load decreased. I restored the token and now all seems ok.

1 me gusta

Did you have bad email credentials?

@codinghorror I found the root cause of the issue. Our mail provider removed (for their own stupid reasons) verified host records for our account. The host records were used to provide from field in the email with our host. So after they did that - discourse went into endless loop. I think discourse flow has a bug as well for that case. Because it should report the error and stop load 1 core for 100%.

So account is correct. But mail provider returns an error on mail send “Wrong sending host” or something like that and this flow causes the issue.

2 Me gusta

I agree, this is a bad state to be in and we should handle it better.

1 me gusta

Is everything back to normal now?

Yes. After I changed credentials for mail.

1 me gusta