The var/export folder permission issue in Adobe Commerce on Cloud

This article provides a solution to an issue where you are not able to export product data due to a file permissions issue on the server in the var/export/email folder. Symptoms include Product and Catalog exports not available in the user interface, but are visible when using SSH.

Description description

Environment

Adobe Commerce on cloud infrastructure, 2.3.0 - 2.3.7-p2, 2.4.0 - 2.4.3-p1

Issue/Symptoms

You cannot export files in the var/export/email or var/export/archive folder.
This failed deploy due to permissions on var/export/email or var/export/email/archive Because that archive folder gets created under email, and if I just do the export/email sometimes, there’s still an issue. other than adding something to account for the subfolder var/export/email/archive.

Steps to reproduce:

  1. In the Admin, go to System > Data Transfer > Export.
  2. Select the CSV files to save in the var/export/ folder.

Expected result:

CSV files are visible and can be exported.

Actual result:

CSV files are not visible. You also see a permission denied message: RecursiveDirectoryIterator::__construct(https://experienceleague.adobe.com/app/project%20id>/var/export/email?lang=en): failed to open dir: Permission denied

You receive the same message for all export types: Advanced Pricing, Customer Finances, Customer Main File, and Customer Addresses.

Root cause

This is caused by a folder created inside /var , which has imperfect permissions: d-wxrwsr-T. The T sticky bit means the users can only delete the files they own, but the missing executable means they cannot create files in the directory.

This is often noticed when the system creates a folder called export, which holds a folder called email, that holds a folder called archive.

To check if the directory has these misconfigured permissions, run the following command in the CLI/Terminal: ls -ld var/export/

The output if permissions are misconfigured will be: d-wxrwsr-T 3 web web 4096 Aug 15 19:12 var/export/

Resolution resolution

To address this, update the permissions of the folders to 777, then all the files recursively, by running the following commands:

chmod 777 var/export/chmod 777 var/export/email/chmod 777 var/export/email/archive/chmod 777 -R var/export/

Export data in the Admin Systems Guide.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f