Error Pushing product to Magento - " attribute value is empty.

Symptom

When pushing a product to Magneto, the log shows:

Error Pushing product to Magento - Unable to push <SKU> to Magento: {"message"=>"<Attribute Name>" attribute value is empty. Set the attribute and try again."

 

Cause

This error happens because the attribute for the product was created in the database but was not assigned to your new products.

 

Solution

To solve this issue, we will remove the broken attribute directly from Magento 2 database.

Follow these steps:

Step 1: Use a database managing tool to edit your database

In this tutorial, I will use phpMyadmin to edit Magento 2 database’s tables and values.

If your website is running on Cpanel or Directadmin, you can find phpmyadmin in Database section. If you’re running on a dedicated server or VPS, just go to phpmyadmin page and download this software.

Now open phpmyadmin and login using database information: username and password (in case you forget, go to app/etc/env.php and find line 24, 25, 26 to retrieve database info)

'dbname' => 'magento2demo',
'username' => 'magentip.com',
'password' => 'password',

login to phpmyadmin

Step 2: Edit database and find the broken attribute

On the right side, look for the database of your Magento 2 store and click to see all tables in the database

Next, in the table list, look for eav_attribute  table

eav_attribute table

Now find the broken attribute, for example: price

price table

Step 3: Change value of the broken attribute

Click on edit and scroll down, find is_required and default_value

is required and default value

Next, change “is required” to: 0

Uncheck default_value (null column) and also, input 0 in value column

make change to value

Finally, click on Go button in phpmyadmin page to update changes

Now the problem should be fixed.

 

Original Solution