1

during theme installation, I'm getting this error:

Module 'Magento_InventoryCatalog':
[ERROR] Magento\Framework\Setup\Exception: Unable to apply patch Magento\InventoryCatalog\Setup\Patch\Schema\CreateLegacyStockStatusView for module Magento_InventoryCatalog. Original exception message: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'inventory_stock_1' already exists, query was: CREATE
SQL SECURITY INVOKER
VIEW inventory_stock_1
AS
SELECT
DISTINCT 
legacy_stock_status.product_id,
legacy_stock_status.website_id,
legacy_stock_status.stock_id,
legacy_stock_status.qty quantity,
legacy_stock_status.stock_status is_salable,
product.sku
FROM cataloginventory_stock_status legacy_stock_status
INNER JOIN catalog_product_entity product
ON legacy_stock_status.product_id = product.entity_id; in /home/X/public_html/demo2/vendor/magento/framework/Setup/Patch/PatchApplier.php:232

Stack trace

how can i solve this error in order to keep the installation process?

0
  1. pls delete your view "inventory_stock_1" in database.
  2. pls check your mysql username when import database and username when running setup theme. It should same.
0

I ran into this same issue. I just made a backup of the inventory_stock_1 table (a full backup is a good idea if this is a live site), then deleted it from the database. This allowed the setup: upgrade script to complete.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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