wdmg / butterfly.cms

Butterfly.CMS on Yii 2
MIT License
18 stars 6 forks source link

Migrate with error #1

Closed virbus closed 3 years ago

virbus commented 3 years ago

Снимок

alex-wdmg commented 3 years ago

Did you do initialization after cloning/creating project? Like $ cd example.com && php init

Could you attach errors installing migrations (you have migrations with errors).

virbus commented 3 years ago

Александр, добрый день. Пытаюсь установить на OpenServer, инициализацию проводил. Из 84 миграций 81 прошли успешно... Можно обратить напрямую?

alex-wdmg commented 3 years ago

Migration error fixed by wdmg/yii2-menu#1

Hi! Pls, run $ composer require wdmg/yii2-menu:1.1.1 to update "wdmg/yii2-menu" extension to 1.1.1 version and then try to run: $ php yii admin/init $ php yii admin/options/init --choice=3 $ php yii admin/users/init --choice=3 $ php yii admin/rbac/init --choice=2

You may see an Exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "admin/users/init".' after executing the command $ php yii migrate. This is normal, this is a known bug and will not affect the next steps.

-- RU Добрый день. Пожалуйста, запустите $ composer require wdmg/yii2-menu:1.1.1, чтобы обновить расширение "wdmg/yii2-menu" до версии 1.1.1, а затем пробуйте запустить: $ php yii admin/init $ php yii admin/options/init --choice=3 $ php yii admin/users/init --choice=3 $ php yii admin/rbac/init --choice=2

Вы можете увидеть Exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "admin/users/init".' после выполнения команды $ php yii migrate. Это нормально, это известная ошибка, которая не повлияет на следующие шаги.

ArtMin96 commented 3 years ago

Same error here:

Exception: Call to a member function moduleLoaded() on null (/var/www/butterflycms/vendor/wdmg/yii2-rbac/migrations/m190114_193024_rbac.php:145)

dima911 commented 2 years ago

Error!!! *** applying m190114_193024_rbac

create table {{%rbac_rules}} ... done (time: 0.006s) create table {{%rbac_roles}} ... done (time: 0.005s) add foreign key fk_auth_item_to_rules_1: {{%rbac_roles}} (rule_name) references {{%rbac_rules}} (name) ... done (time: 0.015s) create table {{%rbac_childs}} ... done (time: 0.005s) add foreign key fk_auth_item_child_to_items_1: {{%rbac_childs}} (parent) references {{%rbac_roles}} (name) ... done (time: 0.015s) add foreign key fk_auth_item_child_to_items_2: {{%rbac_childs}} (child) references {{%rbac_roles}} (name) ... done (time: 0.016s) create table {{%rbac_assignments}} ... done (time: 0.006s) add foreign key fk_auth_assignment_to_items_1: {{%rbac_assignments}} (item_name) references {{%rbac_roles}} (name) ... done (time: 0.017s) Exception: Call to a member function moduleLoaded() on null (C:\OpenServer\domains\butterfly.test\vendor\wdmg\yii2-rbac\migrations\m190114_193024_rbac.php:145)

0 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\db\Migration.php(114): m190114_193024_rbac->safeUp()

1 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(758): yii\db\Migration->up()

2 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(216): yii\console\controllers\BaseMigrateController->migrateUp('m190114193024...')

3 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)

4 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)

5 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array)

6 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Controller.php(182): yii\base\Controller->runAction('up', Array)

7 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php(552): yii\console\Controller->runAction('up', Array)

8 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('migrate/up', Array)

9 C:\OpenServer\domains\butterfly.test\vendor\wdmg\yii2-admin\commands\InitController.php(52): yii\console\Application->runAction('migrate/up', Array)

10 [internal function]: wdmg\admin\commands\InitController->actionIndex(NULL)

11 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)

12 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array)

13 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Controller.php(182): yii\base\Controller->runAction('', Array)

14 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php(552): yii\console\Controller->runAction('', Array)

15 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('admin/init', Array)

16 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('admin/init', Array)

17 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))

18 C:\OpenServer\domains\butterfly.test\yii(20): yii\base\Application->run()

19 {main}

*** failed to apply m190114_193024_rbac (time: 0.092s)

13 from 83 migrations were applied.

Migration failed. The rest of the migrations are canceled. Unknown command: admin/users/init Caused by: Exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "admin/users/init".'

in C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php:561

Stack trace:

0 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('admin/users/ini...', Array)

1 C:\OpenServer\domains\butterfly.test\vendor\wdmg\yii2-admin\commands\InitController.php(55): yii\console\Application->runAction('admin/users/ini...', Array)

2 [internal function]: wdmg\admin\commands\InitController->actionIndex(NULL)

3 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)

4 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array)

5 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Controller.php(182): yii\base\Controller->runAction('', Array)

6 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php(552): yii\console\Controller->runAction('', Array)

7 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('admin/init', Array)

8 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('admin/init', Array)

9 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))

10 C:\OpenServer\domains\butterfly.test\yii(20): yii\base\Application->run()

11 {main}

in C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php:561

Stack trace:

0 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('admin/options/i...', Array)

1 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('admin/options/i...', Array)

2 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))

3 C:\OpenServer\domains\butterfly.test\yii(20): yii\base\Application->run()

4 {main}

in C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php:561

Stack trace:

0 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('admin/users/ini...', Array)

1 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('admin/users/ini...', Array)

2 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))

3 C:\OpenServer\domains\butterfly.test\yii(20): yii\base\Application->run()

4 {main}

in C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Module.php:561

Stack trace:

0 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('admin/rbac/init', Array)

1 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('admin/rbac/init', Array)

2 C:\OpenServer\domains\butterfly.test\vendor\yiisoft\yii2\base\Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))

3 C:\OpenServer\domains\butterfly.test\yii(20): yii\base\Application->run()

4 {main}