-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Temporary files are creating on one server on queued export #2796
Comments
Can you show what you are trying, can't help with this little information. |
@patrickbrouwers
this is my config file , here i am specifying a remote disk for temporary files, but temporary files are not getting stored on that disk |
Config looks good. I don't know enough about Vapor to give you pointers to debug, but perhaps your config file is cached or something. Maybe people on Laracasts/Stackoverflow will be quicker to help. |
@patrickbrouwers in my local machine also this issue is coming - temporary files are not getting stored on that disk (s3) |
Try to go through the code with xdebug/dd() there's probably something wrong in your configuration that I can't see |
@patrickbrouwers I found one case, temp files are writing on the disk, but chunk read happens, it is not taking temp file from s3, any hope ? |
@patrickbrouwers this is a similar issue like #2655 |
Try setting that force setting to true then? |
@patrickbrouwers I cannot do it. because my problem is unfortunately vapor doesn't support storing any temp files on the run. |
I believe there are se people using it on Vapor without issues |
This is the error I am getting on vapor on trying queued export ErrorException: fopen(/tmp/storage/framework/laravel-excel/laravel-excel-0KCoC8o8oDS1zsMpu927nkeCTzRgCu1E.xlsx): failed to open stream: No such file or directory in /var/task/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php:111 |
There's seems something wrong with your config still. It's not using the correct local path, it's using system's temp folder instead of Laravel's storage folder. |
@patrickbrouwers Larevel vapor uses s3 as the default storage, but laravel excel still reading from local system/server, |
@patrickbrouwers Is there a technical limitation preventing being able to read the file directly from s3? |
Yes it will always read from local after copying from s3. PhpSpreadsheet can only read from local disk |
With a correct configuration, it should work just fine |
@patrickbrouwers In vapor, there are no servers...Aws lambda is processing the whole code. So, maybe for queued excel support, we need to go to launch a server and maybe need to run as a micro instance like thing! |
I know what Vapor and serverless is. I would suggest you try Laracasts or Stackoverflow, I don't think we are getting anywhere if you don't try out my suggestions. |
I tried your suggestions and cross-checked configurations as per documentation. Also, another dependency "Laravel snappy" needs this kind of local disk support. But, this local disk case will not work in my case! So, when I contacted vapor about this case, they are suggesting to store file on s3 and re-use it. What should i do ? Hope you understand my situation! |
Other people have been able to use a local file which syncs with s3. I can't help more than this I'm sorry. Like I've suggested a few times, try a Laravel related forum. |
Here's an example of someone using queued exports with Vapor: #2434 |
I will try the above solution |
@patrickbrouwers Extremely thank you for the suggestion! Now its work like a charm! I just changed 'local_path' => sys_get_temp_dir(), Thanks for your patience & suggestions. |
@patrickbrouwers, are these temporary files created by laravel-excel will be auto deleted after particular time? What if I set this value as |
@shineraj94 can you tell what did you change? I'm using s3 for this |
heroku not working with sys_get_temp_dir() |
Same issue here on a Kubernetes cluster. I have a pod to handle API requests and another pod to process jobs using Redis and Laravel Horizon. The // config/excel.php
'temporary_files' => [
'local_path' => storage_path('framework/cache/laravel-excel'),
'remote_disk' => 's3',
'remote_prefix' => null,
'force_resync_remote' => null,
],
Any suggestions? |
I am having the same issue without queues, updated to larave 9.45 and now cannot export: |
try to change "local_path" in excel file like @shineraj94 do
|
Had same problem on kubernetes with worker and api in different pod. @egantz solution for vapor worked for us also.
|
|
Prerequisites
Versions
Description
Temporary files are creating on one server on queued export
Additional Information
Hello, I am running my application on laravel vapor (serverless). On queued exporting , the temporary files are not get stored on disk s3. I am stuck on that!
The text was updated successfully, but these errors were encountered: