A
A
anlamas2018-07-19 07:45:23
PHP
anlamas, 2018-07-19 07:45:23

How to fix 502 Bad Gateway when sending an email?

Hello. I ran into a problem that when sending a letter I get a 502 error
when I send html, that is, But I don’t get an error when sending raw text, like this Error logs:
Mail::send('view', $data, $callback);
Mail::raw('Some text', $callback);

*20639 recv() failed (104: Connection reset by peer) while reading response header from upstream,
upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:"

WARNING: [pool site.com] child 16813 exited on signal 11 (SIGSEGV) after 51.029643 seconds from start

Googled the problem a lot, but did not solve it (
If you need any additional logs, write about it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2018-07-19
@OnYourLips

Falls off on timeout.
Set up your email provider.
If this is not a local provider, then use queues and send emails from background processes.

D
Danila Vershinin, 2018-07-19
@dvershinin

Adjust the server to use less memory. In your "dmesg | tail" you can clearly see that the server is killing processes because it runs out of memory.
Solutions include:
- decreasing pm.max_children in the PHP-FPM settings
- allocating a larger swap file
- decreasing the size of MySQL buffers. In general,
the most basic setting So you can wait for any problems here before the problem of lack of memory is not solved.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question