I see in my log the nexe warning:

[2017-05-05 12:23:53] main.WARNING: Attempt to load value of nonexistent EAV attribute '339'
                        for entity type 'Magento\Catalog\Api\Data\ProductInterface'. [] []

I can't find why, but i find this and i don't know if this is true.

Do you know why this problem occurs?

5 Answers 5


Make a database backup.

Go to the database and check in the eav_attribute and the other eav_* tables if you find a reference to that id. You could try to delete that reference if that attribute was deleted.

This information is supplied without liability. I never did that. It's just on top of my head.


I migrated from M1 to M2 and had similar problem.

I fixed it by adding the missing attributes to the attribute set created by migration tool.

Find the attribute code by running following query:

SELECT * FROM `eav_attribute` WHERE `attribute_id` = 339

In the result you should see the attribute code. Now log in to the admin panel and navigate to Admin > Stores > Attributes > Attribute Set

Find the migrated attribute set (Usually looks like this Migration_[AttributeSetName]) and add the attribute code to the attribute set.

This solved my problem that appeared after migration.


Note: Backup your database first.

Find the string Attempt to load value of nonexistent EAV attribute in our project. On my current Magento version 2.2.2, foud it in


foreach ($connection->fetchAll($unionSelect) as $attributeValue) {
                if (isset($attributesMap[$attributeValue['attribute_id']])) {
                    $entityData[$attributesMap[$attributeValue['attribute_id']]] = $attributeValue['value'];
                } else {
                        "Attempt to load value of nonexistent EAV attribute '{$attributeValue['attribute_id']}' 
                        for entity type '$entityType'."

We need to dig into this part with xDebug:

enter image description here

Check entity_id in eav_attribute and check backend_type. For example: int, datetime, decimal, varchar...

And then find the table of this type: catalog_product_*


I have this issue and know how it was caused in my setup. We moved products over from another Magento2 install. The ID numbers for the EAV attributes will have likely been different. So while the attributes are all still there and assigned to the same products. The entity_id number will be different. Shy of trying to marry up the id numbers again back to their original values, I'm not sure how to fix this..... bit messy! In your situation, if you have a previous version of the eav_attribute table, try restoring the previous version and see if the error's in your log remain.


All eav_attribute values mapped to a catalog_product_entity_*** table need to be added to the attribute set assigned to the product.

This is done in the eav_entity_attribute table keyed on attribute_set_id, attribute_group_id and attribute_id. Also achieved via Magento -> Admin -> Stores -> Attributes -> Attribute Set.

Clear Magento Cache to see the results after mapping attributes' to attribute sets.

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.