DevGroup-ru / dotplant2

E-Commerce CMS - Yii Framework 2 (yii2, shop)
http://dotplant.ru/
Other
642 stars 251 forks source link

Ошибки при установке #304

Closed TurningTide closed 8 years ago

TurningTide commented 8 years ago

При запуске инстеллера выдается

Exception 'yii\db\Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'novapharm.user' doesn't exist

The SQL being executed was: INSERT INTO user (username, password_hash, email, auth_key, create_time, update_time) VALUES ('TurningTide', '$2y$13$nqwDheP45S/kv49Pyk/i3ej2lVp6ISCHMix5Fx.dyKp0JFnvo3zJK', 'XXXXX', '', 1462281306, 1462281306)'

При попытке запустить migrate, вываливается целая тонна ошибок типа

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/turningtide/data/www/novapharm.devonweb.ru/application/modules/core/components/MailComponent.php on line 26

:pencil2: edited by @philosoft - fix formatting

Philosoft commented 8 years ago

А версия PHP у вас какая?

судя по последним ошибкам она меньше 5.5

lifangwang commented 8 years ago

I have the same problem in execute ./installer, as following, my PHP version is 5.5.1; and I think the problem is caused by no user table created.

$ ./installer
installer is running in console
Checking permissions
[ OK ]    @app/config/db-local.php
[ OK ]    @app/config/web-local.php
[ OK ]    @app/config/common-local.php
[ OK ]    @app/config/common-configurables.php
[ OK ]    @app/config/console-configurables.php
[ OK ]    @app/config/web-configurables.php
[ OK ]    @app/config/kv-configurables.php
[ OK ]    @app/config/aliases.php
Enter language(ie. ru, zh-CN, en) [en] zh-CN
Enter your database configuration:
-> db_host [localhost]
-> db_name [dotplant2]
-> username [root] zgs_test
-> password Zgs_Test
-> schemaCacheDuration [86400]
-> schemaCache [cache]
Running migrations...
-> username [admin]
-> password 12345678
-> email [noreply@dotplant.ru] 
Exception 'yii\db\Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dotplant2.user' doesn't exist

