user1622819
user1622819

Reputation: 31

Magento Product import error - SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘attribute_id’ cannot be null

I am having an issue uploading a large csv of products.

It goes through the check on then after then import says: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘attribute_id’ cannot be null

After this has done I have checked the products page and they are all there but do not seem to be in the categories, do not show in search and even if I manually enable the categories do not show.

Any ideas? Really stuck!

Upvotes: 3

Views: 12321

Answers (5)

hakkim
hakkim

Reputation: 658

I had the same problem..Then i solved with filling '88' under '_media_attribute_id' column.

Upvotes: 0

nklatt
nklatt

Reputation: 31

I received this same error when I hadn't set up my attribute and attribute set prior to importing a configurable item using said non-existent attribute.

Edit: Thus, creating and configuring the attribute and attribute set from the Magento dashboard resulted in Magmi not throwing this error.

Upvotes: 0

user3498928
user3498928

Reputation: 61

There is a value missing in "_media_attribute_id"

check all column and insert "88" where it is missing.

It solved my problem

Upvotes: 6

IMA
IMA

Reputation: 1

I had the same error. In my case, some products didn't have "_media_attribute_id" field populated.

Upvotes: 0

Ben Leah
Ben Leah

Reputation: 19

Invalid attribute_id is associated with custom attributes.

You need to check that 1) all the attribute fields referenced in your csv - lets use Color just as an example - have been set up as attributes in Magento (Catalog > Attributes > Manage Attributes). Similarly, you need to make sure that any custom attributes that have been added and configured to be required are in your csv.

The attributes which Magento will be expecting will ultimately depend on the attribute_set you tell Magento to use for those products - also part of your csv. Attribute sets can be managed similarly under Catalog > Attributes > Manage Attribute Sets

You then need to make sure that all the attribute values you are attempting to import and are mentioned in the csv, actually appear as values for those attributes in Magento. For exmaple, if in Magento the available values for the attribute Color were only Red and Blue - and you were trying to import Yellow under this heading, it would throw the error you mentioned. Note these are also case sensitive. Magento will error on blue if it is expecting Blue.

Products not appearing in Search would be an unrelated issue...

In your csv, check under the heading "visibility" that you imported the value "Catalog, Search" - it might be that you have imported them as either "Catalog" or "Not visible individually" which would explain them not appearing (I assume at this point they have been uploaded as enabled or you have manually enabled them before searching!)

Upvotes: 2

Related Questions