Upgrading Craft 2 to Craft 3 Yii Issues
The issue appears here

$isConsoleRequest = Craft::$app-&gt;getRequest()-&gt;getIsConsoleRequest();
if (!$isConsoleRequest &amp;&amp; !Craft::$app-&gt;getUser()-&gt;enableSession) {
    return null;
}


For whatever reasons Craft::$app-&gt;getRequest()-&gt;getIsConsoleRequest(); does not return true -> !false becomes true -> it tries to grab the user which should be an instance of craft\web\User to have the property enableSession but since it is a console request you receive craft\console\User which has not such a property.

I guess it's a bug or something