Skip to content

Integrity constraint violation SQL Error on saving attributes #6198

Closed
@Asitis

Description

@Asitis

Preconditions

  1. System: Magento 2.1 (installed, not upgraded)
  2. Database: MariaDB10.1
  3. PHP 7.0.7
  4. All caches enabled
  5. 4 storeviews, 2 enabled, 2 disabled

Steps to reproduce

  1. Add product attribute via Admin Stores > Attributes
  2. Fill in data and labels
  3. Click save

Expected result

The attribute saving correctly

Actual result

In a error-message box (page doesn't break):

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (admin_pubmag.eav_attribute_label, CONSTRAINT EAV_ATTRIBUTE_LABEL_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES xstore (store_id) ON DELETE CASCADE), query was: INSERT INTO eav_attribute_label (attribute_id, store_id, value) VALUES (?, ?, ?)

  • The filled labels are empty again, if I leave them empty I can save the attribute.
  • Whenever I save the attribute first, then try to fill in the labels; same error.

I've seen other related issues of non-responsive contributors with this error popping up on other instances ( #5709 #6101 ). I already spoke to my sysadmin if it could be related to SQL versions, but this shouldn't be the case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions