3

I'm trying to upgrade Craft 2 -> 3.

I can install Craft 3 no problem, but when I try starting over/upgrading I'm hitting this error.

The Craft 2 site is running the latest version of Craft.

MacOS High Sierra

MAMP Pro 5.0.4

Abort, Try again, Continue Anyway

When I continue anyway I get this error:

An Error occurred while handling another error:

Stack trace:
yii\base\InvalidArgumentException: Invalid path alias: @baseUrl/ in /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php:154
#0 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Request.php(1080): yii\BaseYii::getAlias('@baseUrl/')
#1 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Request.php(167): craft\web\Request->_requestedSite(Object(craft\services\Sites))
#2 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Request->init()
#3 [internal function]: yii\base\BaseObject->__construct(Array)
#4 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#5 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Reque...', Array, Array)
#6 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Reque...', Array, Array)
#7 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/config/app.web.php(13): yii\BaseYii::createObject(Array)
#8 [internal function]: {closure}()
#9 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(503): call_user_func_array(Object(Closure), Array)
#10 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->invoke(Object(Closure), Array)
#11 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#12 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('request', true)
#13 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Application.php(333): yii\base\Module->get('request', true)
#14 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/ServiceLocator.php(74): craft\web\Application->get('request')
#15 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/web/ErrorHandler.php(499): yii\di\ServiceLocator->__get('request')
#16 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/web/ErrorHandler.php(115): yii\web\ErrorHandler->shouldRenderSimpleHtml()
#17 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/ErrorHandler.php(132): yii\web\ErrorHandler->renderException(Object(yii\base\InvalidArgumentException))
#18 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/ErrorHandler.php(111): craft\web\ErrorHandler->renderException(Object(yii\base\InvalidArgumentException))
#19 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/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: @baseUrl/ in /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php:154
Stack trace:
#0 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Request.php(1080): yii\BaseYii::getAlias('@baseUrl/')
#1 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Request.php(167): craft\web\Request->_requestedSite(Object(craft\services\Sites))
#2 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Request->init()
#3 [internal function]: yii\base\BaseObject->__construct(Array)
#4 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#5 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Reque...', Array, Array)
#6 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Reque...', Array, Array)
#7 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/config/app.web.php(13): yii\BaseYii::createObject(Array)
#8 [internal function]: {closure}()
#9 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(503): call_user_func_array(Object(Closure), Array)
#10 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->invoke(Object(Closure), Array)
#11 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#12 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('request', true)
#13 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Application.php(333): yii\base\Module->get('request', true)
#14 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/web/Application.php(160): craft\web\Application->get('request')
#15 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/helpers/App.php(371): yii\web\Application->getRequest()
#16 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/config/app.php(214): craft\helpers\App::logConfig()
#17 [internal function]: {closure}()
#18 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(503): call_user_func_array(Object(Closure), Array)
#19 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->invoke(Object(Closure), Array)
#20 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/ServiceLocator.php(137): yii\BaseYii::createObject(Object(Closure))
#21 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/Module.php(742): yii\di\ServiceLocator->get('log', true)
#22 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Application.php(333): yii\base\Module->get('log', true)
#23 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/Application.php(508): craft\web\Application->get('log')
#24 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/base/ApplicationTrait.php(1133): yii\base\Application->getLog()
#25 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Application.php(106): craft\web\Application->_preInit()
#26 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()
#27 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#28 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/src/web/Application.php(97): yii\base\Application->__construct(Array)
#29 [internal function]: craft\web\Application->__construct(Array)
#30 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#31 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#32 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#33 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/bootstrap/bootstrap.php(252): yii\BaseYii::createObject(Array)
#34 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/vendor/craftcms/cms/bootstrap/web.php(42): require('/Users/charlie....')
#35 /Users/charlie.triplett/Documents/Work/simple/Craft-3.0.26.1/web/index.php(20): require('/Users/charlie....')
#36 {main}
  • 1
    It looks like there is problem with alias settings. Look at config files in Craft 2 and 3 and find alias baseUrl. Is there any? – lenka Oct 8 '18 at 19:10
  • @lenka Yes one for my local and one for prod in my general.php config. – Charlie Triplett Oct 9 '18 at 2:49
  • @lenka And… Ohhhhhh… I've got this figured out. Thank you! – Charlie Triplett Oct 9 '18 at 2:56
  • I'm happy that you've solve it :-) – lenka Oct 9 '18 at 18:18
1

For anyone who runs into the same error, my Craft 2 site had 3 environment settings:

Dev, Staging and Production.

This page covers how to carry those settings into Craft 3 https://docs.craftcms.com/v3/config/environments.html

Thanks to @lenka for pointing me in the right direction!

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.