The SQL being executed was: INSERT INTO user (username, password_hash, email, auth_key, create_time, update_time) VALUES ('admin', '$2y$13$D0QJGh1XI3quxGo0/HL`

:pencil2: edited by @philosoft - formatting fixes

Philosoft commented 8 years ago

I can get error on install with php 7, but it's

Exception 'yii\db\IntegrityException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (dp2test.auth_assignment, CONSTRAINT auth_assignment_ibfk_1 FOREIGN KEY (item_name) REFERENCES auth_item (name) ON DELETE CASCADE ON UPDATE CASCADE) The SQL being executed was: INSERT INTO auth_assignment (item_name, user_id) VALUES ('admin', '1')'

but with php 5.5.9 and php 5.6.21 I do not get any error at all. I inclined to think that it rather php <5.5.9 problem still

ilzat commented 8 years ago

выполняю: application/yii migrate --migrationPath="@app/extensions/migrations/alpha-beta/

выдает: Exception 'yii\base\UnknownPropertyException' with message 'Getting unknown property: app\modules\shop\models\Category::date_added'

что делать?

fps01 commented 8 years ago

@ilzat пришли, пожалуйста, полный вывод ошибки со стеком вызова. Так сложно локализовать проблему.

ilzat commented 8 years ago

`Администратор@ILZAT g:\openserver $ cd domains\dotplant2\application

Администратор@ILZAT g:\OpenServer\domains\dotplant2\application $ php composer.phar global require "fxp/composer-asset-plugin:~1.1.0" Could not open input file: composer.phar

Администратор@ILZAT g:\OpenServer\domains\dotplant2\application $ php ../composer.phar global require "fxp/composer-asset-plugin:~1.1.0" Changed current directory to C:/Users/└фьшэшёЄЁрЄюЁ/AppData/Roaming/Composer ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files

Администратор@ILZAT g:\OpenServer\domains\dotplant2\application $ php ../composer.phar install --prefer-dist --optimize-autoloader Loading composer repositories with package information Installing dependencies (including require-dev) from lock file

imagine/imagine suggests installing ext-gmagick (to use the Gmagick implementation) imagine/imagine suggests installing ext-imagick (to use the Imagick implementation) league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2) league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3) league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage) league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching) league/flysystem suggests installing league/flysystem-copy (Allows you to use Copy.com storage) league/flysystem suggests installing league/flysystem-dropbox (Allows you to use Dropbox storage) league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem) league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files) league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib) league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage) league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter) symfony/event-dispatcher suggests installing symfony/dependency-injection () symfony/event-dispatcher suggests installing symfony/http-kernel () guzzle/guzzle suggests installing guzzlehttp/guzzle (Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated.) egeloen/http-adapter suggests installing doctrine/cache (Allows you to use the cache event subscriber) egeloen/http-adapter suggests installing ext-http (Allows you to use the PECL adapter) egeloen/http-adapter suggests installing guzzlehttp/guzzle (Allows you to use the Guzzle 4 adapter) egeloen/http-adapter suggests installing kriswallsmith/buzz (Allows you to use the Buzz adapter) egeloen/http-adapter suggests installing nategood/httpful (Allows you to use the Httpful adapter) egeloen/http-adapter suggests installing psr/log (Allows you to use the logger event subscriber) egeloen/http-adapter suggests installing rmccue/requests (Allows you to use the Requests adapter) egeloen/http-adapter suggests installing symfony/stopwatch (Allows you to use the stopwatch http adapter and event subscriber) egeloen/http-adapter suggests installing tedivm/stash (Allows you to use the cache event subscriber) egeloen/http-adapter suggests installing zendframework/zend-http (Allows you to use the Zend 2 adapter) egeloen/http-adapter suggests installing zendframework/zendframework1 (Allows you to use the Zend 1 adapter) florianv/swap suggests installing doctrine/cache (Required to cache rates with Doctrine cache) florianv/swap suggests installing illuminate/cache (Required to cache rates with Illuminate cache) Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead. Generating optimized autoload files

yii\composer\Installer::postCreateProject chmod('config/configurables-state', 0777)...done. chmod('config/configurables-kv', 0777)...done. chmod('messages', 0777)...done. chmod('modules/seo/redirects', 0777)...done. chmod('runtime', 0777)...done. chmod('web/assets', 0777)...done. chmod('web/data', 0777)...file not found. chmod('web/upload', 0777)...done. chmod('yii', 0755)...done. chmod('web/upload/files', 0777)...done. chmod('web/upload/images', 0777)...done. chmod('web/upload/user-uploads', 0777)...done. chmod('web/files', 0777)...done. chmod('installed.mark', 0666)...done. chmod('visitors-uploaded', 0777)...done.

Администратор@ILZAT g:\OpenServer\domains\dotplant2\application $ php installer installer is running in console Checking permissions [ OK ] @app/config/db-local.php [ OK ] @app/config/web-local.php [ OK ] @app/config/common-local.php [ OK ] @app/config/common-configurables.php [ OK ] @app/config/console-configurables.php [ OK ] @app/config/web-configurables.php [ OK ] @app/config/kv-configurables.php [ OK ] @app/config/aliases.php Enter language(ie. ru, zh-CN, en) [en] Enter your database configuration: -> db_host [localhost] -> db_name [dotplant2] -> username [root] -> password -> schemaCacheDuration [86400] -> schemaCache [cache] Running migrations... -> username [admin] -> password 12345678 -> email [noreply@dotplant.ru] Exception 'yii\db\Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dotplant2.user' doesn't exist The SQL being executed was: INSERT INTO user (username, password_hash, email, auth_key, create_time, update_time) VALUES ('admin', '$2y$13$Jv2sW5i/Lh.sQlec15ol/uKhXbSZZktrdoo/eZgtidQEXdRTWRnOK', 'noreply@dotplant.ru', '', 1465403888, 1465403888)'

in G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\db\Schema.php:628

Error Info: Array ( [0] => 42S02 [1] => 1146 [2] => Table 'dotplant2.user' doesn't exist )

Stack trace:

0 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\db\Command.php(794): yii\db\Schema->convertException(Object(PDOException), 'INSERT INTO `us...')

1 G:\OpenServer\domains\dotplant2\application\modules\installer\components\InstallerHelper.php(136): yii\db\Command->execute()

2 G:\OpenServer\domains\dotplant2\application\modules\installer\commands\InstallController.php(162): app\modules\installer\components\InstallerHelper::createAdminUser(Object(app\modules\installer\models\AdminUser), Object(yii\db\Connection))

3 G:\OpenServer\domains\dotplant2\application\modules\installer\commands\InstallController.php(139): app\modules\installer\commands\InstallController->adminUser()

4 G:\OpenServer\domains\dotplant2\application\modules\installer\commands\InstallController.php(110): app\modules\installer\commands\InstallController->migration()

5 G:\OpenServer\domains\dotplant2\application\modules\installer\commands\InstallController.php(66): app\modules\installer\commands\InstallController->dbConfig()

6 G:\OpenServer\domains\dotplant2\application\modules\installer\commands\InstallController.php(56): app\modules\installer\commands\InstallController->language()

7 [internal function]: app\modules\installer\commands\InstallController->actionIndex() #8 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_array(Array, Array)

9 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Controller.php(154): yii\base\InlineAction->runWithParams(Array)

10 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\Controller.php(119): yii\base\Controller->runAction('index', Array)

11 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Module.php(454): yii\console\Controller->runAction('index', Array)

12 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\Application.php(175): yii\base\Module->runAction('', Array)

13 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\Application.php(143): yii\console\Application->runAction('', Array)

14 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))

