magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Magento upgrade from 2.0.5 to 2.1.0 via Command Line throws LocalizedException error

Open malaiselvan opened this issue 10 years ago • 4 comments

Hi Magento,

Faced issue while upgrading from 2.0.5 to 2.1.0. Raised this as a new issue because I feel it is slightly different from the issue #5236

Following are the steps I followed

Step 1: Updated the source via composer and got an error as below

abcdnet@a2ss26 [~/public_html]# composer require magento/product-community-edition 2.1.0 --no-update
abcdnet@a2ss26 [~/public_html]# composer update

abcdnet@a2ss26 [~/public_html]# bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/home/abcdnet/public_html/var/generation/Composer
/home/abcdnet/public_html/var/generation/Magento
/home/abcdnet/public_html/var/generation/Symfony
The directory '/home/abcdnet/public_html/var/di/' doesn't exist - skipping cleanup
/home/abcdnet/public_html/pub/static/_requirejs
/home/abcdnet/public_html/pub/static/adminhtml
/home/abcdnet/public_html/pub/static/deployed_version.txt
/home/abcdnet/public_html/pub/static/frontend
/home/abcdnet/public_html/var/view_preprocessed/css
/home/abcdnet/public_html/var/view_preprocessed/html
/home/abcdnet/public_html/var/view_preprocessed/source
Updating modules:
Schema creation/updates:
Module 'Magento_Store':
Module 'Magento_AdminNotification':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Theme':
Module 'Magento_Backend':
Module 'Magento_Backup':
Module 'Magento_Eav':
Module 'Magento_Customer':
Upgrading schema..
Module 'Magento_BundleImportExport':
Module 'Magento_CacheInvalidate':
Module 'Magento_Indexer':
Module 'Magento_Cms':
Upgrading schema..
Module 'Magento_CatalogImportExport':
Module 'Magento_Catalog':
Upgrading schema..
Module 'Magento_Rule':
Module 'Magento_Payment':
Module 'Magento_Search':
Upgrading schema..
Module 'Magento_CatalogUrlRewrite':
Module 'Magento_Widget':
Module 'Magento_Quote':
Module 'Magento_CheckoutAgreements':
Module 'Magento_SalesSequence':
Module 'Magento_CmsUrlRewrite':
Module 'Magento_Config':
Module 'Magento_ConfigurableImportExport':
Module 'Magento_Msrp':
Module 'Magento_Contact':
Module 'Magento_Cookie':
Module 'Magento_Cron':
Module 'Magento_CurrencySymbol':
Module 'Magento_Bundle':
Upgrading schema..
Module 'Magento_CustomerImportExport':
Module 'Magento_Deploy':
Module 'Magento_Developer':
Module 'Magento_Dhl':
Module 'abcd_Topmenu':
Module 'Magento_Downloadable':
Module 'Magento_ImportExport':
Module 'Magento_Sales':
Upgrading schema..
Module 'Magento_Email':
Module 'Magento_User':
Module 'Magento_Fedex':
Module 'Magento_GiftMessage':
Module 'Magento_CatalogInventory':
Module 'Magento_GoogleAnalytics':
Module 'Magento_Ui':
Module 'Magento_GroupedImportExport':
Module 'Magento_GroupedProduct':
Module 'Magento_DownloadableImportExport':
Module 'Magento_Checkout':
Module 'Magento_Security':
Module 'Magento_LayeredNavigation':
Module 'Magento_Marketplace':
Module 'Magento_MediaStorage':
Module 'Magento_CatalogRule':
Upgrading schema..
Module 'Magento_Multishipping':
Module 'Magento_ConfigurableProduct':
Module 'Magento_Newsletter':
Module 'Magento_OfflinePayments':
Module 'Magento_SalesRule':
Upgrading schema..
Module 'Magento_PageCache':
Module 'Magento_Captcha':
Module 'Magento_Vault':
Module 'Magento_Persistent':
Module 'Magento_ProductAlert':
Module 'Magento_ProductVideo':
Module 'Magento_Authorizenet':
Module 'Magento_Reports':
Module 'Magento_RequireJs':
Module 'Magento_Rss':
Module 'Magento_CatalogRuleConfigurable':
Module 'Magento_Paypal':
Module 'Magento_OfflineShipping':
Module 'Magento_GoogleAdwords':
Module 'Magento_SampleData':
Module 'Magento_CatalogSearch':
Module 'Magento_Integration':
Module 'Magento_SendFriend':
Module 'Magento_Shipping':
Module 'Magento_Sitemap':
Module 'Magento_Authorization':
Module 'Magento_Swagger':
Module 'Magento_Swatches':
Module 'Magento_SwatchesLayeredNavigation':
Module 'Magento_Tax':
Module 'Magento_TaxImportExport':
Module 'Magento_NewRelicReporting':
Module 'Magento_Translation':
Module 'Magento_GoogleOptimizer':
Module 'Magento_Ups':
Module 'Magento_UrlRewrite':
Module 'Magento_EncryptionKey':
Module 'Magento_Usps':
Module 'Magento_Variable':
Module 'Magento_Braintree':
Module 'Magento_Version':
Module 'Magento_Webapi':
Module 'Magento_WebapiSecurity':
Module 'Magento_Weee':
Module 'Magento_CatalogWidget':
Module 'Magento_Wishlist':
Schema post-updates:
Module 'Magento_Store':
Module 'Magento_AdminNotification':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Theme':
Module 'Magento_Backend':
Module 'Magento_Backup':
Module 'Magento_Eav':
Module 'Magento_Customer':
Module 'Magento_BundleImportExport':
Module 'Magento_CacheInvalidate':
Module 'Magento_Indexer':
Running schema recurring...
Module 'Magento_Cms':
Module 'Magento_CatalogImportExport':
Module 'Magento_Catalog':
Running schema recurring...
Module 'Magento_Rule':
Module 'Magento_Payment':
Module 'Magento_Search':
Module 'Magento_CatalogUrlRewrite':
Running schema recurring...
Module 'Magento_Widget':
Module 'Magento_Quote':
Running schema recurring...
Module 'Magento_CheckoutAgreements':
Module 'Magento_SalesSequence':
Module 'Magento_CmsUrlRewrite':
Module 'Magento_Config':
Module 'Magento_ConfigurableImportExport':
Module 'Magento_Msrp':
Module 'Magento_Contact':
Module 'Magento_Cookie':
Module 'Magento_Cron':
Module 'Magento_CurrencySymbol':
Module 'Magento_Bundle':
Running schema recurring...
Module 'Magento_CustomerImportExport':
Module 'Magento_Deploy':
Module 'Magento_Developer':
Module 'Magento_Dhl':
Module 'abcd_Topmenu':
Module 'Magento_Downloadable':
Module 'Magento_ImportExport':
Module 'Magento_Sales':
Module 'Magento_Email':
Module 'Magento_User':
Module 'Magento_Fedex':
Module 'Magento_GiftMessage':
Module 'Magento_CatalogInventory':
Running schema recurring...
Module 'Magento_GoogleAnalytics':
Module 'Magento_Ui':
Module 'Magento_GroupedImportExport':
Module 'Magento_GroupedProduct':
Module 'Magento_DownloadableImportExport':
Module 'Magento_Checkout':
Module 'Magento_Security':
Module 'Magento_LayeredNavigation':
Module 'Magento_Marketplace':
Module 'Magento_MediaStorage':
Module 'Magento_CatalogRule':
Module 'Magento_Multishipping':
Module 'Magento_ConfigurableProduct':
Running schema recurring...
Module 'Magento_Newsletter':
Module 'Magento_OfflinePayments':
Module 'Magento_SalesRule':
Module 'Magento_PageCache':
Module 'Magento_Captcha':
Module 'Magento_Vault':
Module 'Magento_Persistent':
Module 'Magento_ProductAlert':
Running schema recurring...
Module 'Magento_ProductVideo':
Module 'Magento_Authorizenet':
Module 'Magento_Reports':
Running schema recurring...
Module 'Magento_RequireJs':
Module 'Magento_Rss':
Module 'Magento_CatalogRuleConfigurable':
Module 'Magento_Paypal':
Module 'Magento_OfflineShipping':
Module 'Magento_GoogleAdwords':
Module 'Magento_SampleData':
Module 'Magento_CatalogSearch':
Module 'Magento_Integration':
Running schema recurring...
Module 'Magento_SendFriend':
Module 'Magento_Shipping':
Module 'Magento_Sitemap':
Module 'Magento_Authorization':
Module 'Magento_Swagger':
Module 'Magento_Swatches':
Module 'Magento_SwatchesLayeredNavigation':
Module 'Magento_Tax':
Module 'Magento_TaxImportExport':
Module 'Magento_NewRelicReporting':
Module 'Magento_Translation':
Module 'Magento_GoogleOptimizer':
Module 'Magento_Ups':
Module 'Magento_UrlRewrite':
Module 'Magento_EncryptionKey':
Module 'Magento_Usps':
Module 'Magento_Variable':
Module 'Magento_Braintree':
Module 'Magento_Version':
Module 'Magento_Webapi':
Module 'Magento_WebapiSecurity':
Module 'Magento_Weee':
Running schema recurring...
Module 'Magento_CatalogWidget':
Module 'Magento_Wishlist':
Running schema recurring...
Data install/update:
Module 'Magento_Store':
Module 'Magento_AdminNotification':
Module 'Magento_AdvancedPricingImportExport':
Module 'Magento_Directory':
Module 'Magento_Theme':
Upgrading data..
Module 'Magento_Backend':
Module 'Magento_Backup':
Module 'Magento_Eav':
Module 'Magento_Customer':
Upgrading data..
Module 'Magento_BundleImportExport':
Module 'Magento_CacheInvalidate':
Module 'Magento_Indexer':
Module 'Magento_Cms':
Upgrading data..

  [Magento\Framework\Exception\LocalizedException]
  The page URL key contains capital letters or disallowed symbols.

