8

enter image description here

Error: "Message is added to queue, wait to get your file soon"

enter code here Open admin panel/system/Data Transfer/Export

After that select all export setting and click the continue button.

When clicking on the continue button above the error show.

Why files are not export? How to export files?

Please suggest.

Thank you so much.

1
  • 1
    please execute php bin/magento cron:run Aug 8, 2019 at 8:28

4 Answers 4

4

Replace this below code in app/code/Magento/ImportExport/Controller/Adminhtml/Export/Export.php File


This code is working in my application

public function execute()
{
    if ($this->getRequest()->getPost(ExportModel::FILTER_ELEMENT_GROUP)) {
        try {
            $params = $this->getRequest()->getParams();
            $model = $this->_objectManager->create(\Magento\ImportExport\Model\Export::class);
            $model->setData($this->getRequest()->getParams());
            $this->sessionManager->writeClose();

            return $this->fileFactory->create(
                $model->getFileName(),
                $model->export(),
                \Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR,
                $model->getContentType()
            );

            /** @var ExportInfoFactory $dataObject */
            $dataObject = $this->exportInfoFactory->create(
                $params['file_format'],
                $params['entity'],
                $params['export_filter']
            );

            $this->messagePublisher->publish('import_export.export', $dataObject);
            $this->messageManager->addSuccessMessage(
                __('Message is added to queue, wait to get your file soon')
            );
        } catch (\Exception $e) {
            $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
            $this->messageManager->addError(__('Please correct the data sent value.'));
        }
    } else {
        $this->messageManager->addError(__('Please correct the data sent value.'));
    }
    /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
    $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
    $resultRedirect->setPath('adminhtml/*/index');
    return $resultRedirect;
}
1
  • Hello ., I have try with this code, File get exported but only some column are showing and no data exported Dec 17, 2019 at 7:08
25

If your var/importexportxxx file is blank try;

php bin/magento queue:consumers:start exportProcessor

https://github.com/magento/magento2/issues/23450

2
  • I can confirm this works as a temporary fix as Battamich's answers is my solution. (it's actually me!) Oct 22, 2019 at 15:50
  • use & in the end of the command to make it run in background php bin/magento queue:consumers:start exportProcessor & Aug 14, 2021 at 7:37
12

You have to run cron by command line as mentioned here: php bin/magento cron:run

https://github.com/magento/magento2/issues/23450#issuecomment-507581035

Then refresh the export page and you should see the file at the bottom.

4
  • Thank you so much. Aug 8, 2019 at 9:05
  • I'm using magento 2.3.2 cloud locally and this solution doesn't work for me.. I see that some files are generated inside var folder as "importexport_{id_number}" but they are all empty! Aug 9, 2019 at 15:54
  • How to make it work on localhost xampp Oct 1, 2019 at 18:19
  • Thanks a lot, superb!!! Mar 26, 2020 at 12:38
3

Adding on to what Andrew Taylor said, you can add the exportProcessor consumer (and others) to cron by adding the following to your app/etc/env.php file:

    'cron_consumers_runner' => [
        'cron_run' => true,
        'max_messages' => 20000,
        'consumers' => [
            'async.operations.all',
            'codegeneratorProcessor',
            'exportProcessor',
            'product_action_attribute.update',
            'product_action_attribute.website.update'
        ]
    ],

Not the answer you're looking for? Browse other questions tagged or ask your own question.