15 G:\OpenServer\domains\dotplant2\application\installer(22): yii\base\Application->run()

16 {main}

Администратор@ILZAT g:\OpenServer\domains\dotplant2\application $ yii migrate --migrationPath="@app/extensions/migrations/alpha-beta/ Yii Migration Tool (based on Yii v2.0.8-dev)

Creating migration history table "migration"...Done. Total 98 new migrations to be applied: m141023_084857_init m141024_123832_seo_module m141024_133439_background_tasks m141117_102416_backend_menu m141118_151553_PlatronPayment m141119_125348_column_properties m141121_094906_data m141125_084200_data_backend_menu_fix m141125_124907_background_tasks_status_fix m141201_114400_product_listing_sort m141203_130945_fileinput m141211_111556_default_view_fix m141211_113001_product_storage m141212_144327_backend_category_group m141215_091048_property_dont_filter m141216_084809_psv_dont_filter m141216_111515_slider m141222_151034_slider_backend_menu_item m141224_085939_hidden_property m150112_112140_prefiltered_pages m150125_171501_cart_additional_options m150129_125119_related_products m150202_084157_page_subdomains m150203_085736_yml_menu m150209_225849_dynamic_content_default_block m150211_072044_page_name m150211_183713_quantity_to_float m150216_121527_deleting_append_fields_in_DC m150217_134007_configuratble_dynagrid m150218_091236_currency m150224_081305_currencies_backend_menu m150226_102422_reviews_menu m150226_142612_BackendMenu_data_fix m150228_090542_multiple_warehouses m150228_135050_indexes m150306_110612_Cbr m150317_070330_backgroundtasks_task_add_options m150319_143410_ratings m150320_080911_eav_property_group_id_add m150326_103656_property_image m150326_124151_redactor m150330_083706_clear_old_notify m150330_124558_submission_delete m150331_122028_clear_span_submissions_bgtask m150403_101144_config_value_type_change m150403_123614_spamchecker_model m150408_083957_rateItem_add_guest_column m150408_092420_backend_menu_ratings m150408_092905_social_refactoring m150408_140510_submission_clear m150409_091229_backend_menu_translate m150409_202926_configurables m150413_094340_thumbnail m150414_123604_ContentBlock m150415_095657_delete_order_field m150416_065047_content_decorators m150416_112238_social_refactoring_2 m150420_131507_backendMenu_chunk_add m150422_105109_hard_deleting m150424_143926_shop_module m150425_105123_event_system m150428_120959_page_move m150428_132852_extensions m150430_084230_commerceml m150505_063319_configurable_seo_module m150506_133039_review_module m150507_064204_new_order m150508_073233_core_configurable m150508_084640_review_move m150512_060716_data_module_move m150512_094543_discount m150512_135841_db_robots_txt m150512_140932_extensions_remove_packagist_name m150513_122524_special_price m150514_101123_discount_type_add_view m150514_114054_alterReview m150514_130440_filter_sets m150515_141224_order_customers m150518_065023_measure m150519_120719_spetial_price_order m150520_100305_move_backend_controllers m150522_085644_order_calculate_event m150522_145259_price_list_object_description m150525_081808_order_calculate_handler_delivery m150525_121001_discount_menu m150526_054233_promocode_order_table m150526_110621_backend_configurable m150526_140709_default_theme m150527_082037_warehouseBackendMenu m150531_084444_new_init m150531_134103_theme_part_improvements m150531_170721_final_stage m150601_111734_order_in_cart m150602_095853_openGraphObject m150603_104416_submission_spam m150603_143456_removing_config m150604_065422_backend_menu_changes m150604_090235_delete_order_special_type

