- Issue created by @idesigntocode
- 🇺🇸United States briantschu West Orange, NJ
I think this is a duplicate of 🐛 PHP 8.1.x. compaitibility Fixed , which was merged into version 1.3.x-dev. Does using the dev version of the module, or applying the patches mentioned in comment #4 on that issue ( #3324392-4: PHP 8.1.x. compaitibility → ) fix the error for you?
- Status changed to Postponed: needs info
about 2 years ago 7:09am 16 February 2023 - 🇺🇦Ukraine nginex
I could not reproduce this issue, it's kind of weird that method createZipInstance accepts correct file path to your zip, but afterwards it gets lost in Drupal core methods.
Please let me know what Drupal core version do you use?
I also had the same problem on PHP 8.0 and 8.1.
Works without a problem on 7.4
Drupal version: 9.5.3Hi @briantschu which core patch are you referring to?
Hi @nginex I'm using 9.5.2 need to bump it to 9.5.3.
I'm on PHP 8.0
- Status changed to Active
about 2 years ago 6:26pm 28 February 2023 - Status changed to Closed: cannot reproduce
about 2 years ago 12:18pm 1 March 2023 - 🇺🇦Ukraine nginex
I could not reproduce the issue. I used clean drupal core 9.5.3 installation with php 8.1
I recommend you to debug getInstance method of ArchiverManager.php class.
I assume that the code below returns empty value, there might be some issue with handling temporary files on your system.
$this->fileSystem->realpath($configuration['filepath'])
- 🇦🇷Argentina drupal-son
Hi @nginex,
I have the same problem.
I'm using Single Content Sync 1.4.3, Drupal Core 9.5.11 and PHP 8.1.24
I'm using Acquia hosting.
I'm not using any Drupal Core patch for this purpose though.The weird thing is that the import works fine on dev, qa and uat environments but fails on prod environment.
All the environments have the same configuration deployed.I can export on uat and import into dev or qa but I get the error when importing into prod.
ValueError: ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open() (line 31 of /mnt/www/html/MYCONTAINER/app/MYAPP/docroot/core/lib/Drupal/Core/Archiver/Zip.php) #0 /mnt/www/html/MYCONTAINER/app/MYAPP/docroot/core/lib/Drupal/Core/Archiver/Zip.php(31): ZipArchive->open('')
I can see on the imported environment (dev, qa, and even prod) at `/admin/content/files` that my file has been uploaded as a temporary status.
Thanks.
- 🇦🇷Argentina drupal-son
I can add more info, I guess this might be something related with how and where the temporary files are stored.
Each Acquia environment have a different Drupal temporary folder configured, it works for all envs except for prod.
Might be something at the folder level, permissions, symlink or something on how Acquia is handling that temporary folder at `mnt/tmp/MYCONTAINERENV` directory.Does this ring any bell?
Thanks
- 🇮🇳India ashraf.hussain Bangalore
Not sure why the ticket was closed, I am also facing the same issue as mentioned in above comment 🐛 Export/Import throwing ZipArchive::open(): Argument #1 ($filename) cannot be empty in ZipArchive->open() Active .
Importing zip file works fine on dev, qa and uat environments but fails on prod environment. - 🇺🇦Ukraine nginex
@ashraf.hussain what is your temporary file path on prod and other envs? is there a difference?
- 🇮🇳India ashraf.hussain Bangalore
Thanks @nginex → for your response. I have checked the tmp path are same for dev, stage, uat, prod environment and set according to Acquia Cloud Platform.
Its in the below format:
/mnt/tmp/[sitename]
e.g.
Dev: /mnt/tmp/mysitedev
Staging:/mnt/tmp/mysitestg
Uat: /mnt/tmp/mysitedev
Prod: /mnt/tmp/mysitehttps://docs.acquia.com/acquia-cloud-platform/docs/manage-apps/files/tem...
You can replicate the issue in n Acquia Production environment.
- 🇺🇦Ukraine nginex
Unfortunately I don't have a project hosted on Acquia to test it.
Do you import the zip file via UI or drush?
If UI, maybe it worth trying to replace
'#upload_location' => "temporary://import/zip",
by
'#upload_location' => "public://import/zip",
Then the issue might gone
- 🇮🇳India ashraf.hussain Bangalore
Hi @nginex → , I changed to public://import/zip, while it imported correctly in Staging, but when I move to Production, it is giving the below error now. Not sure why it is looking for the file in temporary when file is uploaded in Public now.
php-error web-43497 [26-Feb-2025 21:36:23 America/Los_Angeles] Uncaught PHP Exception Drupal\Core\File\Exception\FileNotExistsException: "File 'temporary://import/zip/0ab2a388-6deb-4d89-8b52-16437905c9c3/assets/public/images/blogs/featured/xyz2720.png' could not be copied because it does not exist." at /mnt/www/html/marketing7/docroot/core/lib/Drupal/Core/File/FileSystem.php line 444 request_id="v-c7fa6322-f4cc-11ef-9ff6-df04d90c7bb8"
- 🇺🇦Ukraine nginex
@ashraf.hussain
I will try to provide a patch today, so it takes into account whole flow
- Merge request !151Issue #3340563: Make export and import directory file schema configurable → (Merged) created by nginex
- 🇺🇦Ukraine nginex
The patch is ready.
I made export and import directory file schema configurable.
Steps to test:
1. Apply patch
2. Execute drush updb && drush cr
3. Visit /admin/config/content/single-content-sync and change import directory schema to Public files.
4. Test import content on live once you release this change to live env. - 🇺🇦Ukraine nginex
will change priority because the issue in only applicable for live env on Acquia Cloud Platform hosting.
- 🇮🇳India ashraf.hussain Bangalore
Thank you @nginex → , I have applied the patch and it is working fine.
Automatically closed - issue fixed for 2 weeks with no activity.