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)
```
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | S3-bucket.png | 104.2 KB | tbadaczewski |
| #11 | public-s3.png | 12.13 KB | tbadaczewski |
| #8 | filesystem1.png | 56.09 KB | tbadaczewski |
Issue fork single_content_sync-3362720
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
Comment #2
tbadaczewski commentedI'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)Comment #3
nginex commentedThanks for the feedback, I'm going to test the module with some basic s3 set up.
Comment #4
nginex commentedHi @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
Comment #5
tbadaczewski commentedDrupal 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.
Comment #6
nginex commentedHi @tbadaczewski,
Thanks for more details, could you please try with "Public local files served by the webserver" as Default Download Method.
Comment #7
tbadaczewski commentedAnd the S3 File System Module I'm using is version 8.x-3.2
https://www.drupal.org/project/s3fs
Comment #8
tbadaczewski commentedI 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.
Comment #9
nginex commentedI 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
Comment #10
tbadaczewski commentedThe 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.
Comment #11
tbadaczewski commentedThis 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.
Comment #12
nginex commentedTry to revert this change locally and see if the bug disappear
https://git.drupalcode.org/project/single_content_sync/-/commit/b1c562d4...
Comment #13
tbadaczewski commentedI'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
Comment #14
kamalMaroc commented@nginex first of all thank you for help us,
any update to fixe this issue ??
thank you
Comment #15
kamalMaroc commented@tbadaczewski are u found any others solution ??
Comment #16
nginex commentedI could reproduce the issue when s3fs.upload_as_private is TRUE, I'm going to fix it ASAP
Comment #18
nginex commentedGuys, could you please test the fix I provided in new MR, It worked it my case really well
Comment #19
kamalMaroc commented@nginex which version should to install ??
Comment #20
nginex commented@kamalMaroc, let me create a new patch release now, I will keep you posted
Comment #22
nginex commented@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
Comment #24
nginex commentedExternal file import issue has been fixed in #3384349: External assets from S3 are not correctly importing
Comment #25
nginex commented