This article provides a fix for the issue where you try to export products to a .csv file in Magento Admin, but the file does not appear.
Affected products and versions
- Magento Commerce Cloud 2.3.2
Steps to reproduce
Prerequisites: The Add Secret Key to URLs option is set to Yes. The option is configured in the Magento Admin under Stores > Configuration > Advanced > Admin > Security.
- In the Magento Admin, navigate to System >Data Transfer >Export.
- Entity Type: Products
- Export File Format: CSV
- Field Enclosure: leave unchecked.
- Click Continue.
- The following message is displayed: "Message is added to queue, wait to get your file soon".
The .csv file with the exported products is displayed in the grid in a couple of minutes.
The .csv file with the exported products is not displayed in the grid in 10 minutes or more.
A known issue with the Export functionality in Magento application part version 2.3.2.
There are two possible solutions for the issue:
- Disable the Add Secret Key to URL option.
- Run the the
bin/magento queue:consumers:start exportProcessorcommand manually, and optionally configure it to be run by cron.
See details for both options in the following paragraphs.
Disable the the Add Secret Key to URL option
- In the Magento Admin, navigate to Stores > Configuration > Advanced > Admin > Security.
- Set the Add Secret Key to URLs option to No.
- Click Save Config.
- Clean cache under System > Tools > Cache Management or by running
bin/magento cache:cleanor in Magento Admin.
Run the export command manually and optionally add it as cron job
To get the export file, run the
bin/magento queue:consumers:start exportProcessor command. After running this, the file should be displayed in the grid.
To add the process as a cron job optionally, you must add the
CRON_CONSUMERS variable to the
Add process as a cron job (optional)
- Make sure your cron is setup and configured. See Set up cron jobs for details.
- Run the following command to return a list of message queue consumers:
- Add the following to your
.magento.env.yamlfile in the Magento
/appdirectory, and include the consumers you would like to add. For example, here is the consumer required for export processing:
Then push this updated file and redeploy your environment. Also reference Add custom cron jobs to your project.
stage: deploy: CRON_CONSUMERS_RUNNER: cron_run: true max_messages: 1000 consumers: - exportProcessor
If you cannot find the
.magento.env.yaml file for your environment, and you think it was deleted, you need to create a new
.magento.env.yaml. It might be empty initially, you can add info there as required. Reference the following Magento DevDocs articles: Build and deploy, Environment variables
On Magento Commerce Pro projects, the auto-crons feature must be enabled on your Magento Commerce Cloud project before you can add custom cron jobs to Staging and Production environments using
.magento.app.yaml. If this feature is not enabled, create a support ticket, to have the job added for you.