Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

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

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

question from:https://stackoverflow.com/questions/65924506/laravel-vapor-and-lavavel-excel-queued-imports-failing-due-to-temp-storage-not

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Answer is to set the following in the config file

local_path' => sys_get_temp_dir(),

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...