You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 29, 2019. It is now read-only.
Importing tablerates via backend fails with an error message like 'The file "/tmp/var/www/dist/var/upload/phpi1qs6p" doesn't exist' when PHP setting upload_tmp_dir is set to anything that does not relate to setting sys_temp_dir.
This is due to the first line of the private method \Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate::getCsvFile() in which a directory reader for DirectoryList::SYS_TMP is requsted.
Preconditions
Magento 2.1.11 is installed
PHP 7.0 FPM is used
Nginx is used
PHP setting upload_tmp_dir is set to a folder that does not relate to the folder defined by sys_temp_dir
Steps to reproduce
In php.ini set upload_tmp_dir to an existing folder, e.g. /var/php/upload
Leave PHP setting sys_temp_dir unconfigured such that PHP defaults it, e.g. /tmp
In Backend navigate to Stores > Configuration > Sales > Shipping Methods
Select any website as scope
Open panel Table Rates
On field Import select a file to upload
Click on Save Config to trigger import
Expected result
The tablerates should be imported
Actual result
An error message pops up, stating something like 'The file "/tmp/var/php/upload/phpi1qs6p" doesn't exist'
When looking at \Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate::getCsvFile() you'll notice the first line stating