Apply the above migrations? (yes|no) [no]:yes *\ applying m141023_084857_init

create table {{%api_service}} ... done (time: 0.159s) create table {{%session}} ... done (time: 0.162s) create table {{%image}} ... done (time: 0.189s) create table {{%navigation}} ... done (time: 0.208s) create table {{%dynamic_content}} ... done (time: 0.147s) create table {{%object}} ... done (time: 0.169s) create table {{%object_property_group}} ... done (time: 0.161s) create table {{%object_static_values}} ... done (time: 0.166s) create table {{%property_group}} ... done (time: 0.151s) create table {{%property_handler}} ... done (time: 0.139s) create table {{%property_static_values}} ... done (time: 0.166s) create table {{%product_category_full_slug}} ... done (time: 0.171s) create table {{%product_static_value_full_slug}} ... done (time: 0.155s) create table {{%product_eav}} ... done (time: 0.659s) create table {{%route}} ... done (time: 0.273s) create table {{%property}} ... done (time: 0.273s) create table {{%product}} ... done (time: 0.249s) create table {{%product_property}} ... done (time: 0.157s) create table {{%layout}} ... done (time: 0.156s) create table {{%view}} ... done (time: 0.151s) create table {{%view_object}} ... done (time: 0.151s) create table {{%page}} ... done (time: 1.499s) create table {{%page_property}} ... done (time: 0.238s) create table {{%page_category}} ... done (time: 0.232s) create table {{%page_eav}} ... done (time: 0.232s) create table {{%category_group}} ... done (time: 0.317s) create table {{%category}} ... done (time: 0.299s) create table {{%category_eav}} ... done (time: 0.298s) create table {{%property_category}} ... done (time: 0.334s) create table {{%product_category}} ... done (time: 0.288s) create table {{%category_group_route_templates}} ... done (time: 0.290s) create table {{%subscribe_email}} ... done (time: 0.222s) create table {{%order}} ... done (time: 1.013s) create table {{%order_item}} ... done (time: 0.238s) create table {{%order_transaction}} ... done (time: 0.272s) create table {{%order_chat}} ... done (time: 0.256s) create table {{%shipping_option}} ... done (time: 0.247s) create table {{%payment_type}} ... done (time: 0.288s) create table {{%order_property}} ... done (time: 0.232s) create table {{%order_eav}} ... done (time: 0.251s) create table {{%order_category}} ... done (time: 0.240s) create table {{%form}} ... done (time: 0.232s) create table {{%form_eav}} ... done (time: 0.295s) create table {{%form_property}} ... done (time: 0.158s) create table {{%submission}} ... done (time: 0.169s) create table {{%submission_property}} ... done (time: 0.219s) create table {{%submission_category}} ... done (time: 0.223s) create table {{%submission_eav}} ... done (time: 0.258s) create table {{%notification}} ... done (time: 0.247s) create table {{%review}} ... done (time: 0.255s) create table {{%error_log}} ... done (time: 0.231s) create table {{%error_url}} ... done (time: 0.239s) create table {{%auth_rule}} ... done (time: 0.240s) create table {{%auth_item}} ... done (time: 0.333s) create table {{%auth_item_child}} ... done (time: 0.257s) create table {{%auth_assignment}} ... done (time: 0.281s) create table {{%user}} ... done (time: 0.194s) create table {{%user_service}} ... done (time: 0.198s) create table {{%user_property}} ... done (time: 0.150s) create table {{%user_eav}} ... done (time: 0.170s) create table {{%user_category}} ... done (time: 0.192s) insert into {{%object}} ... done (time: 0.036s) insert into {{%object}} ... done (time: 0.007s) insert into {{%route}} ... done (time: 0.067s) insert into {{%property_handler}} ... done (time: 0.068s) insert into {{%layout}} ... done (time: 0.157s) insert into {{%view}} ... done (time: 0.399s) insert into {{%page}} ... done (time: 0.095s) insert into {{%category_group}} ... done (time: 0.043s) insert into {{%category}} ... done (time: 0.123s) insert into {{%shipping_option}} ... done (time: 0.050s) insert into {{%payment_type}} ... done (time: 0.050s) insert into {{%object}} ... done (time: 0.007s) insert into {{%property_group}} ... done (time: 0.107s) insert into {{%property}} ... done (time: 0.070s) insert into {{%object}} ... done (time: 0.046s) insert into {{%object}} ... done (time: 0.008s) insert into {{%property_group}} ... done (time: 0.015s) insert into {{%navigation}} ... done (time: 0.059s) Enter admin username (3 or more chars): admin Enter admin email: as@as.as Enter admin password (8 or more chars): 12345678 Confirm admin password: 12345678 Install Russian translations? [y/N] y insert into {{%auth_item}} ... done (time: 0.014s) insert into {{%auth_item_child}} ... done (time: 0.037s) insert into {{%auth_assignment}} ... done (time: 0.031s) Do you want to install demo data [y/n]: y INFO: Installing demo data Exception 'yii\base\UnknownPropertyException' with message 'Getting unknown property: app\modules\shop\models\Category::date_added'

