I have a problem with import/export products. When i select entity type = "Product", select my .scv file and click "Start Import". System show me error like in the picutre below. In exception.log

main.CRITICAL: Path "/var/www/html/mytheme/var/importexport//file.csv" cannot be used with directory "/var/www/html/mytheme/pub/media/" {"exception":"[object] (Magento\\Framework\\Exception\\ValidatorException(code: 0): Path \"/var/www/html/mytheme/var/importexport//file.csv\" cannot be used with directory \"/var/www/html/mytheme/pub/media/\" at /var/www/html/mytheme/vendor/magento/framework/Filesystem/Directory/PathValidator.php:63)"} []

enter image description here

I found this soultion Import/Export cannot be used with directory But it's not good for me because I have beta and production version, and in beta version import/export works well without any changes but in production i have this error. I was looking for differences between beta and production version but i have not found. Please help me.

  • I have same issue, Can you please share solutions. Thanks. Nov 9, 2021 at 10:42

1 Answer 1


Give 777 permission to /var/www/html/mytheme/var/ and /var/www/html/mytheme/var/importexport/ folder.


sudo chmod 777 -R /var/www/html/mytheme/var/ and sudo chmod 777 -R /var/www/html/mytheme/var/importexport/

  • Thanks for answear. I execute this command and it's not working. The same error is show :(
    – Mateusz
    Apr 12, 2021 at 10:18
  • is there folder name locate under /var/www/html/mytheme/var/ like 'import_history' ,'import','export' . If not then create this and flush cache,give permission to pub,var,and generated also.
    – smruti
    Apr 12, 2021 at 14:17
  • I have created export, import, import_history, importexport catalogs. I've granted permission 777 -R for var and pub folder still the same error :(
    – Mateusz
    Apr 13, 2021 at 6:54
  • Do you have any ideas?
    – Mateusz
    Apr 14, 2021 at 6:55
  • Try it . find your php.ini file; find the “upload_max_filesize” parameter (additionally, check ‘post_max_size’ too); replace the existing value with a bigger one; restart your MySQL and Apache server; reload import page
    – smruti
    Apr 14, 2021 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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