jeudi 6 janvier 2022

/tmp/laravel-excel does not exist

so i am using laravel excel for importing .csv files and because the .csv files contain a lot of data then i running the import using laravel queue with redis driver

everything working just fine at local server at my mac using valet

but the problem occur when i tried the same code at production server at our vps that managed using runcloud

and it is only happen if i am using queue driver beside snyc. so if i change it to use database driver or redis driver then the error come.

after doing multiple debuging i find out that the error is because it can't create \tmp\ files for this plugins for doing import

to help find the key issue here is my configuration

"php": ">=7.1.3",
"maatwebsite/excel": "^3.1",
"laravel/framework": "5.6.*",
"predis/predis": "^1.1", 

and here is stacktrace from laravel.log

[2022-01-06 14:57:14] local.ERROR: File "/tmp/laravel-excel-kzUS1G2AIXnig0Z1VKs5AegK3ar98WRS.csv" does not exist. {"exception":"[object] (InvalidArgumentException(code: 0): File \"/tmp/laravel-excel-kzUS1G2AIXnig0Z1VKs5AegK3ar98WRS.csv\" does not exist. at /home/runcloud/webapps/puskopcuina/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php:137)
[stacktrace]
#0 /home/runcloud/webapps/puskopcuina/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php(152): PhpOffice\\PhpSpreadsheet\\Shared\\File::assertFile()
#1 /home/runcloud/webapps/puskopcuina/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php(540): PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader->openFile()
#2 /home/runcloud/webapps/puskopcuina/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php(349): PhpOffice\\PhpSpreadsheet\\Reader\\Csv->canRead()
#3 /home/runcloud/webapps/puskopcuina/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php(330): PhpOffice\\PhpSpreadsheet\\Reader\\Csv->loadIntoExisting()
#4 /home/runcloud/webapps/puskopcuina/vendor/maatwebsite/excel/src/Jobs/ReadChunk.php(118): PhpOffice\\PhpSpreadsheet\\Reader\\Csv->load()
#5 [internal function]: Maatwebsite\\Excel\\Jobs\\ReadChunk->handle()
#6 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array()
#7 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#8 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod()
#9 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\BoundMethod::call()
#10 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\\Container\\Container->call()
#11 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#12 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then()
#14 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\\Bus\\Dispatcher->dispatchNow()
#15 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\\Queue\\CallQueuedHandler->call()
#16 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(326): Illuminate\\Queue\\Jobs\\Job->fire()
#17 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(276): Illuminate\\Queue\\Worker->process()
#18 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\\Queue\\Worker->runJob()
#19 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\\Queue\\Worker->daemon()
#20 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#21 [internal function]: Illuminate\\Queue\\Console\\WorkCommand->handle()
#22 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array()
#23 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#24 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod()
#25 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\BoundMethod::call()
#26 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Console/Command.php(179): Illuminate\\Container\\Container->call()
#27 /home/runcloud/webapps/puskopcuina/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute()
#28 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Console/Command.php(166): Symfony\\Component\\Console\\Command\\Command->run()
#29 /home/runcloud/webapps/puskopcuina/vendor/symfony/console/Application.php(1009): Illuminate\\Console\\Command->run()
#30 /home/runcloud/webapps/puskopcuina/vendor/symfony/console/Application.php(273): Symfony\\Component\\Console\\Application->doRunCommand()
#31 /home/runcloud/webapps/puskopcuina/vendor/symfony/console/Application.php(149): Symfony\\Component\\Console\\Application->doRun()
#32 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\\Component\\Console\\Application->run()
#33 /home/runcloud/webapps/puskopcuina/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\\Console\\Application->run()
#34 /home/runcloud/webapps/puskopcuina/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#35 {m

ain} "}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire