Magento2: Unable to export data in System-Export in Admin (CSV file not downloaded to end user)

Created on 4 Nov 2016  路  8Comments  路  Source: magento/magento2


Preconditions


  1. Server nginx/1.10.1
  2. Magento 2 ver.2.1.0
  3. PHP 7.0 gentoo

Steps to reproduce

  1. Go to System Export in Admin.
  2. Choose any entity from dropdown, for example, 'Products'
  3. Scroll to end of page and press 'Continue'.

Expected result

  1. File is downloaded (popup window displayed, or download starts automatically).

Actual result

  1. After pressing 'Continue', downloading icon appears, "waiting for..." appears in browser, and it may last some time, and finally file not downloaded in browser. At the same time files are successfully loaded to var/ folder (catalog_product_20161027_092040.csv and importexport_eui7trbsrjfbe), but file is not loaded to end user - popup window does not appear (with proposal to open/save) or file download does not start automatically.
    BTW, it happens for all attempts to export on Export page, and on Customers->All Customers page.
    No any info in logs.
    Files are loaded to var folder with permissions: rw-r--r--.
  1. Could not reproduce the same issue on Apache. File was successfully downloaded.


checked logs for servers - all are the same.
In browser I see that correct url is formed (see below), but no any response on NGINX..

    admin/admin/export/export/key/6d72462cbaff48b1b3c5bafgab24cd201b3b51193ee2d87c18077/entity/catalog_product/file_format/csv

Checked on Ubuntu 14.04, Chrome, Firefox, Win10 Chrome.
What can be the reason of that? some server settings?

ImportExport Cannot Reproduce Format is valid bug report

Most helpful comment

Found out that the problem was in header content-length in file
\Magento\Framework\App\Response\Http\FileFactory
in method create
Temporarily fixed by making plugin for this method where I just deleted line with sending content-length header.

All 8 comments

Update:
checked that none of CSV files are downloaded with this enviroment, not only export page, but import page as well for:
'Download full report' for errors after pressing 'Check data '
and
'Download Sample File' for any entity.

Found out that the problem was in header content-length in file
\Magento\Framework\App\Response\Http\FileFactory
in method create
Temporarily fixed by making plugin for this method where I just deleted line with sending content-length header.

usuyukiso thanks, just in time !!!

@usuyukiso, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@usuyukiso
Was you using Cloudflare on your server?
The http2 on Cloudflare checks the file size, while the file size is not correct then you would be fail to download the file.

Disable http2 will do the trick

Found out that the problem was in header content-length in file
\Magento\Framework\App\Response\Http\FileFactory
in method create
Temporarily fixed by making plugin for this method where I just deleted line with sending content-length header.

I keep getting this error (Magento 2.3.3) unfortunately this didn't work.

Found out that the problem was in header content-length in file
\Magento\Framework\App\Response\Http\FileFactory
in method create
Temporarily fixed by making plugin for this method where I just deleted line with sending content-length header.

I keep getting this error (Magento 2.3.3) unfortunately this didn't work.

Might be cause of space.

Found out that the problem was in header content-length in file
\Magento\Framework\App\Response\Http\FileFactory
in method create
Temporarily fixed by making plugin for this method where I just deleted line with sending content-length header.

I keep getting this error (Magento 2.3.3) unfortunately this didn't work.

Might be cause of space.

There is enough space available on my VPS. Also, export file is a very small file.

Was this page helpful?
0 / 5 - 0 ratings