What is causing this error?

An Adobe Commerce Architect is investigating a case where some EAV product attributes are no longer updated.

• The catalog is composed of 20.000 products with 100 attributes each.

• The product updates are run by recurring Adobe commerce imports that happen multiple times a day.

• The Architect finds an error in the logs that indicates an integrity constraint while trying to insert row with id 2147483647.

What is causing this error?

A. Magento framework uses INSERT on DUPLICATE, which leads to reaching the max limit of the increment of the column.

B. Integrity constraints were dropped after upgrading to the latest version, and the integrity checks were missed.

C. EAV attribute import uses REPLACE, which leads to reaching the max limit of the increment of the column

Answer: A

Explanation:

The error with the id 2147483647 is indicative of an integer overflow issue. This number is the maximum value for a signed 32-bit integer, and attempting to insert or increment beyond this value would cause an error due to exceeding the column’s data type limits.

Magento framework uses INSERT ON DUPLICATE KEY UPDATE on some of its operations, which could lead to auto-increment values being increased even when rows are not actually inserted but updated. If the table’s auto-increment column is of type INT and it reaches the maximum value of 2147483647, it will cause an integrity constraint violation on the next insert attempt.

Dropping integrity constraints would not typically result in an auto-increment issue, although it might lead to other types of integrity constraint violations. This would not directly cause the specific error of exceeding the maximum integer value.

The EAV attribute import using REPLACE could lead to auto-increment values increasing, as REPLACE first deletes the old row and then inserts a new one, causing the auto-increment ID to increment. However, this behavior is more commonly associated with MySQL’s behavior rather than specifically with Adobe Commerce’s EAV attribute import.

Given these options, the most likely cause of the error is:

A. Magento framework uses INSERT ON DUPLICATE KEY UPDATE, which leads to reaching the max limit of the increment of the column.

This scenario is a common issue in database management when dealing with large volumes of data and operations that may result in frequent changes to the auto-increment value. The solution would typically involve changing the data type of the auto-increment column to a larger size (e.g., from INT to BIGINT).

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments