Error in sending multiple emails

Created on 4 February 2023, almost 2 years ago
Updated 7 February 2023, almost 2 years ago

Problem/Motivation

Always getting this error
Error sending email: Cannot rewind a generator that was already run

I can send email but seems like when I send multiple emails almost consecutively this error occurs.

Below also is the trace

#0 /var/www/html/app/modules/contrib/symfony_mailer/src/Mailer.php(265): Symfony\Component\Mailer\Transport->fromDsnObject()
#1 /var/www/html/app/modules/contrib/symfony_mailer/src/Mailer.php(150): Drupal\symfony_mailer\Mailer->doSend()
#2 /var/www/html/app/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\symfony_mailer\Mailer->Drupal\symfony_mailer\{closure}()
#3 /var/www/html/app/modules/contrib/symfony_mailer/src/Mailer.php(159): Drupal\Core\Render\Renderer->executeInRenderContext()
#4 /var/www/html/app/modules/contrib/symfony_mailer/src/Email.php(285): Drupal\symfony_mailer\Mailer->send()
#5 /var/www/html/app/modules/contrib/symfony_mailer/src/MailManagerReplacement.php(92): Drupal\symfony_mailer\Email->send()
#6 /var/www/html/app/modules/contrib/commerce/src/MailHandler.php(105): Drupal\symfony_mailer\MailManagerReplacement->mail()
#7 /var/www/html/app/modules/contrib/commerce_invoice/src/Mail/InvoiceConfirmationMail.php(103): Drupal\commerce\MailHandler->sendMail()
#8 /var/www/html/app/modules/contrib/devel_php/src/Form/ExecutePHP.php(107) : eval()'d code(11): Drupal\commerce_invoice\Mail\InvoiceConfirmationMail->send()
#9 /var/www/html/app/modules/contrib/devel_php/src/Form/ExecutePHP.php(107): eval()
#10 [internal function]: Drupal\devel_php\Form\ExecutePHP->submitForm()
#11 /var/www/html/app/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
#12 /var/www/html/app/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#13 /var/www/html/app/core/lib/Drupal/Core/Form/FormBuilder.php(595): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#14 /var/www/html/app/core/lib/Drupal/Core/Form/FormBuilder.php(323): Drupal\Core\Form\FormBuilder->processForm()
#15 /var/www/html/app/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#16 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#17 /var/www/html/app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#18 /var/www/html/app/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#19 /var/www/html/app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#20 /var/www/html/app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#21 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#22 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#23 /var/www/html/app/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php(42): Symfony\Component\HttpKernel\HttpKernel->handle()
#24 /var/www/html/app/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle()
#25 /var/www/html/app/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#26 /var/www/html/app/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#27 /var/www/html/app/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#28 /var/www/html/app/modules/contrib/services/src/StackMiddleware/FormatSetter.php(44): Drupal\page_cache\StackMiddleware\PageCache->handle()
#29 /var/www/html/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\services\StackMiddleware\FormatSetter->handle()
#30 /var/www/html/app/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#31 /var/www/html/app/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#32 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#33 /var/www/html/app/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle()
#34 /var/www/html/app/index.php(19): Drupal\Core\DrupalKernel->handle()
#35 /var/www/html/web/index.php(4): require('...')
#36 {main}
πŸ› Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

πŸ‡ΈπŸ‡¬Singapore vhin0210

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024