Export/Import throwing ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open()

Created on 9 February 2023, over 2 years ago

Problem/Motivation

During bulk export/import. Errors are being thrown for the libzip library no longer accepting empty files. The import functionality stops the user completely and it looks really broken. The issue has been found already and there is a dependency in core for it to be fixed. But until then, is there no work around or to get this to not stop the user during importing? They need to keep refreshing the page to get the import to work correctly.

Steps to reproduce

1. Go to the Import page
2. Choose a previously exported zip file with the assets
3. Press Import

Page throws white screen of death with:
The website encountered an unexpected error. Please try again later.
ValueError: ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open() (line 31 of core/lib/Drupal/Core/Archiver/Zip.php).
ZipArchive->open('') (Line: 31)
Drupal\Core\Archiver\Zip->__construct() (Line: 57)
Drupal\Core\Archiver\ArchiverManager->createInstance('Zip', Array) (Line: 73)
Drupal\Core\Archiver\ArchiverManager->getInstance(Array) (Line: 159)
Drupal\single_content_sync\ContentSyncHelper->createZipInstance('/mnt/tmp/mtndecoupledode15/content-bulk-export-09_02_2023-11_19_0.zip') (Line: 467)
Drupal\single_content_sync\ContentImporter->importFromZip('/mnt/tmp/mtndecoupledode15/content-bulk-export-09_02_2023-11_19_0.zip') (Line: 127)
Drupal\single_content_sync\Form\ContentImportForm->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: 595)
Drupal\Core\Form\FormBuilder->processForm('single_content_sync_import_form', Array, Object) (Line: 323)
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: 42)
Drupal\force_password_change\Service\ForcePasswordChangeRedirectMiddleware->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: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024