51 votes
Accepted

Cannot process definition to array for type tinytext in Magento 2.3.0

You are getting this error because "data type" of any third-party extension's table's column is tinytext. Note: Normally this error happens because of Fishpig Wordpress extension's ...
Aasim Goriya's user avatar
  • 5,444
31 votes
Accepted

Magento2 - setup:di:compile

The command setup:di:compile command generates the contents of the var/di folder in Magento <2.2 and generated for Magento >= 2.2 According to Magento, this serves the following purpose: ...
Tjitse's user avatar
  • 1,300
17 votes

Magento2 - setup:di:compile

It's not mandatory to run setup:di:compile command everytime but if you have done any code change specially with factory methods ,proxy, add plugins or any code compilation then you must need to run ...
Prince Patel's user avatar
  • 22.7k
17 votes
Accepted

Magento2.3 setup:upgrade error

No need to update in core files, please follow up my solution. Open Mysql database and select database and use below queries. This query also will be useful to find out the datatype CHAR error when ...
ManiMaran A's user avatar
  • 1,136
17 votes

php bin/magento setup:upgrade issue

The fix for the issue - Type Error occurred when creating the object: Magento\Framework\Locale\Resolver is not modifying the core class at all. We need to understand the cause of it first. Modifying ...
Sandipan S's user avatar
16 votes
Accepted

The configuration parameter "formElement" is a required for custom attribute product field