setup:upgrade [--keep-generated] [--magento-init-params="..."]

abcdnet@a2ss26 [~/public_html]#

Step 2: I launched the admin side and got an exception report

Below is the exception report I see when I launch the admin side.

a:4:{i:0;s:938:"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. 
The following modules are outdated:
Magento_Cms data: current version - 2.0.0, required version - 2.0.1
Magento_Catalog data: current version - 2.0.3, required version - 2.0.7
Magento_Search data: current version - 2.0.1, required version - 2.0.4
Magento_Bundle data: current version - 2.0.1, required version - 2.0.2
Magento_Downloadable data: current version - 2.0.0, required version - 2.0.1
Magento_Sales data: current version - 2.0.1, required version - 2.0.2
Magento_GiftMessage data: current version - 2.0.0, required version - 2.0.1
Magento_GroupedProduct data: current version - 2.0.0, required version - 2.0.1
Magento_CatalogRule data: current version - 2.0.0, required version - 2.0.1
Magento_SalesRule data: current version - 2.0.0, required version - 2.0.1
Magento_Swatches data: current version - 2.0.0, required version - 2.0.1";i:1;s:893:"#0 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#1 /home/abcdnet/public_html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#2 /home/abcdnet/public_html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#3 /home/abcdnet/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#4 /home/abcdnet/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#5 {main}";s:3:"url";s:16:"/index.php/shop/";s:11:"script_name";s:10:"/index.php";}

I manually changed the setup_module table via phpmyadmin which the required data_version.

Step 3: Ran the upgrade again

abcdnet@a2ss26 [~/public_html]# bin/magento setup:upgrade

Now the upgrade didnt throw any error.

Step 4: Tried to edit a product from admin side and got an exception report

The exception report shows as below.

a:4:{i:0;s:98:"The configuration parameter "componentType" is a required for "advanced_pricing_button" component.";i:1;s:8097:"#0 /home/abcdnet/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(362): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#1 /home/abcdnet/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(362): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#2 /home/abcdnet/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(362): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#3 /home/abcdnet/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(272): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#4 /home/abcdnet/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(164): Magento\Framework\View\Element\UiComponentFactory->mergeMetadata('product_form', Array, false)
#5 /home/abcdnet/public_html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(125): Magento\Framework\View\Element\UiComponentFactory->create('product_form', NULL, Array)
#6 /home/abcdnet/public_html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'product_form', Array, Object(Magento\Framework\View\Layout\Interceptor))
#7 /home/abcdnet/public_html/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#8 /home/abcdnet/public_html/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#9 /home/abcdnet/public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#10 /home/abcdnet/public_html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#11 /home/abcdnet/public_html/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#12 /home/abcdnet/public_html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#13 /home/abcdnet/public_html/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#14 /home/abcdnet/public_html/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#15 /home/abcdnet/public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#16 /home/abcdnet/public_html/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#17 /home/abcdnet/public_html/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Catalog...')
#18 /home/abcdnet/public_html/vendor/magento/module-catalog/Controller/Adminhtml/Product/Edit.php(69): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Catalog...')
#19 /home/abcdnet/public_html/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Edit/Interceptor.php(24): Magento\Catalog\Controller\Adminhtml\Product\Edit->execute()
#20 /home/abcdnet/public_html/vendor/magento/framework/App/Action/Action.php(102): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->execute()
#21 /home/abcdnet/public_html/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#22 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#23 /home/abcdnet/public_html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->___callParent('dispatch', Array)
#24 /home/abcdnet/public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Array, 'adminAuthentica...')
#25 /home/abcdnet/public_html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#26 /home/abcdnet/public_html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#27 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Array, 'adminMassaction...')
#28 /home/abcdnet/public_html/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#29 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#30 /home/abcdnet/public_html/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Edit/Interceptor.php(39): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->___callPlugins('dispatch', Array, Array)
#31 /home/abcdnet/public_html/vendor/magento/framework/App/FrontController.php(55): Magento\Catalog\Controller\Adminhtml\Product\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#32 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#33 /home/abcdnet/public_html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#34 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#35 /home/abcdnet/public_html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#36 /home/abcdnet/public_html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#37 /home/abcdnet/public_html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#38 /home/abcdnet/public_html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#39 /home/abcdnet/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#40 /home/abcdnet/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#41 {main}";s:3:"url";s:111:"/index.php/shop/catalog/product/edit/id/1/key/c3bcb18df556c357db057406e1b7bc13c19e571ac676c15edc16025421fe1af7/";s:11:"script_name";s:10:"/index.php";}

Step 5: Applied the hack suggested in #5236

I referred the issue #5236 and changed the ConfigurablePrice.php as below

self::$advancedPricingButton => [
    'arguments' => [
        'data' => [
            //'config' => $visibilityConfig,
            'config' => ['componentType'=>'container',$visibilityConfig],
        ],
    ],
],

Step 6: Tried to edit the product again via back-end

Now I am getting Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist directly on the browser. Also a blank page shows when saving a customer

malaiselvan avatar Jul 23 '16 23:07 malaiselvan

If you look @ magento2/vendor/magento/module-cms/Setup/UpgradeData.php

This issue seems to be because magento2 is looking for a cms page with a specific Id (4 in this case). Which may or may have been previously deleted via admin etc... I was able to get around this issue by manually adding a page with an id of 4. You also need to make sure you set a valid identifier.

josh-- avatar Aug 02 '16 15:08 josh--

This issue has been addressed as part of a internal Jira ticket -MAGETWO-55229

dthampy avatar Aug 08 '16 22:08 dthampy

I have reported same behavior in ticket #5802 any help will be very appreciated.

diegoalex90123 avatar Nov 07 '16 16:11 diegoalex90123

@malaiselvan, thank you for your report. We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue. We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

magento-engcom-team avatar Oct 26 '17 14:10 magento-engcom-team