Laravel Vapor and Lavavel Excel queued imports failing. due to temp storage not existing Laravel 8 Vapor

Viewed 781

When I am trying to run an import that implements chunk reading and queues I am receiving the following error from the vapor queue;

ErrorException: touch(): Unable to create file /tmp/storage/framework/laravel-excel/laravel-excel-7IEEz0rP7NORtp7N4NeOxuH0hlbM9JPR.csv because No such file or directory in /var/task/vendor/maatwebsite/excel/src/Files/RemoteTemporaryFile.php:97

Documentation On Laravel Excel says to set these value in config/excel.php

https://docs.laravel-excel.com/3.1/imports/queued.html#multi-server-setup

'temporary_files' => [
        'local_path'          => storage_path('framework/laravel-excel'),        
        'remote_disk'         => 's3',       
        'force_resync_remote' => true,

My vapor yml file has the following storage set up all working fine with correct env values. for vapor and local development

storage: **correct bucket name**

Has anyone managed to get Queued imports working with Laravel Excel and Vapor, and if so how did you manage it? the documentation doesn't really explain what values I should use

1 Answers

Try to set local_path to the tmp dir in the config file

<?php

return [
    'temporary_files' => [
        'local_path' => sys_get_temp_dir(),
        ...
    ],
];
Related