Skip to content
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

take one more new exception #3120

Closed
artemzakholodilo opened this issue Apr 16, 2014 · 7 comments
Closed

take one more new exception #3120

artemzakholodilo opened this issue Apr 16, 2014 · 7 comments

Comments

@artemzakholodilo
Copy link

exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request: site/error' in /var/www/yiidir/vendor/yiisoft/yii2/base/Controller.php:119
Stack trace:
#0 /var/www/yiidir/vendor/yiisoft/yii2/base/Module.php(423): yii\base\Controller->runAction('error', Array)
#1 /var/www/yiidir/vendor/yiisoft/yii2/web/ErrorHandler.php(78): yii\base\Module->runAction('site/error')
#2 /var/www/yiidir/vendor/yiisoft/yii2/base/ErrorHandler.php(85): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#3 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#4 {main}

Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "index.php/userforms/addoutputform".' in /var/www/yiidir/vendor/yiisoft/yii2/base/Module.php:429
Stack trace:
#0 /var/www/yiidir/vendor/yiisoft/yii2/web/Application.php(82): yii\base\Module->runAction('index.php/userf...', Array)
#1 /var/www/yiidir/vendor/yiisoft/yii2/base/Application.php(353): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 /var/www/yiidir/web/index.php(12): yii\base\Application->run()
#3 {main}

Next exception 'yii\web\NotFoundHttpException' with message 'Unable to resolve the request "index.php/userforms/addoutputform".' in /var/www/yiidir/vendor/yiisoft/yii2/web/Application.php:94
Stack trace:
#0 /var/www/yiidir/vendor/yiisoft/yii2/base/Application.php(353): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 /var/www/yiidir/web/index.php(12): yii\base\Application->run()
#2 {main}

three days ago all be ok

@kshitizsingh
Copy link
Contributor

i am getting the following error. How to solve this?

exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' in /home/kshitiz/www/manage/vendor/yiisoft/yii2/base/Module.php:461
Stack trace:
#0 /home/kshitiz/www/manage/vendor/yiisoft/yii2/web/ErrorHandler.php(79): yii\base\Module->runAction('site/error')
#1 /home/kshitiz/www/manage/vendor/yiisoft/yii2/base/ErrorHandler.php(95): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#2 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#3 {main}
Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "gii".' in /home/kshitiz/www/manage/vendor/yiisoft/yii2/base/Module.php:461
Stack trace:
#0 /home/kshitiz/www/manage/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction('gii', Array)
#1 /home/kshitiz/www/manage/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 /home/kshitiz/www/manage/frontend/web/index.php(14): yii\base\Application->run()
#3 {main}

Next exception 'yii\web\NotFoundHttpException' with message 'Unable to resolve the request "gii".' in /home/kshitiz/www/manage/vendor/yiisoft/yii2/web/Application.php:95
Stack trace:
#0 /home/kshitiz/www/manage/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 /home/kshitiz/www/manage/frontend/web/index.php(14): yii\base\Application->run()
#2 {main}

@cebe
Copy link
Member

cebe commented Nov 4, 2014

You have configured an action to be called on error somewhere in your config but that action does not exist. search your config for site/error

@kshitizsingh
Copy link
Contributor

In my frontend/config/main.php file i have

'components' => [
    .......................................
    'urlManager' => [
        'enablePrettyUrl' => true,
        'showScriptName' => false,
   ],
   'errorHandler' => [
        'errorAction' => 'site/error',
    ],
    .......................................
]

and in frontend/controller/SiteController.php

/**
 * @inheritdoc
 */
public function actions()
{
    return [
        'error' => [
            'class' => 'yii\web\ErrorAction',
        ],
    ];
}

and in views/site i have error.php file

<?php

use yii\helpers\Html;

/**
 * @var yii\web\View $this
 * @var string $name
 * @var string $message
 * @var Exception $exception
 */

$this->title = $name;
?>
<div class="site-error">

    <h1><?= Html::encode($this->title) ?></h1>

    <div class="alert alert-danger">
        <?= nl2br(Html::encode($message)) ?>
    </div>

    <p>
        The above error occurred while the Web server was processing your request.
    </p>
    <p>
        Please contact us if you think this is a server error. Thank you.
    </p>

</div>

My .htaccess file

RewriteEngine on

# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php

I am using nginx, PHP 5.6.2 and mariadb on arch linux.
What i am missing?

@cebe
Copy link
Member

cebe commented Nov 5, 2014

from what you have posted I can not see any problems...

@naveenksingh
Copy link

facing the same issue
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request: site/error' in /var/www/html/vendor/yiisoft/yii2/base/Controller.php:122
do you have any solution

@cebe
Copy link
Member

cebe commented May 26, 2016

do you have a stack trace of the error?

@timbreitscheit54
Copy link

timbreitscheit54 commented Nov 29, 2017

`An Error occurred while handling another error:
yii\base\InvalidRouteException: Unable to resolve the request: site/error in /var/www/html/vendor/yiisoft/yii2/base/Controller.php:128
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('error', Array)
#1 /var/www/html/vendor/yiisoft/yii2/web/ErrorHandler.php(97): yii\base\Module->runAction('site/error')
#2 /var/www/html/vendor/yiisoft/yii2/base/ErrorHandler.php(111): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#3 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#4 {main}
Previous exception:
yii\base\InvalidRouteException: Unable to resolve the request: site/login in /var/www/html/vendor/yiisoft/yii2/base/Controller.php:128
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('login', Array)
#1 /var/www/html/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('site/login', Array)
#2 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#3 /var/www/html/frontend/web/index.php(17): yii\base\Application->run()
#4 {main}

Next yii\web\NotFoundHttpException: Page not found. in /var/www/html/vendor/yiisoft/yii2/web/Application.php:115
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 /var/www/html/frontend/web/index.php(17): yii\base\Application->run()
#2 {main}`

in advanced template, this appears in front-end after mistakenly naming a new data table = "site" which over wrote the view/site, i put back the original files, including error, from a backup but still seeing this error... no idea where to look pls help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants