I already read this issue here https://www.drupal.org/project/single_content_sync/issues/3321021

mean in previous version the export with assets for s3 already fixe, but i get this issue with last version `"drupal/single_content_sync": "^1.3"` / 1.3.15

error message:

```
The website encountered an unexpected error. Please try again later.
TypeError: Drupal\single_content_sync\ContentSyncHelper::createZipInstance(): Return value must be of type Drupal\Core\Archiver\ArchiverInterface, null returned in Drupal\single_content_sync\ContentSyncHelper->createZipInstance() (line 158 of modules/contrib/single_content_sync/src/ContentSyncHelper.php).
Drupal\single_content_sync\ContentSyncHelper->createZipInstance('', 8) (Line: 87)
Drupal\single_content_sync\ContentFileGenerator->generateZipFile(Object, ) (Line: 228)
Drupal\single_content_sync\Form\ContentExportForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('single_content_sync_export_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kamalMaroc created an issue. See original summary.

tbadaczewski’s picture

I'm also experiancig this issue and would love a fix. I'm using the S3FS Module (8.x-3.2) as well.

TypeError: Drupal\single_content_sync\ContentSyncHelper::createZipInstance(): Return value must be of type Drupal\Core\Archiver\ArchiverInterface, null returned in Drupal\single_content_sync\ContentSyncHelper->createZipInstance() (line 158 of /var/app/current/html/web/modules/contrib/single_content_sync/src/ContentSyncHelper.php)

nginex’s picture

Thanks for the feedback, I'm going to test the module with some basic s3 set up.

nginex’s picture

Status: Active » Postponed (maintainer needs more info)

Hi @tbadaczewski and @kamalMaroc,

I just finished testing drupal 10 with s3 setup and I cound not reproduce the issue, in my case the zip file was generated without problems.

Please provide more details:

- which drupal core version is used
- which "Default download method" is used (check on /admin/config/media/file-system)
- which PHP version is used

tbadaczewski’s picture

Drupal Version: 9.5.9
Default Download Method: Public files served from Amazon S3.
PHP: 8.0.28

I tried changing the "Default Download Method" to "Private local files served by Drupal." because that seemed like it could solve it, but I recieve the same error. Ran a "drush updatedb" and "drush cr" after change to make sure everythign was refreshed.

I'm trying to export by checking multuiple content items from the "/admin/content" window and then using the "Export content" action to "Apply to selected items". I check "Include all assets" and "Include all translation"s, but it fails even if those are not checked.

	TypeError: Drupal\single_content_sync\ContentSyncHelper::createZipInstance(): Return value must be of type Drupal\Core\Archiver\ArchiverInterface, null returned in Drupal\single_content_sync\ContentSyncHelper->createZipInstance() (line 158 of /var/app/current/html/web/modules/contrib/single_content_sync/src/ContentSyncHelper.php)
#0 /var/app/current/html/web/modules/contrib/single_content_sync/src/ContentFileGenerator.php(108): Drupal\single_content_sync\ContentSyncHelper->createZipInstance('', 8)
#1 /var/app/current/html/web/modules/contrib/single_content_sync/src/Form/ContentBulkExportForm.php(144): Drupal\single_content_sync\ContentFileGenerator->generateBulkZipFile(Array, false, false)
#2 [internal function]: Drupal\single_content_sync\Form\ContentBulkExportForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#3 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#4 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#5 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#6 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('single_content_...', Array, Object(Drupal\Core\Form\FormState))
#7 /var/app/current/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\single_content_sync\Form\ContentBulkExportForm), Object(Drupal\Core\Form\FormState))
#8 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#9 /var/app/current/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 /var/app/current/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /var/app/current/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /var/app/current/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /var/app/current/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /var/app/current/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/app/current/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/app/current/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/app/current/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/app/current/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/app/current/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}
nginex’s picture

Hi @tbadaczewski,

Thanks for more details, could you please try with "Public local files served by the webserver" as Default Download Method.

tbadaczewski’s picture

And the S3 File System Module I'm using is version 8.x-3.2

https://www.drupal.org/project/s3fs

tbadaczewski’s picture

StatusFileSize
new56.09 KB

I don't appear to have that option since I'm using the S3FS module. I did try "Amazon Simple Storage Service", but it was the same error. I've attached a screenshot.

nginex’s picture

I think that's the issue, it seems like you do not have public schema, currently zip can only be created by using public file schema

tbadaczewski’s picture

The reports status page clears the checks for the filesystem and S3FS Public Processing,

FILE SYSTEM: Writable (public download method)

S3FS PUBLIC:// TAKEOVER Enabled

S3FS is processing public:// file requests.

tbadaczewski’s picture

StatusFileSize
new12.13 KB
new104.2 KB

This is interesting. I see that the "content-bulk-export-XXXXXX.zip" zip files do get created and sent to S3, but they are all 0 B.

I've attached a screenshot.

nginex’s picture

Try to revert this change locally and see if the bug disappear

https://git.drupalcode.org/project/single_content_sync/-/commit/b1c562d4...

tbadaczewski’s picture

I'm getting the same error, but on a different line after using the changes.

Location https://XXXXXXX/admin/content/bulk-export?destination=%2Fadmin%2Fcontent
Referrer https://XXXXXXX/admin/content/bulk-export?destination=/admin/content

TypeError: Drupal\single_content_sync\ContentSyncHelper::createZipInstance(): Return value must be of type Drupal\Core\Archiver\ArchiverInterface, null returned in Drupal\single_content_sync\ContentSyncHelper->createZipInstance() (line 147 of /var/app/current/html/web/modules/contrib/single_content_sync/src/ContentSyncHelper.php)
#0 /var/app/current/html/web/modules/contrib/single_content_sync/src/ContentFileGenerator.php(105): Drupal\single_content_sync\ContentSyncHelper->createZipInstance('', 8)
#1 /var/app/current/html/web/modules/contrib/single_content_sync/src/Form/ContentBulkExportForm.php(168): Drupal\single_content_sync\ContentFileGenerator->generateBulkZipFile(Array, false, false)
#2 [internal function]: Drupal\single_content_sync\Form\ContentBulkExportForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#3 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#4 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#5 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#6 /var/app/current/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('single_content_...', Array, Object(Drupal\Core\Form\FormState))
#7 /var/app/current/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\single_content_sync\Form\ContentBulkExportForm), Object(Drupal\Core\Form\FormState))
#8 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#9 /var/app/current/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#10 /var/app/current/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /var/app/current/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#12 /var/app/current/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#13 /var/app/current/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /var/app/current/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/app/current/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/app/current/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/app/current/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/app/current/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/app/current/html/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/app/current/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}
kamalMaroc’s picture

@nginex first of all thank you for help us,
any update to fixe this issue ??

thank you

kamalMaroc’s picture

@tbadaczewski are u found any others solution ??

nginex’s picture

Version: 1.3.15 » 1.3.x-dev
Assigned: Unassigned » nginex
Status: Postponed (maintainer needs more info) » Active

I could reproduce the issue when s3fs.upload_as_private is TRUE, I'm going to fix it ASAP

nginex’s picture

Title: Export with assets for s3 not working » 3362720-s3-support
Assigned: nginex » Unassigned
Status: Active » Needs review

Guys, could you please test the fix I provided in new MR, It worked it my case really well

kamalMaroc’s picture

@nginex which version should to install ??

nginex’s picture

Title: 3362720-s3-support » Export with assets for s3 not working

@kamalMaroc, let me create a new patch release now, I will keep you posted

  • nginex committed d4e25652 on 1.3.x
    Issue #3362720: Use temporary file schema for exporting/importing zip.
    
nginex’s picture

Status: Needs review » Fixed

@kamalMaroc,

Here is a new release with the fix https://www.drupal.org/project/single_content_sync/releases/1.3.17

I'm going to backport it to 1.4.x

  • nginex committed 97f444dc on 1.4.x
    Issue #3362720: Use temporary file schema for exporting/importing zip.
    
nginex’s picture

External file import issue has been fixed in #3384349: External assets from S3 are not correctly importing

nginex’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.