pimcore / pimcore

Core Framework for the Open Source Data & Experience Management Platform (PIM, MDM, CDP, DAM, DXP/CMS & Digital Commerce)
http://www.pimcore.com
Other
3.38k stars 1.43k forks source link

AWS S3 integration issue in download assets zip file #5628

Closed kudeepak closed 4 years ago

kudeepak commented 4 years ago

Bug Report

Expected behavior

Image should be douwnload by clicking button "Download selected items as ZIP" under assets listing.

Actual behavior

It is giving 500 internal server error.

Steps to reproduce

-> Go in assets -> Click on list -> Select checkbox -> Click "Download selected items as ZIP"

Code example

// your code

Feature Request

Feature description

brusch commented 4 years ago

Please provide the full error message incl. the stack trace, otherwise we're not able to help. You should find this information in your log files.

kudeepak commented 4 years ago

Below is the error we are getting :

Oops! An Error Occurred The server returned a "500 Internal Server Error". Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

The file "/var/www/var/tmp/download-zip-5e27e6b4688e2.zip" does not exist

in vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/File.php (line 36)

kudeepak commented 4 years ago

It is a path issue. But we have this path and that one is writable as well. Then why this error is coming. We are using Pimcore 6. Also we followed all the steps of Pimcore 6 to integrate the S3.

brusch commented 4 years ago

You don't have a stack trace? Would be nice if you could fix that and provide us a PR as we don't have a dev-system with S3 ready. Should be quite easy, just have a look at this action: https://github.com/pimcore/pimcore/blob/ca75246d82fe1190ce2268767ace84f157b168d9/bundles/AdminBundle/Controller/Admin/AssetController.php#L1766

Btw. PIMCORE_SYSTEM_TEMP_DIRECTORY shouldn't be on S3 ... if that's the case, change it to a local path.

kudeepak commented 4 years ago

Thanks Brusch, Will look as per your suggestion. As you hint will check in that direction.

I will update in this ticket only.

kudeepak commented 4 years ago

Hi Brusch, Just after updating the Line no 1880 of file
`pimcore/bundles/AdminBundle/Controller/Admin/AssetController.php

$zip->addFile($a->getFileSystemPath(), preg_replace('@^' . preg_quote($asset->getRealPath(), '@') . '@i', '', $a->getRealFullPath())); with $zip->addFromString(preg_replace('@^' . preg_quote($asset->getRealPath(), '@') . '@i', '', $a->getRealFullPath()), file_get_contents($a->getFileSystemPath()));

It is getting downloaded. But it is lib change, and create issue in deployment.