AJAX HTTP error when sending email with attachment

Created on 9 May 2019, almost 6 years ago
Updated 18 October 2023, over 1 year ago

I receive the above error when sending an attachment with Views Send.

I'm using Mail System with "Mime Mail mailer" for the Formatter and "SMTP Mailer" for the Sender.

The following errors are reported in dblog with the referrer being /batch?id=1794&op=start

Warning: preg_match() expects parameter 2 to be string, object given in Drupal\Core\File\FileSystem->uriScheme() (line 293 of /vagrant/docroot/core/lib/Drupal/Core/File/FileSystem.php) #0 /vagrant/docroot/core/includes/bootstrap.inc(587): _drupal_error_handler_real(2, 'preg_match() ex...', '/vagrant/docroo...', 293, Array) #1 [internal function]: _drupal_error_handler(2, 'preg_match() ex...', '/vagrant/docroo...', 293, Array) #2 /vagrant/docroot/core/lib/Drupal/Core/File/FileSystem.php(293): preg_match('/^([\\w\\-]+):\\/\\...', Object(Drupal\Core\Field\FieldItemList), NULL) #3 /vagrant/docroot/core/includes/file.inc(107): Drupal\Core\File\FileSystem->uriScheme(Object(Drupal\Core\Field\FieldItemList)) #4 /vagrant/docroot/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php(103): file_uri_scheme(Object(Drupal\Core\Field\FieldItemList)) #5 /vagrant/docroot/core/lib/Drupal/Core/File/FileSystem.php(132): Drupal\Core\StreamWrapper\StreamWrapperManager->getViaUri(Object(Drupal\Core\Field\FieldItemList)) #6 /vagrant/docroot/modules/contrib/smtp/src/Plugin/Mail/SMTPMailSystem.php(431): Drupal\Core\File\FileSystem->realpath(Object(Drupal\Core\Field\FieldItemList)) #7 /vagrant/docroot/modules/contrib/mailsystem/src/Adapter.php(50): Drupal\smtp\Plugin\Mail\SMTPMailSystem->mail(Array) #8 /vagrant/docroot/modules/contrib/views_send/views_send.module(850): Drupal\mailsystem\Adapter->mail(Array) #9 /vagrant/docroot/modules/contrib/views_send/views_send.module(858): views_send_deliver(Object(stdClass)) #10 /vagrant/docroot/core/includes/batch.inc(295): views_send_batch_deliver(Array, false, Array, Array) #11 /vagrant/docroot/core/includes/batch.inc(137): _batch_process() #12 /vagrant/docroot/core/includes/batch.inc(93): _batch_do() #13 /vagrant/docroot/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request)) #14 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request)) #15 /vagrant/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #16 /vagrant/docroot/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /vagrant/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #18 /vagrant/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #19 /vagrant/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #20 /vagrant/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #21 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /vagrant/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /vagrant/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /vagrant/docroot/modules/contrib/shield/src/ShieldMiddleware.php(84): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\shield\ShieldMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /vagrant/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /vagrant/docroot/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /vagrant/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #31 {main}.

Warning: realpath() expects parameter 1 to be a valid path, object given in Drupal\Core\File\FileSystem->realpath() (line 136 of /vagrant/docroot/core/lib/Drupal/Core/File/FileSystem.php) #0 /vagrant/docroot/core/includes/bootstrap.inc(587): _drupal_error_handler_real(2, 'realpath() expe...', '/vagrant/docroo...', 136, Array) #1 [internal function]: _drupal_error_handler(2, 'realpath() expe...', '/vagrant/docroo...', 136, Array) #2 /vagrant/docroot/core/lib/Drupal/Core/File/FileSystem.php(136): realpath(Object(Drupal\Core\Field\FieldItemList)) #3 /vagrant/docroot/modules/contrib/smtp/src/Plugin/Mail/SMTPMailSystem.php(431): Drupal\Core\File\FileSystem->realpath(Object(Drupal\Core\Field\FieldItemList)) #4 /vagrant/docroot/modules/contrib/mailsystem/src/Adapter.php(50): Drupal\smtp\Plugin\Mail\SMTPMailSystem->mail(Array) #5 /vagrant/docroot/modules/contrib/views_send/views_send.module(850): Drupal\mailsystem\Adapter->mail(Array) #6 /vagrant/docroot/modules/contrib/views_send/views_send.module(858): views_send_deliver(Object(stdClass)) #7 /vagrant/docroot/core/includes/batch.inc(295): views_send_batch_deliver(Array, false, Array, Array) #8 /vagrant/docroot/core/includes/batch.inc(137): _batch_process() #9 /vagrant/docroot/core/includes/batch.inc(93): _batch_do() #10 /vagrant/docroot/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request)) #11 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request)) #12 /vagrant/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #13 /vagrant/docroot/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #14 /vagrant/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #15 /vagrant/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #16 /vagrant/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /vagrant/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #18 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /vagrant/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /vagrant/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /vagrant/docroot/modules/contrib/shield/src/ShieldMiddleware.php(84): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\shield\ShieldMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /vagrant/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /vagrant/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /vagrant/docroot/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /vagrant/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #28 {main}.

The email is successfully sent without any attachments.

The file is successfully uploaded and placed in the subfolder "views_send_attachments" and remains there.

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States carsonw

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡΄Norway hansfn

    I'm closing this as outdated.

    Please test with the current 2.0.x version. If you are not "user 1", make sure you have the "Use attachments with Views Send" permission. If you still have the problem, please test without batch sending too.

Production build 0.71.5 2024