Invalidrouteexception

Hi, This week I installed the yii2 user module of dektrium and when I am log in in and i try to logout I get this error:


exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request: site/error' in /var/www/test-site/brooice/vendor/yiisoft/yii2/base/Controller.php:139

Stack trace:

#0 /var/www/test-site/brooice/vendor/yiisoft/yii2/base/Module.php(573): yii\base\Controller->runAction('error', Array)

#1 /var/www/test-site/brooice/vendor/yiisoft/yii2/base/ErrorHandler.php(101): yii\base\Module->runAction('site/error')

#2 /var/www/test-site/brooice/vendor/yiisoft/yii2/base/ErrorHandler.php(79): yii\base\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))

#3 /var/www/test-site/brooice/vendor/yiisoft/yii2/base/Application.php(515): yii\base\ErrorHandler->handle(Object(yii\web\NotFoundHttpException))

#4 [internal function]: yii\base\Application->handleException(Object(yii\web\NotFoundHttpException))

#5 {main}

Previous exception:

exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "logout".' in /var/www/test-site/brooice/vendor/yiisoft/yii2/base/Module.php:578

Stack trace:

#0 /var/www/test-site/brooice/vendor/yiisoft/yii2/web/Application.php(85): yii\base\Module->runAction('logout', Array)

#1 /var/www/test-site/brooice/vendor/yiisoft/yii2/base/Application.php(289): yii\web\Application->handleRequest(Object(yii\web\Request))

#2 /var/www/test-site/brooice/web/index.php(13): yii\base\Application->run()

#3 {main}


Next exception 'yii\web\NotFoundHttpException' with message 'Unable to resolve the request "logout".' in /var/www/test-site/brooice/vendor/yiisoft/yii2/web/Application.php:96

Stack trace:

#0 /var/www/test-site/brooice/vendor/yiisoft/yii2/base/Application.php(289): yii\web\Application->handleRequest(Object(yii\web\Request))

#1 /var/www/test-site/brooice/web/index.php(13): yii\base\Application->run()

#2 {main}

I get this error when I try to access the pages that require the user to be logged.

I read that may be is a problem of the server with case sensitive (linux ubuntu), but i am not sure.

Somebody can help me? Thanks!

I know this is an old thread but I just encountered something like this myself, so I thought I would post the fix for anyone else that finds this via google.

All I did was put this code in my site controller file:




    public function actions() {

        return [

            'error' => [

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

            ],

        ];

    }	



More reading here: http://www.yiiframework.com/doc-2.0/guide-runtime-handling-errors.html