gpt4 book ai didi

php - laravel 队列守护进程邮件停止运行并出现 SSL 错误

转载 作者:可可西里 更新时间:2023-10-31 23:40:20 24 4
gpt4 key购买 nike

我正在运行一个 laravel 队列守护进程,它根据所采取的操作发送邮件。这是通过主管运行以确保它始终运行。起初它工作正常,但一段时间后邮件停止发送。错误不是向上报告链,而是日志显示:

[2014-07-30 20:00:21] production.ERROR: exception 'ErrorException' with message 'fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry' in /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:232
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'fwrite(): SSL o...', '/srv/www/example...', 232, Array)
#1 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(232): fwrite(Resource id #376, 'MAIL FROM: <hel...')
#2 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php(171): Swift_Transport_StreamBuffer->_commit('MAIL FROM: <hel...')
#3 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php(90): Swift_ByteStream_AbstractFilterableInputStream->_doWrite('MAIL FROM: <hel...')
#4 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(274): Swift_ByteStream_AbstractFilterableInputStream->write('MAIL FROM: <hel...')
#5 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(243): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM: <hel...', Array, Array)
#6 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(323): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM: <hel...', Array)
#7 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(416): Swift_Transport_EsmtpTransport->_doMailFromCommand('hello@example.co...')
#8 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(444): Swift_Transport_AbstractSmtpTransport->_doMailTransaction(Object(Swift_Message), 'hello@example.co...', Array, Array)
#9 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(174): Swift_Transport_AbstractSmtpTransport->_sendTo(Object(Swift_Message), 'hello@example.co...', Array, Array)
#10 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(85): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#11 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(328): Swift_Mailer->send(Object(Swift_Message), Array)
#12 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(150): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#13 /srv/www/example.co.uk/bootstrap/compiled.php(3231): Illuminate\Mail\Mailer->send('emails.campaign...', Array, Object(Closure))
#14 /srv/www/example.co.uk/app/commands/Sender.php(252): Illuminate\Support\Facades\Facade::__callStatic('send', Array)
#15 /srv/www/example.co.uk/app/commands/Sender.php(252): Illuminate\Support\Facades\Mail::send('emails.campaign...', Array, Object(Closure))
#16 /srv/www/example.co.uk/app/commands/Sender.php(116): Sender->_sendEmail(Array, Array, Array, Array)
#17 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(96): Sender->queue(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#18 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Jobs/RedisJob.php(46): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#19 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(192): Illuminate\Queue\Jobs\RedisJob->fire()
#20 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(142): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), '2', 0)
#21 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(101): Illuminate\Queue\Worker->pop('redis', NULL, 0, '3', '2')
#22 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(73): Illuminate\Queue\Worker->runNextJobForDaemon('redis', NULL, 0, '3', '2')
#23 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(98): Illuminate\Queue\Worker->daemon('redis', NULL, 0, 128, '3', '2')
#24 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(68): Illuminate\Queue\Console\WorkCommand->runWorker('redis', NULL, 0, 128, true)
#25 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Console/Command.php(112): Illuminate\Queue\Console\WorkCommand->fire()
#26 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Console/Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Application.php(887): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /srv/www/example.co.uk/artisan(59): Symfony\Component\Console\Application->run()
#32 {main} [] []

我的想法很烂?我正在使用 sendgrid 进行邮寄

编辑,同这里:https://github.com/swiftmailer/swiftmailer/issues/490

最佳答案

这是 Laravel/Swift 内部的一个错误,以及它在长时间运行的队列工作线程中处理套接字的方式。避免此问题的最佳方法是确保在每封电子邮件发送后关闭传输。

有一个closed issue在 Laravel 的错误跟踪器中有几个 Laravel 代码库的补丁可以解决这个问题。

或者,看看 YOzaz/Laravel-SwiftMailer包,它有一个更新的 Mail facade,很可能会解决您遇到的问题。

关于php - laravel 队列守护进程邮件停止运行并出现 SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25045963/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com