1

After following the instructions to upload, then upgrade alongside my installation of Craft 2, I first got a timeout error.

I am now getting the following when trying to load any page, not just /admin - and can't see where siteUrl is defined anywhere to see where I could possibly change it.

yii\base\InvalidArgumentException: Invalid path alias: @siteUrl/ in /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php:154
Stack trace:
#0 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Request.php(1080): yii\BaseYii::getAlias('@siteUrl/')
#1 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Request.php(167): craft\web\Request->_requestedSite(Object(craft\services\Sites))
#2 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Request->init()
#3 [internal function]: yii\base\BaseObject->__construct(Array)
#4 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#5 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Reque...', Array, Array)
#6 /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Reque...', Array, Array)
#7 /storage/av05061/www/public_html/vendor/craftcms/cms/src/config/app.web.php(13): yii\BaseYii::createObject(Array)
#8 [internal function]: {closure}()
#9 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(503): call_user_func_array(Object(Closure), Array)
#10 /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->invoke(Object(Closure), Array)
#11 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#12 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('request', true)
#13 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Application.php(335): yii\base\Module->get('request', true)
#14 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/ServiceLocator.php(74): craft\web\Application->get('request')
#15 /storage/av05061/www/public_html/vendor/yiisoft/yii2/web/ErrorHandler.php(499): yii\di\ServiceLocator->__get('request')
#16 /storage/av05061/www/public_html/vendor/yiisoft/yii2/web/ErrorHandler.php(115): yii\web\ErrorHandler->shouldRenderSimpleHtml()
#17 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/ErrorHandler.php(132): yii\web\ErrorHandler->renderException(Object(yii\base\InvalidArgumentException))
#18 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/ErrorHandler.php(111): craft\web\ErrorHandler->renderException(Object(yii\base\InvalidArgumentException))
#19 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/ErrorHandler.php(63): yii\base\ErrorHandler->handleException(Object(yii\base\InvalidArgumentException))
#20 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\base\InvalidArgumentException))
#21 {main}
Previous exception:
yii\base\InvalidArgumentException: Invalid path alias: @siteUrl/ in /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php:154
Stack trace:
#0 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Request.php(1080): yii\BaseYii::getAlias('@siteUrl/')
#1 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Request.php(167): craft\web\Request->_requestedSite(Object(craft\services\Sites))
#2 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Request->init()
#3 [internal function]: yii\base\BaseObject->__construct(Array)
#4 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#5 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Reque...', Array, Array)
#6 /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Reque...', Array, Array)
#7 /storage/av05061/www/public_html/vendor/craftcms/cms/src/config/app.web.php(13): yii\BaseYii::createObject(Array)
#8 [internal function]: {closure}()
#9 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(503): call_user_func_array(Object(Closure), Array)
#10 /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->invoke(Object(Closure), Array)
#11 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#12 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('request', true)
#13 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Application.php(335): yii\base\Module->get('request', true)
#14 /storage/av05061/www/public_html/vendor/yiisoft/yii2/web/Application.php(160): craft\web\Application->get('request')
#15 /storage/av05061/www/public_html/vendor/craftcms/cms/src/helpers/App.php(427): yii\web\Application->getRequest()
#16 /storage/av05061/www/public_html/vendor/craftcms/cms/src/config/app.php(223): craft\helpers\App::logConfig()
#17 [internal function]: {closure}()
#18 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(503): call_user_func_array(Object(Closure), Array)
#19 /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->invoke(Object(Closure), Array)
#20 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#21 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('log', true)
#22 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Application.php(335): yii\base\Module->get('log', true)
#23 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/Application.php(508): craft\web\Application->get('log')
#24 /storage/av05061/www/public_html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1133): yii\base\Application->getLog()
#25 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Application.php(108): craft\web\Application->_preInit()
#26 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()
#27 /storage/av05061/www/public_html/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#28 /storage/av05061/www/public_html/vendor/craftcms/cms/src/web/Application.php(99): yii\base\Application->__construct(Array)
#29 [internal function]: craft\web\Application->__construct(Array)
#30 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#31 /storage/av05061/www/public_html/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#32 /storage/av05061/www/public_html/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#33 /storage/av05061/www/public_html/vendor/craftcms/cms/bootstrap/bootstrap.php(252): yii\BaseYii::createObject(Array)
#34 /storage/av05061/www/public_html/vendor/craftcms/cms/bootstrap/web.php(42): require('/storage/av0506...')
#35 /storage/av05061/www/public_html/public/index.php(20): require('/storage/av0506...')
#36 {main}```
4

You can add:

'aliases' => [
    'siteUrl' => 'http://yoursiteurl.com',
],

To your config/general.php or use:

'aliases' => [
    'siteUrl' => getenv('DEFAULT_SITE_URL'),
],

And define DEFAULT_SITE_URL in your .env file (better way).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.