in G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Component.php:143

Stack trace:

0 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\db\BaseActiveRecord.php(247): yii\base\Component->__get('date_added')

1 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\validators\Validator.php(240): yii\db\BaseActiveRecord->__get('date_added')

2 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Model.php(356): yii\validators\Validator->validateAttributes(Object(app\modules\shop\models\Category), Array)

3 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\db\ActiveRecord.php(527): yii\base\Model->validate(NULL)

4 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\db\BaseActiveRecord.php(595): yii\db\ActiveRecord->update(true, NULL)

5 G:\OpenServer\domains\dotplant2\application\extensions\migrations\alpha-beta\m141023_084857_init.php(1598): yii\db\BaseActiveRecord->save()

6 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(562): m141023_084857_init->up()

7 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(151): yii\console\controllers\BaseMigrateController->migrateUp('m141023084857...')

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

9 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_array(Array, Array)

10 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Controller.php(154): yii\base\InlineAction->runWithParams(Array)

11 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\Controller.php(119): yii\base\Controller->runAction('', Array)

12 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Module.php(454): yii\console\Controller->runAction('', Array)

13 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\Application.php(175): yii\base\Module->runAction('migrate', Array)

14 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\console\Application.php(143): yii\console\Application->runAction('migrate', Array)

15 G:\OpenServer\domains\dotplant2\application\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))

16 G:\OpenServer\domains\dotplant2\application\yii(22): yii\base\Application->run()

17 {main}

Администратор@ILZAT g:\OpenServer\domains\dotplant2\application`

php 5.6, mysql 5.6

ivansal commented 8 years ago

Так у вас всё в первый раз упало на моменте установки. Попробуйте очистить базу и начать установку через веб-морду http://dotplant.dev/installer.php Так же если это новая установка, нет необходимости запускать миграции alpha-beta тк они писались для переноса старых баз DP2 на новую структуру

ivansal commented 8 years ago

Проверили полностью установку с 0 даже в строгом режиме, ошибок нет. Позже проверю на винде, отпишу результат

ilzat commented 8 years ago

Через веб морду получилось! спасибо!

ivansal commented 8 years ago

Спасибо за обратную связь!

cookiesze commented 8 years ago

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dotplant2.configurable' doesn't exist The SQL being executed was: SELECT * FROM configurable

plz Help T T

bethrezen commented 8 years ago

@cookiesze try cleaning your db and run console installing again

cookiesze commented 8 years ago

Thk @bethrezen

cookiesze commented 8 years ago

error yii2\db\Schema.php:628

return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e);

bethrezen commented 8 years ago

@cookiesze Just follow the docs instruction exactly as it is represented. If you have problems - ask in gitter chat or create a separate issue with FULL trace logs. Also, you need good yii2 knowledge to use this. If you don't know it - proceed to some another CMS

cookiesze commented 8 years ago

Thk @bethrezen I don sprack english But I'm trying to learn, I'm sorry to disturb you.