Solution 1: You should delete attribute code dimension in eav_attribute table and recreate use 'input' => 'text' in array. After then, reindex + clear cache. [ 'type' => 'decimal', '...
LinoPham's user avatar
  • 3,778
15 votes

Patch isn't working

If you have already ran setup_upgrade before, there is a table in the database called patch_list that will be filled because patches are only executed once. You could go in the database and delete the ...
Petar Borisovski's user avatar
14 votes

Cannot process definition to array for type tinytext in Magento 2.3.0

In my case, Wordpress was being used with the Fishpig integration. In wp_comments, the comment_author was set to TINYTEXT. The problem was resolved by changing that column declaration.
bassplayer7's user avatar
  • 2,196
13 votes

Magento 2: How to fix error `[Zend_Db_Adapter_Exception] SQLSTATE[HY000] [2002] No such file or directory` when run setup:upgrade?

This will happen in normal cases. Go to, app/etc/env.php Change 'host' => 'localhost', Into 'host' => '127.0.0.1' Run the upgrade now. Good Luck!
Satya's user avatar
  • 249
13 votes

Magento2.3 setup:upgrade error

You are getting this error because "data type" of any third party extension's table column is enum. So you need to find out column name using debug in following file. See below file /vendor/magento/...
hardik's user avatar
  • 496
11 votes
Accepted

Does Magento 2's UpgradeSchema Pattern Handle non-contiguous Version Jumps

Here are the upgrade steps as I understand them: For all active modules $ bin/magento setup:upgrade checks the configured (module.xml file) version versus the database (setup_module table) schema+...
benmarks's user avatar
  • 16.7k
8 votes

How to solve "Duplicate Of Template Name"?

Duplicate of Template name comes from the module-email So setup:upgrade tries to add e-mail templates that already exist. Remove any non altered templates from the database.
Remko de Keijzer's user avatar
8 votes

Cannot process definition to array for type tinytext in Magento 2.3.0

If you do WordPress migrations frequently, changing the schema as suggested in some of the other answers is tedious and easy to forget, plus changing the schema seems hacky. To resolve this, I wrote ...
Phil Birnie's user avatar
7 votes

Magento 2: How to fix error `[Zend_Db_Adapter_Exception] SQLSTATE[HY000] [2002] No such file or directory` when run setup:upgrade?

This can happen if you have multiple versions of PHP on your system. For example, I had /usr/bin/php as well as the PHP from MAMP on my Mac, so running /usr/bin/php in the (cron job for indexing) ...
Scott C Wilson's user avatar
7 votes
Accepted

Constraint "email_order_to_sales_order" references table that does not exist

This problem occurs when running the setup:upgrade command while having the newer Dotdigitalgroup_Enterprise module enabled and the Dotdigitalgroup_Email module disabled. Prior to this Enterprise ...
Bas Blanken's user avatar
7 votes
Accepted

Magento upgrade from 2.2.3 -> 2.3 error in module-configurable-product

As mentionned in this issue on the M2 github Search in the database in table eav_attribute for attribute manufacturer and copy the ID. With this id search in catalog_eav_attribute. Now enter the ...
Vinz's user avatar
  • 985
7 votes
Accepted

php bin/magento setup:upgrade issue

I have searched around and found this solution this is because of return $plainText SodiumChachaIetf::decrypt() must be of the type string, boolean Go to this file: vendor/magento/framework/...
Asad Ullah's user avatar
  • 1,461
6 votes
Accepted

Create new table with upgrade scripts in custom module

Yes, we can create new table using UpgradeSchema.php. Inside public function upgrade() add below scripts: $setup->startSetup(); if (version_compare($context->getVersion(), '2.0.0', '<=')) { ...
Seventh St's user avatar
6 votes
Accepted

Recurring.php and RecurringData.php

I've found this from online sources: The recurring scripts are executed after any module setup. If a module needs to do something everytime other modules are installed it can do it via the recurring ...
Adrian Z.'s user avatar
  • 707
6 votes

Magento 2: Error undefined index while upgrading M 2.2.5 > M 2.3.1

The accepted answer is not the right one, it's not sure that those wordpress tables are causing the error. Find the incriminated table first SELECT TABLE_NAME, CONSTRAINT_NAME FROM ...
Francesco Gasparetto's user avatar
6 votes
Accepted

How to create multiple customer attributes in magento 2?

Hii @Devidas Please try this code $setup->startSetup(); $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]); $attributesInfo = [ 'vat_id' => [ ...
Birjitsinh Zala's user avatar
5 votes
Accepted

What is causing InstallSchema Error Warning: array_key_exists() expects parameter 2 to be array, string given in

Take a look: vendor/magento/framework/DB/Ddl/Table.php::addColumn(), we can see the arguments of addColumn method: public function addColumn($name, $type, $size = null, $options = [], $comment = ...
Khoa TruongDinh's user avatar
5 votes
Accepted

How to solve "Duplicate Of Template Name"?

Run: bin/magento setup:upgrade Probably the issue is on database, so open the table setup_module and complete the module that doesn't have data_version completed.
Rafael Corrêa Gomes's user avatar
5 votes

Magento 2 setup:upgrade giving error

First you can use this command for compiling di php bin/magento setup:di:compile After finish of compilation if not getting any error delete di folder from /var/www/html/Magento/var/ and then run ...
Dharmendra Jadav's user avatar
5 votes
Accepted

Module 'Magento_CatalogInventory' has already been defined

You cloned your Magento from Github, so all your core is in folder app/code/Magento/, you need remove it and run the composer command to have your core in the folder vendor/. Note that you shouldn'...
Rafael Corrêa Gomes's user avatar
5 votes
Accepted

How to create MySQL Triggers through setup script

We can use \Magento\Framework\DB\Ddl\TriggerFactory to create mysql triggers through setup script: (not test yet) class UpgradeSchema implements UpgradeSchemaInterface { /** * @var \Magento\...
Khoa TruongDinh's user avatar
5 votes

Prevent Magento 2 website down when running setup:upgrade

The short answer is that you cannot totally avoid having the site down while doing database updates. The key though, is to have a process in place that minimizes the downtime. The steps below are ...
Haim's user avatar
  • 2,144
5 votes
Accepted

Upgradeschema.php and UpgradeData.php scenarios

@Hitesh, when you run upgrade command it will run UpgradeData.php file and in that it will compare the version based on that version it will execute the code, Since the product creation code is not ...
Jafar Pinjar's user avatar
  • 1,929
5 votes

Running php bin/magento setup:upgrade stuck

please enable verbose mode or run command with strace bin/magento setup:upgrade -vvv and tail magento logs to see whats going on, strace -s 99999 bin/magento setup:upgrade see at the end whats ...
MagenX's user avatar
  • 3,820
4 votes
Accepted

Error when running bin/magento setup:upgrade after creating Module on Magento 2

Simple, try the following commands. I have encountered this error, and I have overcome. rm -rf var/di/* rm -rf pub/static/_cache/* rm -rf pub/static/frontend/* rm -rf var/generation/* rm -rf var/...
AbotaLive's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible