Steps to check the cause

Check the highest value of the primary key by running the following command in the terminal: SELECT MAX(value_id) FROM catalog_product_entity_int;

If the max(value_id) is lower than the max int(11) [ 4294967296 ], and the [ AUTO_INCREMENT ] has a value greater than or equal to the max int(11) [ 4294967296 ], then consider updating the [ AUTO_INCREMENT ] to the next value from the table. Otherwise, consider a INT to BIGINT schema update.

Update the AUTO_INCREMENT to the next value from the table

WARNING
Perform a database backup before altering the tables. Also, put the site into maintenance mode. In addition, it’s also recommended to run the MySQL optimize command on the database tables (only to tables where changes were made) after making the changes.
NOTE
The site should be in maintenance mode while running optimize command on specific tables. This completely rebuilds tables and will free space after deleting data from tables.

If the value shown is lower than max int(11) [ 4294967296 ] as shown in the below example terminal output, than a table [ AUTO_INCREMENT ] has changed to a number bigger or equal to the max [ int(11) ] value.

MariaDB [xxx]> SELECT MAX(value_id) FROM catalog_product_entity_int;
+---------------------+
| MAX(source_item_id) |
+---------------------+
|          4283174130 |
+---------------------+

To check if this has occured run the following command in the terminal:

MariaDB [xxx]> show create table catalog_product_entity_int;

...
) ENGINE=InnoDB AUTO_INCREMENT=4294967297 DEFAULT CHARSET=utf8 COMMENT='Catalog Product Integer Attribute Backend Table';

As you can see in the above example output the table [ AUTO_INCREMENT ] has changed to a bigger number than the max int(11) [ 4294967296 ]. The solution is to update the [ AUTO_INCREMENT] to the next value from the table:

ALTER TABLE catalog_product_entity_int AUTO_INCREMENT = 4283174131;

INT to BIGINT schema update

However, if when running the following query SELECT MAX(value_id) FROM catalog_product_entity_int; the value shown is higher than max int(11) [ 4294967296 ] consider doing a INT to BIGINT schema update. The datatype BIGINT has a larger range of values.

To do so:

  1. Create a custom module inside the app/code/ directory.
  2. In the custom module create a db_schema.xml. In db_schema.xml you will set the datatype to BIGINT.
  3. Add the following content and then execute bin/magento setup:upgrade to apply the above changes to the corresponding table.
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="catalog_product_entity_int">
        <column xsi:type="bigint" name="value_id" unsigned="false" nullable="false" identity="true"
                comment="Value ID"/>
    </table>
</schema>
Previous pageDatabase errors related to max_allowed_packet on Adobe Commerce
Next pageRead Replicas issues on Adobe Commerce Cloud 2.4.6 with MariaDB 10.6

Commerce


Elevate and Empower Teams with Agentic AI for Exceptional Experiences

Online | Strategy Keynote | General Audience

Elevate and empower your CX teams with AI that transforms creativity, personalization, and productivity. Discover how Adobe is...

Tue, Mar 18, 1:00 PM PDT (8:00 PM UTC)

Register

How AI Is Transforming the Commerce Landscape

Online | Session | General Audience

Delve into how AI is revolutionizing the commerce landscape by optimizing operations, enhancing customer experiences, and improving...

Tue, Mar 18, 3:30 PM PDT (10:30 PM UTC)

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more