Yii2 Debug Module - Unable To Resolve Request

Hello everyone!

I’m experiencing a problem with yii2 debug module: when i’m trying to load http://gs-test.ru/game/index, i get a message like that: “Not Found (#404): Unable to resolve the request: game/null”.

Interesting point is that after F5 debug module is loaded correctly, BUT if i select address field and hit "Enter", the problem is still there.

That problem appears only on game/index path, but controller and action themselves are passed without any errors.

There are some code parts, which could appear to be problematic (i can imagine, that the problem is with redirecting from site/index):

site/index, which is redirecting logged users to game/index




    public function actionIndex()

    {

	if(Yii::$app->user->isGuest)

	{

		return $this->render('index');

	}

	else

	{

		return $this->redirect(['/game/index']);

	}

    }



main-local config




    $config['modules']['debug'] = [

        'class' => 'yii\debug\Module',

        'allowedIPs' => ['*my ip there*'],

    ];



urlManager




        'urlManager' => [

            'enablePrettyUrl' => true,

            'showScriptName' => false,

        ],



.htaccess




RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php



Thanks for any ideas!

Eventually, I also got an error trace (i don’t know, why it appeared, i still can not repeat it):

PHP Warning ‘yii\base\ErrorException’ with message ‘array_reverse() expects parameter 1 to be array, boolean given’

in /var/www/html/gs-test.ru/vendor/yiisoft/yii2-debug/controllers/DefaultController.php:120

Stack trace:

#0 [internal function]: yii\base\ErrorHandler->handleError(2, ‘array_reverse()…’, ‘/var/www/html/g…’, 120, Array)

#1 /var/www/html/gs-test.ru/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(120): array_reverse(false, true)

#2 /var/www/html/gs-test.ru/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(135): yii\debug\controllers\DefaultController->getManifest(false)

#3 /var/www/html/gs-test.ru/vendor/yiisoft/yii2-debug/controllers/DefaultController.php(90): yii\debug\controllers\DefaultController->loadData(‘538490ed46eff’, 5)

#4 [internal function]: yii\debug\controllers\DefaultController->actionToolbar(‘538490ed46eff’)

#5 /var/www/html/gs-test.ru/vendor/yiisoft/yii2/base/InlineAction.php(54): call_user_func_array(Array, Array)

#6 /var/www/html/gs-test.ru/vendor/yiisoft/yii2/base/Controller.php(147): yii\base\InlineAction->runWithParams(Array)

#7 /var/www/html/gs-test.ru/vendor/yiisoft/yii2/base/Module.php(429): yii\base\Controller->runAction(‘toolbar’, Array)

#8 /var/www/html/gs-test.ru/vendor/yiisoft/yii2/web/Application.php(82): yii\base\Module->runAction(‘debug/default/t…’, Array)

#9 /var/www/html/gs-test.ru/vendor/yiisoft/yii2/base/Application.php(365): yii\web\Application->handleRequest(Object(yii\web\Request))

#10 /var/www/html/gs-test.ru/frontend/web/index.php(17): yii\base\Application->run()

#11 {main}

I think it should be




 $this->redirect(['game/index']);



and you should have an action inside GameController class with method "public function actionIndex(){}" without taking any params… As far as i know. Did you make any UrlRule?




'urlManager' => [

            'class' => 'yii\web\UrlManager',

            'enablePrettyUrl' => true,

            'showScriptName' => false,



I’ll try, but other redirects work fine…

No, just basic disabling of displaying index.php

Sure i do. But it is rather complicated in terms of code structure, so i decided not to insert it… moreover its content does not matter, as it is passed without errors and returns the result exactly what i expect.