CSV export broken with S3FS

Created on 19 August 2025, about 2 months ago

Problem/Motivation

This bug currently affects two of our applications:

  • The first runs Drupal 10.5.2 and the 8.x-1.x-dev branch of Views Data Export (we use the dev branch because we use a patch from the Provide better download button style (# 3400988) issue ✨ Provide better download button style Active )
  • The second runs Drupal 10.5.2 and the 8.x-1.6 release of Views Data Export

The full error is as follows:
Error: Call to a member function seek() on null in Aws\S3\StreamWrapper->openAppendStream() (line 759 of /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php).

Back trace:

#0 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(161): Aws\S3\StreamWrapper->openAppendStream()
#1 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(965): Aws\S3\StreamWrapper->Aws\S3\{closure}()
#2 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(158): Aws\S3\StreamWrapper->boolCall()
#3 /var/www/html/web/modules/contrib/s3fs/src/StreamWrapper/S3fsStream.php(712): Aws\S3\StreamWrapper->stream_open()
#4 [internal function]: Drupal\s3fs\StreamWrapper\S3fsStream->stream_open()
#5 /var/www/html/web/modules/contrib/views_data_export/src/Plugin/views/display/DataExport.php(875): file_put_contents()
#6 /var/www/html/web/core/includes/batch.inc(297): Drupal\views_data_export\Plugin\views\display\DataExport::processBatch()
#7 /var/www/html/web/core/includes/batch.inc(139): _batch_process()
#8 /var/www/html/web/core/includes/batch.inc(95): _batch_do()
#9 /var/www/html/web/core/modules/system/src/Controller/BatchController.php(52): _batch_page()
#10 [internal function]: Drupal\system\Controller\BatchController->batchPage()
#11 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#12 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(637): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#14 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#15 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#17 /var/www/html/web/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(54): Symfony\Component\HttpKernel\HttpKernel->handle()
#18 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle()
#19 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#20 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#21 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#22 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#23 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#24 /var/www/html/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle()
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#29 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#30 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#31 {main}

I was able to work around this issue by downgrading the aws/aws-sdk-php package to version 3.351.9, so I have a temporary workaround in place.

Steps to reproduce

  1. Install Drupal Core 10.5.2
  2. Install the latest release of Views Data Export.
  3. Install the S3FS module and dependencies. Make sure to install any version of the aws/aws-sdk-php package above 3.351.9.
  4. Configure S3FS as your public and private file system. Leave your temporary file system configured to use local resources.
  5. Create a view with a CSV export. Configure it to use batch processing.
  6. Add any number of rows to the view.
  7. Go to the view and attempt to download a CSV of the view's data.
  8. Batch processing should initialize, but should fail before it actually begins processing.

Proposed resolution

For now, it appears that using version 3.351.9 of the aws/aws-sdk-php package is a valid workaround. I've only tried it in one of our applications so far and will report back when I'm able to try it in the second application.

Remaining tasks

Because the workaround involved downgrading to a previous version of the aws/aws-sdk-php package, I'm unsure if the solution will be found here or in the package's issue queue. It may be a good idea for me to open an issue there and link to it from here. Do the maintainers have any suggestions/preferences?

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jsutta United States

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

Comments & Activities

Production build 0.71.5 2024