Jump to content

Out of range value for column 'id_product' at row 1


prestalinks

Recommended Posts

Hello,

I migrated prestashop 1.7.4 to 1.7.6. everything works fine. But, when I click on "New Product" on the catalog, it redirects me to the backoffice home page.

I activated the debug mode, and I get the following message :  Out of range value for column 'id_product' at row 1

I hope someone can help me to fix the problem :(.

Thank you for any help

Capture.PNG

Link to comment
Share on other sites

  • 6 months later...

Good morning,

I know the topic is old, but I wanna share how I solved it.

The reason is that the AUTO_INCREMENT value is too high for the field 'id_product' (int 10).

You have to check why AUTO_INCREMENT is very high (maybe a wrong id_product) somewhere in the table. Adjust it, and then put the AUTO_INCREMENT value to the lower possible.

Link to comment
Share on other sites

Its strange that product_id automatically gone out of the range!!!!


Anyway use below SQL query to check the AUTO_INCREMENT value.

SELECT `AUTO_INCREMENT`, TABLE_NAME  
FROM  INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'DatabaseName'
AND   TABLE_NAME   = 'TableName';

if the AUTO_INCREMENT value is too high like (2147483647) then you need to fix the same in the table (as per the output of the above query)

 

Link to comment
Share on other sites

  • 11 months later...

I had today this same problem. I was struggling with it for 3 hours doing incredible things. SOLUTION I VERY VERY SIMPLE!

1) Go to database phpmyadmin to table ps_product

2) Expand the menu by clicking on the cross and choose "Columns"

3) Edit the id_product and uncheck "A_I" (AUTO_INCREMENT) >>> Click save

4) Go to edit id_product again and select back  "A_I" (AUTO_INCREMENT) >>> Click save

Now you can add product :)

 

Explanation for advanced users

PS. Somehow, most often after migration, the auto increment function loses the last product id.

Have no reference, this function automatically goes beyond the scope of the normal INTEGER.

For me, when I changed the product id in the column from INT (10) to BIGINT (255), I saw that adding products started working, creating a product with the id 4294967301 🤯

 

2021-05-25-17_10_26.png

Link to comment
Share on other sites

  • 1 year later...

Additional clarification instructions for the not so advanced,

After getting to the edit menu for products by clicking on the catagory product in phpmyadmin of your ship's database,  to display the columns you have to switch to  structure on the top menu after getting into the table, if by default you are in the browse mode.   On the top row which should be product click change and uncheck the A_I box then save.  After that completes go back to change and recheck the A_I box and save again.  To most users this would be obvious but not to beginners.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...