0

Dear Magento developers,

I am trying to to upgrade Magento 2.1.12 CE To Magento 2.3.2 CE I followed official dev docs instructions https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html until the step :

Update the database schema and data

php bin/magento setup:upgrade

it doesnt seem to work

and it always throws the error message

    Cache cleared successfully
    File system cleanup:
/var/www/magento2/project/generated/code/Composer
    /var/www/magento2/project/generated/code/MSP
    /var/www/magento2/project/generated/code/Magento

/var/www/magento2/project/generated/code/Thirdparty1
/var/www/magento2/project/generated/code/Thirdparty2
/var/www/magento2/project/generated/code/Symfony
The directory '/var/www/magento2/project/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
PHP Fatal error:  Uncaught TypeError: Return value of Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable() must be an instance of Magento\Framework\Setup\Declaration\Schema\Dto\Table, boolean returned in /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php:251
Stack trace:
#0 /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php(148): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->processTable(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema), Array)
#1 /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/SchemaConfig.php(78): Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder->build(Object(Magento\Framework\Setup\Declaration\Schema\Dto\Schema))
#2 /var/www/magento2/project/setup/src/Magento/Setup/Model/DeclarationInstaller.php(57): Magento\Framework\Setup\Declaration\Schema\SchemaConfig->getDeclarationConfig()
#3 /var/www/ma in /var/www/magento2/project/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php on line 251

by the way if I remove app/etc/env.php I can bypasse this erreur message in web installer wizard but after that the commande still doesnt work.

thanks in advance

3
  • 1
    Do you run composer install and composer update after upgradation ?
    – user82731
    Sep 11, 2019 at 11:02
  • I did that before running the magento Commande setup:upgrade like official dev document of magento 2.3
    – lazy_coder
    Sep 12, 2019 at 15:50
  • I can edit my question but this is what I did to by base that erreur I changed return instruction return $schema->getTables()[$tableData['name']]; in method processTable() but after that the commande setup:upgrade is stock in => Module 'Magento_Catalog': SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalog_category_product_index_store1_store1' doesn't exist, query was: INSERT INTO catalog_category_product_index_store1_store1 (category_id, product_id, position, is_parent, store_id, visibility) SELECT catalog_category_product_index_store1.* ...
    – lazy_coder
    Sep 13, 2019 at 17:00

3 Answers 3

0

After Upgradation, Basically you need to do this steps such as:

Composer Install

Then you need to run

Composer Update

Then you need to set permission as

Chmod -R 777 /var /generated /pub

Then you need to set owner Group as

chown -R development:development .

Then you need to enable all the Modules or desired modules by

php bin/magento module:enable --all

Then after you need to run

php bin/magento s:up && php bin/magento s:d:c && php bin/magento s:s:d -f && php bin/magento c:c && php bin/magento c:f

Please use this sequence once.

0

Please do the following steps

Step #1:

composer require --dev allure-framework/allure-phpunit:~1.2.0 friendsofphp/php-cs-fixer:~2.13.0 lusitanian/oauth:~0.8.10 magento/magento-coding-standard:~1.0.0 magento/magento2-functional-testing-framework:~2.3.14 pdepend/pdepend:2.5.2 phpunit/phpunit:~6.5.0 sebastian/phpcpd:~3.0.0 squizlabs/php_codesniffer:3.3.1 --sort-packages --no-update

Step #2

composer remove --dev sjparkinson/static-review fabpot/php-cs-fixer --no-update

Step #3 Replace the autoload in composer.json

"autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/",
        "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
    },
    //...
}

then try the composer update, setup:upgrade and all

DevDoc reference click here

1
  • tried both solutions but still the same error message when I try to debbug method vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php::processTable() Magento breaks in table catalog_category_product_index
    – lazy_coder
    Sep 12, 2019 at 15:17
0

to fix this probleme I had to change return statement in method

vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder::proccesTable()

using this statement

return $schema->getTables()[$tableData['name']];

and I commented out all instructions in method

vendor/magento/module-catalog/Setup/Patch/Data/EnableSegmentation::apply()

Thank you,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.