<p>Looks like you have a plugin called <code>core</code> that is not handling console requests properly.</p>

<pre><code>#3 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/base/Plugin.php(130): yii\base\Module-&gt;__construct('core', Object(craft\console\Application), Array)
</code></pre>

CC BY-SA 4.0
2019-12-03T13:16:27.823Z
Thank you for that suggestion, looks like I was checking a request segment in my custom plugin and there is no request on a console command, makes sense.
Commenting out the bit of code sorted it out.
José Veríssimo
CC BY-SA 4.0
2019-12-03T12:52:10.687Z
2019-12-03T12:52:10.687Z
andrew.welch
<p>When I attempt to run any <code>./craft</code> it throws an error, for example:</p>

<pre><code>$ ./craft resave/entries
Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Request::getSegment()'

in /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/Component.php:300

Stack trace:
#0 /var/www/examplewebsite.co.uk/plugins/core/src/Core.php(97): yii\base\Component-&gt;__call('getSegment', Array)
#1 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/BaseObject.php(109): cursor\core\Core-&gt;init()
#2 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject-&gt;__construct(Array)
#3 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/base/Plugin.php(130): yii\base\Module-&gt;__construct('core', Object(craft\console\Application), Array)
#4 [internal function]: craft\base\Plugin-&gt;__construct('core', Object(craft\console\Application), Array)
#5 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass-&gt;newInstanceArgs(Array)
#6 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container-&gt;build('cursor\\core\\Cor...', Array, Array)
#7 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container-&gt;get('cursor\\core\\Cor...', Array, Array)
#8 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/services/Plugins.php(897): yii\BaseYii::createObject(Array, Array)
#9 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/services/Plugins.php(230): craft\services\Plugins-&gt;createPlugin('core', Array)
#10 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/base/ApplicationTrait.php(1375): craft\services\Plugins-&gt;loadPlugins()
#11 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/console/Application.php(65): craft\console\Application-&gt;_postInit()
#12 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application-&gt;init()
#13 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject-&gt;__construct(Array)
#14 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application-&gt;__construct(Array)
#15 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/console/Application.php(54): yii\console\Application-&gt;__construct(Array)
#16 [internal function]: craft\console\Application-&gt;__construct(Array)
#17 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass-&gt;newInstanceArgs(Array)
#18 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container-&gt;build('craft\\console\\A...', Array, Array)
#19 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container-&gt;get('craft\\console\\A...', Array, Array)
#20 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/bootstrap/bootstrap.php(244): yii\BaseYii::createObject(Array)
#21 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/bootstrap/console.php(34): require('/var/www/examplewebsite.c...')
#22 /var/www/examplewebsite.co.uk/craft(21): require('/var/www/examplewebsite.c...')
#23 {main}
</code></pre>

<p>Any suggestions on what I need to do? I'm on the latest version of CraftCMS and also am using PHP7.2.</p>

<p>Thank you!</p>

CC BY-SA 4.0
2019-12-03T10:32:54.923Z
Just to be sure, you're on the newest craft cms 3, right? Because v2 doesn't have the ./craft file functionality. (Actually, can you just add the craft version which is in the craft's Info.php file into the reply comment? Thanks!)
Campiotti
CC BY-SA 4.0
2019-12-03T11:26:50.907Z
@Campiotti Yes I am using Craft CMS 3, the exact version number is Craft CMS 3.3.16.3
José Veríssimo
<error><createcommand>
Any ./craft command throws error
# Any ./craft command throws error

(Asked by: username_0 on 2019-12-03)

When I attempt to run any ./craft it throws an error, for example:
$ ./craft resave/entries
Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Request::getSegment()'

in /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/Component.php:300

Stack trace:
#0 /var/www/examplewebsite.co.uk/plugins/core/src/Core.php(97): yii\base\Component->__call('getSegment', Array)
#1 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/BaseObject.php(109): cursor\core\Core->init()
#2 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject->__construct(Array)
#3 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/base/Plugin.php(130): yii\base\Module->__construct('core', Object(craft\console\Application), Array)
#4 [internal function]: craft\base\Plugin->__construct('core', Object(craft\console\Application), Array)
#5 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)
#6 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('cursor\\core\\Cor...', Array, Array)
#7 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->get('cursor\\core\\Cor...', Array, Array)
#8 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/services/Plugins.php(897): yii\BaseYii::createObject(Array, Array)
#9 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/services/Plugins.php(230): craft\services\Plugins->createPlugin('core', Array)
#10 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/base/ApplicationTrait.php(1375): craft\services\Plugins->loadPlugins()
#11 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/console/Application.php(65): craft\console\Application->_postInit()
#12 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#13 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#14 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#15 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/console/Application.php(54): yii\console\Application->__construct(Array)
#16 [internal function]: craft\console\Application->__construct(Array)
#17 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)
#18 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\\console\\A...', Array, Array)
#19 /var/www/examplewebsite.co.uk/vendor/yiisoft/yii2/BaseYii.php(351): yii\di\Container->get('craft\\console\\A...', Array, Array)
#20 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/bootstrap/bootstrap.php(244): yii\BaseYii::createObject(Array)
#21 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/bootstrap/console.php(34): require('/var/www/examplewebsite.c...')
#22 /var/www/examplewebsite.co.uk/craft(21): require('/var/www/examplewebsite.c...')
#23 {main}

Any suggestions on what I need to do? I'm on the latest version of CraftCMS and also am using PHP7.2.
Thank you!

**Tags:** error, createcommand

> **Comments:**
> **username_1**: Just to be sure, you're on the newest craft cms 3, right? Because v2 doesn't have the ./craft file functionality. (Actually, can you just add the craft version which is in the craft's Info.php file into the reply comment? Thanks!)  
> **username_0**: @username_1 Yes I am using Craft CMS 3, the exact version number is Craft CMS 3.3.16.3  

---

## 1 answers

### Answer by username_2 on 2019-12-03. Score: 1 | Accepted answer

Looks like you have a plugin called core that is not handling console requests properly.
#3 /var/www/examplewebsite.co.uk/vendor/craftcms/cms/src/base/Plugin.php(130): yii\base\Module->__construct('core', Object(craft\console\Application), Array)

> **Comments:**
> **username_0**: Thank you for that suggestion, looks like I was checking a request segment in my custom plugin and there is no request on a console command, makes sense. Commenting out the bit of code sorted it out.  

---

