DevGroup-ru / yii2-http2-server-push

HTTP/2 server push support for Yii2 web application
MIT License
7 stars 4 forks source link

implode(): Invalid arguments passed #2

Closed solracsf closed 7 years ago

solracsf commented 7 years ago

I've tested it with a public project, https://github.com/humhub/humhub/ and getting 500 internal server error on some assets with

implode(): Invalid arguments passed

As result, the wall feed doesn't load.

HTTP/2.0 500 Internal Server Error
Date: Sat, 26 Nov 2016 01:28:00 GMT
Content-Type: application/json; charset=UTF-8
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: _identity=cfed1a7d979d05a8ba5c65541c6a2ace0f3ded0d7831e049c6a2cb331bfb2648a%3A2%3A%7Bi%3A0%3Bs%3A9%3A%22_identity%22%3Bi%3A1%3Bs%3A50%3A%22%5B1%2C%22bb3d7ae3-c398-4d1b-8206-acd5677a1be8%22%2C2592000%5D%22%3B%7D; expires=Mon, 26-Dec-2016 01:27:55 GMT; Max-Age=2592000; path=/; HttpOnly
strict-transport-security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Firefox-Spdy: h2
bethrezen commented 7 years ago

Can you please provide the errors in runtime logs?

solracsf commented 7 years ago
yii\base\ErrorException: implode(): Invalid arguments passed in /public/protected/vendor/devgroup/yii2-http2-server-push/src/AutomaticServerPush.php:40 Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'implode()', 'Invalid arguments passed in /public/protected/vendor/devgroup/yii2-http2-server-push/src/AutomaticServerPush.php','40', Array)
#1 /public/protected/vendor/devgroup/yii2-http2-server-push/src/AutomaticServerPush.php(40): implode(' ', NULL)
#2 [internal function]: DevGroup\ServerPush\AutomaticServerPush->DevGroup\ServerPush\{closure}(Object(yii\base\Event))
#3 /public/protected/vendor/yiisoft/yii2/base/Component.php(540): call_user_func(Object(Closure), Object(yii\base\Event))
#4 /public/protected/vendor/yiisoft/yii2/web/View.php(172): yii\base\Component->trigger('endPage')
#5 /public/protected/vendor/yiisoft/yii2/web/View.php(212): yii\web\View->endPage(true)
#6 /public/protected/vendor/yiisoft/yii2/web/Controller.php(47): yii\web\View->renderAjax('@humhub/modules...', Array, Object(humhub\modules\dashboard\controllers\DashboardController))
#7 /public/protected/humhub/modules/content/components/actions/Stream.php(265): yii\web\Controller->renderAjax('@humhub/modules...', Array, true)
#8 [internal function]: humhub\modules\content\components\actions\Stream->run()
#9 /public/protected/vendor/yiisoft/yii2/base/Action.php(92): call_user_func_array(Array, Array)
#10 /public/protected/vendor/yiisoft/yii2/base/Controller.php(154): yii\base\Action->runWithParams(Array)
#11 /public/protected/vendor/yiisoft/yii2/base/Module.php(454): yii\base\Controller->runAction('stream', Array)
#12 /public/protected/vendor/yiisoft/yii2/web/Application.php(100): yii\base\Module->runAction('dashboard/dashb...', Array)
#13 /public/protected/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(humhub\components\Request))
#14 /public/index.php(25): yii\base\Application->run()
#15 {main} 
solracsf commented 7 years ago

Any news on this?

bethrezen commented 7 years ago

@acs-ferreira Please check latest commit if it fixes your issue

solracsf commented 7 years ago

Thanks @bethrezen stream loads now, ut having some errors in the log:


yii\base\ErrorException: array_key_exists() expects parameter 2 to be array, null given in /protected/vendor/devgroup/yii2-http2-server-push/src/AutomaticServerPush.php:74

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'array_key_exist...', '/srv/users/ekin...', 74, Array)
#1 /protected/vendor/devgroup/yii2-http2-server-push/src/AutomaticServerPush.php(74): array_key_exists(1, NULL)
#2 [internal function]: DevGroup\ServerPush\AutomaticServerPush->DevGroup\ServerPush\{closure}(Object(yii\base\Event))
#3 /protected/vendor/yiisoft/yii2/base/Component.php(545): call_user_func(Object(Closure), Object(yii\base\Event))
#4 /protected/vendor/yiisoft/yii2/web/View.php(174): yii\base\Component->trigger('endPage')
#5 /protected/humhub/components/View.php(94): yii\web\View->endPage(true)
#6 /protected/humhub/components/Controller.php(64): humhub\components\View->renderAjaxContent('<div class="con...', Object(humhub\modules\admin\controllers\LoggingController))
#7 /protected/humhub/components/Controller.php(86): humhub\components\Controller->renderAjaxContent('<div class="con...')
#8 /protected/vendor/yiisoft/yii2/base/Controller.php(382): humhub\components\Controller->renderContent('<div class="con...')
#9 /protected/humhub/modules/admin/controllers/LoggingController.php(58): yii\base\Controller->render('index', Array)
#10 [internal function]: humhub\modules\admin\controllers\LoggingController->actionIndex()
#11 /protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /protected/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#13 /protected/vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('', Array)
#14 /protected/vendor/yiisoft/yii2/web/Application.php(102): yii\base\Module->runAction('admin/logging', Array)
#15 /protected/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(humhub\components\Request))
#16 /index.php(25): yii\base\Application->run() #17 {main} 
solracsf commented 7 years ago

Also, IE specific files are pushed in ALL browsers, i don't know if this can be avoided:

<!--[if IE 9]>
<link href="/static/css/ie9.css" rel="stylesheet">
<![endif]-->
<!--[if lt IE 9]>
<link href="/static/css/ie.css" rel="stylesheet">
<![endif]-->

These should be pushed ONLY on respective browsers, if possible.