-
Notifications
You must be signed in to change notification settings - Fork 289
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
Stream File Download with Octane/Swoole gives blank file #260
Comments
I don't have Sail currently installed - yet, without sail seems to work as expected when simply using |
What swoole configuration items have you set |
I've basically followed the instructions provided via Octanes github command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --watch --server=swoole --host=0.0.0.0 --port=80 |
I am sorry - but I was unable to reproduce your issue, even after following the "Steps To Reproduce" in your issue description. If other developers are facing the same issue please let me know, meanwhile I believe this must be something related to your environment/setup. |
@nunomaduro I am currently facing the same issue altough a little bit different.
I am streaming basic pdf files that come from a third party api. Assets around ~80mb gives me a 0kb "corrupt" file, where the smaller files download just as expected. return response()->streamDownload(function () use ($file_data) {
echo base64_decode($file_data['data']);
}, $file_data['file_name']); First things i tried myself before i found this issue, increasing php_memory, disabled opcache etc. with no succes. {
"masterProcessId": 1654,
"managerProcessId": 1733,
"state": {
"appName": "DEV",
"host": "127.0.0.1",
"port": "8000",
"workers": 2,
"taskWorkers": 2,
"maxRequests": "500",
"publicPath": "\/home\/forge\/DOMAIN\/public",
"storagePath": "\/home\/forge\/DOMAIN\/storage",
"defaultServerOptions": {
"buffer_output_size": 10485760,
"enable_coroutine": false,
"daemonize": false,
"log_file": "\/home\/forge\/DOMAIN\/storage\/logs\/swoole_http.log",
"log_level": 5,
"max_request": "500",
"package_max_length": 10485760,
"reactor_num": 2,
"send_yield": true,
"socket_buffer_size": 10485760,
"task_max_request": "500",
"task_worker_num": 2,
"worker_num": 2
},
"octaneConfig": {
"server": "swoole",
"https": true,
"listeners": {
"Laravel\\Octane\\Events\\WorkerStarting": [
"Laravel\\Octane\\Listeners\\EnsureUploadedFilesAreValid"
],
"Laravel\\Octane\\Events\\RequestReceived": [
"Laravel\\Octane\\Listeners\\CreateConfigurationSandbox",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToAuthorizationGate",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToBroadcastManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToDatabaseManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToHttpKernel",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToMailManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToNotificationChannelManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToPipelineHub",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToQueueManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToRouter",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToValidationFactory",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToViewFactory",
"Laravel\\Octane\\Listeners\\FlushDatabaseRecordModificationState",
"Laravel\\Octane\\Listeners\\FlushArrayCache",
"Laravel\\Octane\\Listeners\\PrepareInertiaForNextOperation",
"Laravel\\Octane\\Listeners\\PrepareScoutForNextOperation",
"Laravel\\Octane\\Listeners\\PrepareSocialiteForNextOperation",
"Laravel\\Octane\\Listeners\\FlushLocaleState",
"Laravel\\Octane\\Listeners\\FlushQueuedCookies",
"Laravel\\Octane\\Listeners\\FlushSessionState",
"Laravel\\Octane\\Listeners\\FlushAuthenticationState",
"Laravel\\Octane\\Listeners\\EnforceRequestScheme",
"Laravel\\Octane\\Listeners\\EnsureRequestServerPortMatchesScheme",
"Laravel\\Octane\\Listeners\\GiveNewRequestInstanceToApplication"
],
"Laravel\\Octane\\Events\\RequestHandled": [],
"Laravel\\Octane\\Events\\RequestTerminated": [],
"Laravel\\Octane\\Events\\TaskReceived": [
"Laravel\\Octane\\Listeners\\CreateConfigurationSandbox",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToAuthorizationGate",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToBroadcastManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToDatabaseManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToHttpKernel",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToMailManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToNotificationChannelManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToPipelineHub",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToQueueManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToRouter",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToValidationFactory",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToViewFactory",
"Laravel\\Octane\\Listeners\\FlushDatabaseRecordModificationState",
"Laravel\\Octane\\Listeners\\FlushArrayCache",
"Laravel\\Octane\\Listeners\\PrepareInertiaForNextOperation",
"Laravel\\Octane\\Listeners\\PrepareScoutForNextOperation",
"Laravel\\Octane\\Listeners\\PrepareSocialiteForNextOperation"
],
"Laravel\\Octane\\Events\\TickReceived": [
"Laravel\\Octane\\Listeners\\CreateConfigurationSandbox",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToAuthorizationGate",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToBroadcastManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToDatabaseManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToHttpKernel",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToMailManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToNotificationChannelManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToPipelineHub",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToQueueManager",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToRouter",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToValidationFactory",
"Laravel\\Octane\\Listeners\\GiveNewApplicationInstanceToViewFactory",
"Laravel\\Octane\\Listeners\\FlushDatabaseRecordModificationState",
"Laravel\\Octane\\Listeners\\FlushArrayCache",
"Laravel\\Octane\\Listeners\\PrepareInertiaForNextOperation",
"Laravel\\Octane\\Listeners\\PrepareScoutForNextOperation",
"Laravel\\Octane\\Listeners\\PrepareSocialiteForNextOperation"
],
"Laravel\\Octane\\Contracts\\OperationTerminated": [
"Laravel\\Octane\\Listeners\\FlushTemporaryContainerInstances",
"Laravel\\Octane\\Listeners\\DisconnectFromDatabases",
"Laravel\\Octane\\Listeners\\CollectGarbage"
],
"Laravel\\Octane\\Events\\WorkerErrorOccurred": [
"Laravel\\Octane\\Listeners\\ReportException",
"Laravel\\Octane\\Listeners\\StopWorkerIfNecessary"
],
"Laravel\\Octane\\Events\\WorkerStopping": []
},
"warm": [
"auth",
"cache",
"cache.store",
"config",
"cookie",
"db",
"db.factory",
"encrypter",
"files",
"hash",
"log",
"router",
"routes",
"session",
"session.store",
"translator",
"url",
"view"
],
"flush": [],
"cache": {
"rows": 1000,
"bytes": 10000
},
"tables": {
"example:1000": {
"name": "string:1000",
"votes": "int"
}
},
"watch": [
"app",
"bootstrap",
"config",
"database",
"public\/**\/*.php",
"resources\/**\/*.php",
"routes",
"composer.lock",
".env"
],
"garbage": 50,
"max_execution_time": 10
}
} Is there anybody who know how to increase the |
config/octane.php 'swoole' => [
'options' => [
],
], |
@sy-records Looks like it is a step in the right direction! Had to increase the values to a massive ammount: 'swoole' => [
'options' => [
'package_max_length' => 100000000,
'socket_buffer_size' => 100000000,
'buffer_output_size' => 100000000,
],
], The weird thing i am facing right now is that sometimes it works, and sometimes i get after around ~30mb suddenly a network error. Very strange... Currently trying to reproduce it an seperate repo to share here. |
i have setup a repo that demonstrates the problem: I also made a short clip to demonstrate: The sample files i used for testing: |
Description:
Running file downloading from remote server gives blank file (0kb) when octane is enabled.
Switching back to sail artisan server works fine – full length file is downloaded.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: