Using empty file as ZipArchive is deprecated

Created on 8 October 2023, about 1 year ago
Updated 9 October 2023, about 1 year ago

Problem/Motivation

On /admin/config/development/backup_migrate/advanced when trying to backup private files using ZIP compression and Download method, I obtain the following stacktrace in my log and a 503 server error.

Deprecated function: ZipArchive::open(): Using empty file as ZipArchive is deprecated in Drupal\backup_migrate\Core\Filter\CompressionFilter->zipEncode() (line 304 of app/modules/contrib/backup_migrate/src/Core/Filter/CompressionFilter.php) #0 app/core/includes/bootstrap.inc(158): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 app/modules/contrib/backup_migrate/src/Core/Filter/CompressionFilter.php(304): ZipArchive->open()
#3 app/modules/contrib/backup_migrate/src/Core/Filter/CompressionFilter.php(132): Drupal\backup_migrate\Core\Filter\CompressionFilter->zipEncode()
#4 app/modules/contrib/backup_migrate/src/Core/Plugin/PluginManager.php(116): Drupal\backup_migrate\Core\Filter\CompressionFilter->afterBackup()
#5 app/modules/contrib/backup_migrate/src/Core/Main/BackupMigrate.php(92): Drupal\backup_migrate\Core\Plugin\PluginManager->call()
#6 app/modules/contrib/backup_migrate/backup_migrate.module(46): Drupal\backup_migrate\Core\Main\BackupMigrate->backup()
#7 app/modules/contrib/backup_migrate/src/Form/BackupMigrateAdvancedBackupForm.php(115): backup_migrate_perform_backup()
#8 [internal function]: Drupal\backup_migrate\Form\BackupMigrateAdvancedBackupForm->submitForm()
#9 app/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array()
#10 app/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#11 app/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#12 app/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#13 app/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#14 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#15 app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#16 app/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#18 app/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#19 vendor/symfony/http-kernel/HttpKernel.php(163): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#20 vendor/symfony/http-kernel/HttpKernel.php(74): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#21 app/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#22 app/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#23 app/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#24 app/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#25 app/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#26 app/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#27 app/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#28 app/core/lib/Drupal/Core/DrupalKernel.php(692): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#29 app/index.php(19): Drupal\Core\DrupalKernel->handle()
#30 www/index.php(4): require('...')
#31 {main}.

When doing the same thing but with a GZIP compression, I obtain a max execution timeout, so I think in any case I will go back to an SSH connexion even for the webmasters of the website I maintain.

I also obtained a similar message like 🐛 Warning message on entire site backup fread(): Read of 8192 bytes failed with errno=21 Needs review but I checked my private files folder, deleted one empty folder, but anyway end up with the problem mentionned first.

Proposed resolution

Remaining tasks

Identify origin
Provide a fix

🐛 Bug report
Status

Needs review

Version

5.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

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

Comments & Activities

Production build 0.71.5 2024