Jump to content

Category problem 1.7.6 [PrestaShop\PrestaShop\Core\Domain\Category\Exception\CategoryConstraintException code 6]


Recommended Posts

Hello. Today I installed update from Presta 1.7.4 to 1.7.. Past that i have a lot of problem with categories. I can t create or modify. Any time I have an error :

[PrestaShop\PrestaShop\Core\Domain\Category\Exception\CategoryConstraintException code 6]

here is the log 

https://pastebin.com/dQt43WNu

How can I repair it ? :(

Best Regards 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

First you have to clear LiteSpeed Cache Plugin after update. Secound you have to recreate default and root categories. If you don t have that two categories nothing gona work. Third you have to delate cache in var folder. 

image.thumb.png.6e0af51639af36a5bc7df6bb18da0406.png

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Hello, i have the same but for the customers, cannot change password by back office. And reset password by front office, is directly expired, cannot change too.

[PrestaShop\PrestaShop\Core\Domain\Customer\Exception\CustomerException code 0]

Link to comment
Share on other sites

  • 4 weeks later...
On 10/21/2019 at 3:10 PM, Mélody said:

Hello, i have the same but for the customers, cannot change password by back office. And reset password by front office, is directly expired, cannot change too.

[PrestaShop\PrestaShop\Core\Domain\Customer\Exception\CustomerException code 0]

Check if the customer has any 'invalid' names or info.
I had the same, my customer had a . (dot) in his name.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

i have a solution for those people having this issue

first of all go to "Traffic & SEO" section and be sure you have turned on both "Friendly URL" and "Accented URL" then log out and log in again and after that be sure if you have multilingual website enabled even though you have some languages disabled, fill related name for category name

this solution worked for me

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

For anyone having problems with the "[PrestaShop\PrestaShop\Core\Domain\Customer\Exception\CustomerException code 0]" error, I've just been experiencing that whilst trying to change customer details, passwords etc on PS 1.7.6.2

This was due to an upgrade from an older version and the "date_upd" column in the ps_customer table was set to "0000-00-00 00:00:00" for some customers, and that was causing the issue.

As a quick fix, for any customers with a blank date_upd column, I copied the value of the date_add column with an SQL query:

UPDATE ps_customer
SET date_upd = date_add
WHERE date_upd = '0000-00-00 00:00:00'

Hope that helps somebody out!

  • Thanks 3
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
On 2/18/2020 at 5:29 PM, CYGM said:

For anyone having problems with the "[PrestaShop\PrestaShop\Core\Domain\Customer\Exception\CustomerException code 0]" error, I've just been experiencing that whilst trying to change customer details, passwords etc on PS 1.7.6.2

This was due to an upgrade from an older version and the "date_upd" column in the ps_customer table was set to "0000-00-00 00:00:00" for some customers, and that was causing the issue.

As a quick fix, for any customers with a blank date_upd column, I copied the value of the date_add column with an SQL query:


UPDATE ps_customer
SET date_upd = date_add
WHERE date_upd = '0000-00-00 00:00:00'

Hope that helps somebody out!

You've just saved my night 🙂

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Hello, 

I have the same problem as everybody else ... and despite the information above cannot manage to correct this issue ... 

My problem appears when I try to change the name of a page or a category. Many of the current categories I have do not display any bugs but some do... 

Would anyone have any advice on possibilities to correct this ?

ps: I am on 1.7.6.5

Many thanks and nice evening, 

Link to comment
Share on other sites

  • 1 month later...

I had the same problem, when saving details from a customer in the admin I got this error; [PrestaShop\PrestaShop\Core\Domain\Customer\Exception\CustomerException code 0]. After reading this topic I checked the first name, which had A.B.C. as initials filled in. Customer was already a customer in the shop for years, but now she couldn't change the password. I tried helping from the backend, resulting in the code 0 error.

After changing the initials A.B.C. to ABC in the "first name" field the problem was solved for me and all changes were saved without a problem. 

 

Link to comment
Share on other sites

  • 4 months later...
On 12/9/2019 at 1:54 PM, farzzin said:

i have a solution for those people having this issue

first of all go to "Traffic & SEO" section and be sure you have turned on both "Friendly URL" and "Accented URL" then log out and log in again ...

I tried them all. The only one that worked on the first try was this one !!

Of course it doesn't hurt to delete cache:

1. Advanced Parameters> Performance

2. / var / cache

Link to comment
Share on other sites

  • 3 months later...

ENGLISH

Hello,
I have solved it by following one of the steps discussed here and another that I have tried and fixed, I am attaching the answer in case someone can use my process.

Trouble:
The problem happened when I exported data (products and categories) from Prestashop 1.6 and imported it into a clean Prestashop 1.7 of 0.

When trying to enter to modify the categories it failed, it also failed when I entered an imported article and reviewed the associated categories, the product associations appeared to 0, and for any change it forced me to place the product in a category, this was an error given that when importing each product had its category.

Solution:
1) Check that it had 2 Root categories, but the newly imported one (called Category1) had no Parent Category, assign the category that already exists called "home"

2) Go to "Traffic and SEO" and make sure that I have "Active friendly URLs" (I already had it by default) but I gave it a save again.

Done these two changes it worked.

 

SPANISH

Hola,
Yo lo he solucionado siguiendo un paso de los que comentan aquí y otro que he probado y se ha arreglado, adjunto la respuesta por si alguien le sirve mi proceso.

Problema:
El problema paso cuando exporte datos (productos y categorías) de Prestashop 1.6 y los importe en un Prestashop 1.7 limpio de 0.

Al intentar entrar a modificar las categorías fallaba, también fallaba cuando entraba a un artículo de los importados y revisaba las categorías asociadas, me aparecían a 0 las asociaciones del producto, y para cualquier cambio me obligaba a colocar el producto en una categoría, esto era un error dado que al importarlos cada producto tenía su categoría.

Solución: 
1) Revise que tenía 2 categorías Raiz, pero la recién importada (llamada Categoria1) no tenia Categoría Padre, le asigne la categoría que ya existe llamada "inicio"

2) Ir a "Tráfico y SEO" y asegurarme que tengo "URL amigables Activas" (por defecto ya lo tenia) pero le di guardar nuevamente.

Hecho estos dos cambios funciono.

Link to comment
Share on other sites

  • 4 weeks later...

Hi Guys, if anyone does the same I did - i.e. migrated 1.3 or such to 1.7.7 here is my experience:

Did the transfer of category and _lang as well as the category_product linkage. However in the newer version, there is a "Root" category id = 1, which is not present in older versions of the database. So I had to modify it and create a "Home" category relating to id=1 and mark as root category then update the connections (id_parent) from id=1 to that new home category (for me I had space for id=2) and the depth needs to be managed accordingly (in my case I needed to increase all by one, leaving category 1 to depth of 0). If you are moving form version without category_shop table, you will need copy the content table category into that  category_shop with the appropriate shop id (I only have the default =1). Also dont worry about the nleft and nright also position columns, those get updated by the system the moment you make a change to a category position in the Admin UI.

This re-arranged all the categories and showed them in the interface as well as in the shop.

Here is my 1.3 category table:

1725285927_Screenshotfrom2021-03-3114-28-44.png.ff7308dd0af089e12711f9a9a61dd27c.png

And here is my 1.7.7 category table:

165247909_Screenshotfrom2021-03-3114-31-10.thumb.png.4032e91e051b5ad98ca8a1a7264ac911.png

Hope that helps someone else. 🙂

NB - to the post of @HackID1 (above) - I only have one category marked root - and that is my category 2 (the home category - not id=1 the root category)

Link to comment
Share on other sites

  • 4 weeks later...
On 3/31/2021 at 1:36 PM, batevladi said:

Hi Guys, if anyone does the same I did - i.e. migrated 1.3 or such to 1.7.7 here is my experience:

Did the transfer of category and _lang as well as the category_product linkage. However in the newer version, there is a "Root" category id = 1, which is not present in older versions of the database. So I had to modify it and create a "Home" category relating to id=1 and mark as root category then update the connections (id_parent) from id=1 to that new home category (for me I had space for id=2) and the depth needs to be managed accordingly (in my case I needed to increase all by one, leaving category 1 to depth of 0). If you are moving form version without category_shop table, you will need copy the content table category into that  category_shop with the appropriate shop id (I only have the default =1). Also dont worry about the nleft and nright also position columns, those get updated by the system the moment you make a change to a category position in the Admin UI.

This re-arranged all the categories and showed them in the interface as well as in the shop.

Here is my 1.3 category table:

1725285927_Screenshotfrom2021-03-3114-28-44.png.ff7308dd0af089e12711f9a9a61dd27c.png

And here is my 1.7.7 category table:

165247909_Screenshotfrom2021-03-3114-31-10.thumb.png.4032e91e051b5ad98ca8a1a7264ac911.png

Hope that helps someone else. 🙂

NB - to the post of @HackID1 (above) - I only have one category marked root - and that is my category 2 (the home category - not id=1 the root category)

Hi @batevladi!

I'm having the same issue after upgrading, but even I've made the same changes you said, my backoffice is still showing the category with id 1 and level_depth = 0 as root and the new one marked a is_root_category as a subcategory (I've also changed the PS_HOME_CATEGORY config to the new ID):


1734614601_Screenshot2021-04-25at19_38_15.thumb.png.92f4610828a5a366f111421fdbda7df9.png

125653493_Screenshot2021-04-25at19_38_38.thumb.png.e90cd89922880901ab6d57cadd5e101a.png

Is there something else I should do? I've tried everything and nothing have worked…

 

Edited by Coluccini (see edit history)
Link to comment
Share on other sites

  • 6 months later...
On 8/14/2019 at 2:57 PM, Cawe said:

First you have to clear LiteSpeed Cache Plugin after update. Secound you have to recreate default and root categories. If you don t have that two categories nothing gona work. Third you have to delate cache in var folder. 

image.thumb.png.6e0af51639af36a5bc7df6bb18da0406.png

Hi,

What is the table on your picture?

Link to comment
Share on other sites

  • 1 month later...

Hello @Coluccini! Sorry - i have completely missed your question - you will also need to assign the parent categories accordingly - so you will need to update the parent items and re-hash the products. One way is to disable and re-enable them, this way you will make Presta refresh all items, and they will show.

Edited by batevladi
typos (see edit history)
Link to comment
Share on other sites

  • 2 months later...

This is all due to an upgrade in the past possibly not working properly or the issue being forgotten in later updates (it started around 2014 if I remember correctly)....

In stores that were installed before multi-shop was a thing the "Home" category was category 1. When multi-shop was introduced there was a need to have a "Home" category potentially for each shop (although multiple shops could have the same category tree and therefor the same "Home" I guess).

So.... after multi-shop was introduced category 1 now became "Root" and category 2 was "Home" with a parent_id of 1 (and confusingly the field is_root_category is set to 1 for the "Home" categories but not for the "Root" category).

If your install pre-dates multi-shop, then category 1  should have is_root_category = 1  and is "Home", plus it will have a parent_id which points to the "Root" category added when the catalog was upgraded for multi-shop (e.g. 132). That "Root" category (132 in this example) should have a parent_id of 0, is_root_category = 0 and active = 1. If you don't use multi-shop then you should only have ONE category with is_root_category = 1 (almost certainly this will be category 1). If you DO use multi-shop, then you may have more than one.

Due to the structure of the category tree you may have to rebuild the tree if you manually change entries in the database. So for my example you can do this whole thing using:

// Set 'home' category as the root category
$query = 'UPDATE `'._DB_PREFIX_.'category` SET `is_root_category` = 1 WHERE `id_category` = 1';
$result = Db::getInstance()->Execute($query);

// Set the parent of the home category active and then set its parent to 0 (queries split for clarity)
$query = 'UPDATE `'._DB_PREFIX_.'category` SET `active` = 1 WHERE `id_category` = 132';
$result = Db::getInstance()->Execute($query);
$query = 'UPDATE `'._DB_PREFIX_.'category` SET `id_parent` = 0 WHERE `id_category` = 132';
$result = Db::getInstance()->Execute($query);

// Rebuild the entire category tree
Category::regenerateEntireNtree();

 

Edited by Paul C
typos (see edit history)
Link to comment
Share on other sites

7 hours ago, Paul C said:

This is all due to an upgrade in the past possibly not working properly or the issue being forgotten in later updates (it started around 2014 if I remember correctly)....

In stores that were installed before multi-shop was a thing the "Home" category was category 1. When multi-shop was introduced there was a need to have a "Home" category potentially for each shop (although multiple shops could have the same category tree and therefor the same "Home" I guess).

So.... after multi-shop was introduced category 1 now became "Root" and category 2 was "Home" with a parent_id of 1 (and confusingly the field is_root_category is set to 1 for the "Home" categories but not for the "Root" category).

If your install pre-dates multi-shop, then category 1  should have is_root_category = 1  and is "Home", plus it will have a parent_id which points to the "Root" category added when the catalog was upgraded for multi-shop (e.g. 132). That "Root" category (132 in this example) should have a parent_id of 0, is_root_category = 0 and active = 1. If you don't use multi-shop then you should only have ONE category with is_root_category = 1 (almost certainly this will be category 1). If you DO use multi-shop, then you may have more than one.

Due to the structure of the category tree you may have to rebuild the tree if you manually change entries in the database. So for my example you can do this whole thing using:

// Set 'home' category as the root category
$query = 'UPDATE `'._DB_PREFIX_.'category` SET `is_root_category` = 1 WHERE `id_category` = 1';
$result = Db::getInstance()->Execute($query);

// Set the parent of the home category active and then set its parent to 0 (queries split for clarity)
$query = 'UPDATE `'._DB_PREFIX_.'category` SET `active` = 1 WHERE `id_category` = 132';
$result = Db::getInstance()->Execute($query);
$query = 'UPDATE `'._DB_PREFIX_.'category` SET `id_parent` = 0 WHERE `id_category` = 132';
$result = Db::getInstance()->Execute($query);

// Rebuild the entire category tree
Category::regenerateEntireNtree();

 

I have never had multistore my project started with prestashop 1.7 and warehouse. but I have a huge problem with the categories that can go where you say.


 I have all the categories crossed, I delete them, I import them again and it doesn't work.

I have given to a cleaning with the prestashop cleaner and I get this.

    
1-.also when i enter categories i get all of them inactive,
https://shortest.link/30Lm

2.-but I give to edit to start I close it and without doing anything or touching anything appear all but 5 all https://shortest.link/39Vc
3.-I think I have some problem in the root but I don't know how to look for it and solve it in the database but I don't know how to look neither in the database nor in the log that I have downloaded.


if i manually change to 1 root category by removing it from home and updating categories would it work? or do i have to put the commands you indicate.

Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

23 minutes ago, RCTSH said:

I have never had multistore my project started with prestashop 1.7 and warehouse. but I have a huge problem with the categories that can go where you say.


 I have all the categories crossed, I delete them, I import them again and it doesn't work.

I have given to a cleaning with the prestashop cleaner and I get this.

    
1-.also when i enter categories i get all of them inactive,
https://shortest.link/30Lm

2.-but I give to edit to start I close it and without doing anything or touching anything appear all but 5 all https://shortest.link/39Vc
3.-I think I have some problem in the root but I don't know how to look for it and solve it in the database but I don't know how to look neither in the database nor in the log that I have downloaded.


if i manually change to 1 root category by removing it from home and updating categories would it work? or do i have to put the commands you indicate.

Translated with www.DeepL.com/Translator (free version)

The reason this is an issue for older stores is that a broken category structure works in 1.6 but in 1.7 with the new symphony code it is more sensitive to errors. It looks like you have something wrong with the structure for a different reason. Do you use product import or a product import module?

The reason your categories appear after doing an edit is that the category n values need to be updated and that's done automatically whenever you edit anything in the categories controller. There wouldn't be any benefit to you running the above code as at the very least you would need to be able to work out what the parent category of the "Home" (real root) category was - and in general the issue I described means that NO categories can be displayed.

I would suggest installing the Prestools Suite (basic free version) and running the "Integrity Checks" - I think that should be able to at least identify, if not fix, your issue.

Link to comment
Share on other sites

46 minutes ago, Paul C said:

The reason this is an issue for older stores is that a broken category structure works in 1.6 but in 1.7 with the new symphony code it is more sensitive to errors. It looks like you have something wrong with the structure for a different reason. Do you use product import or a product import module?

The reason your categories appear after doing an edit is that the category n values need to be updated and that's done automatically whenever you edit anything in the categories controller. There wouldn't be any benefit to you running the above code as at the very least you would need to be able to work out what the parent category of the "Home" (real root) category was - and in general the issue I described means that NO categories can be displayed.

I would suggest installing the Prestools Suite (basic free version) and running the "Integrity Checks" - I think that should be able to at least identify, if not fix, your issue.

Thank you very much for your answer

In small imports 500-600 products I usually use the prestashop importer
when I have to import more I use the importer because the prestashop importer gives me a lot of stupid errors.

I have discovered an error in the database by checking against another installation I have clean

the category nrigt was in 622 instead of 4

I will test your utilities and keep you informed.

Thank you very much for your help.

Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

1 hour ago, Paul C said:

The reason this is an issue for older stores is that a broken category structure works in 1.6 but in 1.7 with the new symphony code it is more sensitive to errors. It looks like you have something wrong with the structure for a different reason. Do you use product import or a product import module?

The reason your categories appear after doing an edit is that the category n values need to be updated and that's done automatically whenever you edit anything in the categories controller. There wouldn't be any benefit to you running the above code as at the very least you would need to be able to work out what the parent category of the "Home" (real root) category was - and in general the issue I described means that NO categories can be displayed.

I would suggest installing the Prestools Suite (basic free version) and running the "Integrity Checks" - I think that should be able to at least identify, if not fix, your issue.

good morning
I have already downloaded the module created a folder unzipped in it but it does not work settings1.php does not start me and I do not appear a suitte in the backoffice of prestashop
a pity it looked good

Link to comment
Share on other sites

5 minutes ago, RCTSH said:

good morning
I have already downloaded the module created a folder unzipped in it but it does not work settings1.php does not start me and I do not appear a suitte in the backoffice of prestashop
a pity it looked good

It isn't a module - it's a set of scripts. There is an additional module zip file in the directory you created and you *can* use that to link it to the admin menus but don't have to. Otherwise you can access the page you need directly via:

 

Quote

https://www.example.com/<admin-dir>/<directory-you-created>/ integrity-checks.php

 

Link to comment
Share on other sites

5 hours ago, Paul C said:

It isn't a module - it's a set of scripts. There is an additional module zip file in the directory you created and you *can* use that to link it to the admin menus but don't have to. Otherwise you can access the page you need directly via:

 

 

Thank you very much to see what I'm learning with you and the trouble you take to answer especially on Saturday.

If I know it is not a module, the translator sometimes plays, and relate that I had put it in a directory, not the installation but the url that indicated the manual does not work me yours if, it seems that the application is very good has taken me out a lot of errors.

Except for the 1 and 2 that repairs them automatically and the translations that I don't know where they came from:

Out-of-bound values
This section checks for a few keys (shop and currency) whether there are values that are not defined in their base table (like ps_shop). The list below will show the tables with id_shops that are either zero or have a non-existing id number. The format is "tablename-(zerocount;non-existcount)". Such values don't need to be problematic (in some tables a zero stands for "all"), but when you have problems it is a good idea to check them out:
Shops: configuration-(1;0)

MySQL error 1054: Unknown column 'id_shop' in 'where clause'

Link to comment
Share on other sites

That would indicate that there is a problem with the tables in the database. The best plan would be to look at all the shop tables and compare them to the structure for the default installation. On your local desktop machine download the version you're using, unzip it, and then in the directory you downloaded to (replace x.x with your version) look at:

./prestashop_1.7.x.x/presstashop/install/data/db_structure.sql

Note that this file will have table names in the form PREFIX_tablename so you can do a global replace of PREFIX with the actual prefix you use in your database (e.g. the default ps).

In phpmyAdmin run the following query:
 

SELECT
	TABLE_NAME
FROM
	information_schema.columns
WHERE
	column_name = 'id_shop';

The above should produce a list of all the tables in your install which contain the field `id_shop`.

You can then search through the db_structure.sql file and locate all the tables containing the column`id_shop` and match them up with the list you got from myphpAdmin. This should help locate any missing tables or tables which don't contain the column `id_shop` but should.

As a starter I get this list of tables if I run the above query on an empty 1.7.8.3 install:

ps_carrier_lang	
ps_cart	
ps_cart_rule_shop	
ps_cart_product	
ps_category_lang	
ps_cms_lang	
ps_cms_category_lang	
ps_cms_category_shop	
ps_configuration	
ps_configuration_kpi	
ps_connections	
ps_customer	
ps_customer_thread	
ps_customization_field_lang	
ps_delivery	
ps_employee_shop
ps_product_carrier	
ps_hook_module	
ps_hook_module_exceptions	
ps_meta_lang	
ps_module_country	
ps_module_currency	
ps_module_group	
ps_module_carrier	
ps_orders	

At the very least your query should match the above list (there may be more tables depending on your install). 

Edited by Paul C (see edit history)
Link to comment
Share on other sites

2 hours ago, Paul C said:

That would indicate that there is a problem with the tables in the database. The best plan would be to look at all the shop tables and compare them to the structure for the default installation. On your local desktop machine download the version you're using, unzip it, and then in the directory you downloaded to (replace x.x with your version) look at:

./prestashop_1.7.x.x/presstashop/install/data/db_structure.sql

Note that this file will have table names in the form PREFIX_tablename so you can do a global replace of PREFIX with the actual prefix you use in your database (e.g. the default ps).

In phpmyAdmin run the following query:
 

SELECT
	TABLE_NAME
FROM
	information_schema.columns
WHERE
	column_name = 'id_shop';

The above should produce a list of all the tables in your install which contain the field `id_shop`.

You can then search through the db_structure.sql file and locate all the tables containing the column`id_shop` and match them up with the list you got from myphpAdmin. This should help locate any missing tables or tables which don't contain the column `id_shop` but should.

As a starter I get this list of tables if I run the above query on an empty 1.7.8.3 install:

ps_carrier_lang	
ps_cart	
ps_cart_rule_shop	
ps_cart_product	
ps_category_lang	
ps_cms_lang	
ps_cms_category_lang	
ps_cms_category_shop	
ps_configuration	
ps_configuration_kpi	
ps_connections	
ps_customer	
ps_customer_thread	
ps_customization_field_lang	
ps_delivery	
ps_employee_shop
ps_product_carrier	
ps_hook_module	
ps_hook_module_exceptions	
ps_meta_lang	
ps_module_country	
ps_module_currency	
ps_module_group	
ps_module_carrier	
ps_orders	

At the very least your query should match the above list (there may be more tables depending on your install). 

if I were to delete all products and categories
to import them all from 0 would it be solved?

Link to comment
Share on other sites

2 minutes ago, RCTSH said:

if I were to delete all products and categories
to import them all from 0 would it be solved?

Not guaranteed but if you can do that then it might be worth a try. I suspect that there's a problem with the database though, not necessarily the data. Was this an upgrade or did you build a new store from scratch and are trying to populate it with data from another store?

  • Like 1
Link to comment
Share on other sites

I've been reviewing the categories in the database

they are all there but as I am not an expert in bd I send you the most strange ones I found


ps_cart_rule_shop empty

ps_category_lang I have too many in 1 and 2 https://basajaun-yopmail.tinytake.com/msc/NjU0NDg3OF8xOTA0MTQwMAps_category_lang

ps_cms_category_lang I have too many in 1 and 2 https://basajaun-yopmail.tinytake.com/msc/NjU0NDg4N18xOTA0MTQyNQ

ps_configuration https://basajaun-yopmail.tinytake.com/msc/NjU0NDg5MF8xOTA0MTQyOA

ps_connections empty

ps_customization_field_lang empty

ps_product_carrier empty

ps_hook module https://basajaun-yopmail.tinytake.com/msc/NjU0NDg5Nl8xOTA0MTQzNQ

ps_hook_module_exceptions empty

ps_meta_ lang https://basajaun-yopmail.tinytake.com/msc/NjU0NDkwMF8xOTA0MTQzOQ


ps_module_country https://basajaun-yopmail.tinytake.com/msc/NjU0NDkwMl8xOTA0

Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

1 hour ago, Paul C said:

Not guaranteed but if you can do that then it might be worth a try. I suspect that there's a problem with the database though, not necessarily the data. Was this an upgrade or did you build a new store from scratch and are trying to populate it with data from another store?

It is a store from 0 that I designed the first Andalusian company and I left it halfway.

I have always had problems that more or less I have been solving but from the beginning it seemed that I had a duplicated structure.

 I have a second store that I made to test but without any product or have the pages designed this or anything else

 I downloaded a module to export the store but in the end that module what I understood is that I only downloaded the data.

I just cleaned several viruses, and your fabulous application detects several problems but not repair any, not those of point 1 light nor those of point 2.

 

Link to comment
Share on other sites

Most of the product issues can be cleaned up easily but indicate that products have become corrupted or deletion has partially failed. If the product id is a hyperlink, then you can click it and it will bring up a product edit screen.

If you post the errors, then I can suggest possible actions you can take. The screenshots you shared earlier are fine. in the tables like "xxx_lang" they will have an entry for each language so often look like they have duplicates but they're actually just the different languages.

 

Link to comment
Share on other sites

1 hour ago, Paul C said:

Most of the product issues can be cleaned up easily but indicate that products have become corrupted or deletion has partially failed. If the product id is a hyperlink, then you can click it and it will bring up a product edit screen.

If you post the errors, then I can suggest possible actions you can take. The screenshots you shared earlier are fine. in the tables like "xxx_lang" they will have an entry for each language so often look like they have duplicates but they're actually just the different languages.

 

I run the application and I get this

https://basajaun-yopmail.tinytake.com/msc/NjU0NTExM18xOTA0MjE5Nw

Yes in all of them it takes me to the product to edit as the photo
you add it in any category and it gives you a message

screenshot of the diagnosis

https://basajaun-yopmail.tinytake.com/msc/NjU0NTExNF8xOTA0MjE5OA
you choose any category to correct the error and it tells you
No default category found. First available taken.

Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

1 minute ago, RCTSH said:

I run the application and I get this

https://basajaun-yopmail.tinytake.com/msc/NjU0NTExM18xOTA0MjE5Nw

Yes in all of them it takes me to the product to edit as the photo
you add it in any category and it gives you a message

screenshot of the diagnosis

https://basajaun-yopmail.tinytake.com/msc/NjU0NTExNF8xOTA0MjE5OA
you choose any category to correct the error and it tells you
No default category found. First available taken.

Translated with www.DeepL.com/Translator (free version)

Category Tree

Categories without valid parent:
Category tree foundation problems:
Unconnected Categories: |

Attributes

Products with non-existing attributes. The missing attribute id\'s are between brackets; if there is more than one occurrence a frequency is added between square brackets. Note that some modules change the behavior of attributes and cause innocent reports here:
PA attributes that are not in ps_attribute:

Taxes

401 products with invalid tax groups found for shop 1: view
Tax groups are considered not valid when either the tax_rules_group or the tax is not active or is flagged as deleted or the tax_rule is not defined for the default country

2 products without an assigned tax rules group found for shop 1: view

Missing Translations:

This section shows id's for which a translation is missing. No fixes for these problems yet. Usually they will harmless.
feature_value_lang with language 1: 425, 426, 861, 10091, 10095, 10096, 12948,
meta_lang with language 1: 27, 28, 32, 31, 33, 29, 30, 26,
tab_lang with language 1: 33, 48, 118,

Tables with missing indexes:

Your indexes are compared with a standard set. Some differences can be expected as not all PS/TB versions are the same.See the manual how you can create a reference for your webshop software version.
table favorite_product missing
table ganalytics missing
table layered_category missing
table layered_filter missing
table layered_filter_shop missing
table layered_indexable_attribute_group missing
table layered_indexable_attribute_group_lang_value missing
table layered_indexable_attribute_lang_value missing
table layered_indexable_feature missing
table layered_indexable_feature_lang_value missing
table layered_indexable_feature_value_lang_value missing
table layered_price_index missing
table layered_product_attribute missing
table linksmenutop missing
table linksmenutop_lang missing
table pagenotfound has 0 indexes in this shop and 2 in the reference.
table sekeyword missing
table statssearch has 0 indexes in this shop and 1 in the reference.
table wishlist missing
table wishlist_email missing
table wishlist_product missing
table wishlist_product_cart missing
Tables without a unique index: pagenotfound, statssearch
Note that cart_product and image_shop before PS 1.6.1 often didn't have a unique index.

Tables without correct auto-increase

This function checks only a few tables. Problems here are usually related to incorrectly imported tables.
No problematic tables found

Out-of-bound values

This section checks for a few keys (shop and currency) whether there are values that are not defined in their base table (like ps_shop). The list below will show the tables with id_shops that are either zero or have a non-existing id number. The format is "tablename-(zerocount;non-existcount)". Such values don't need to be problematic (in some tables a zero stands for "all"), but when you have problems it is a good idea to check them out:
Shops: configuration-(1;0)

MySQL error 1054: Unknown column 'id_shop' in 'where clause'
Generated by URL '/pctools/integrity-checks.php'
with Query 'SELECT count(*) AS rowcount FROM ps_pagenotfound WHERE id_shop=0'

Link to comment
Share on other sites

OK, the first 2 groups of errors with the long list of products are all basically caused by the same issue and it means that the default category stored in the products doesn't exist. Is this every product in your store or does your store have a lot more products then those listed? It could be that there is a single category missing or broken after the install.

If you look in the database for one of the product ids in the list you should see what the default category is (table ps_product). You can then check in the table ps_category and see if it exists in there (possibly not). You should also check the field `id_shop_default` in ps_category. Should probably be set to '1' for all products if you don't use the multi-shop feature. 

If the categories are completely missing then there's nothing you can do except recreate the category and edit each product to assign to the new category you created. If the categories all exist but have different ids then you can just edit the products (from the PrestaShop admin screen) and add the correct categories there.

I hate to say this but it looks to me like starting from scratch would be quicker.
 

Link to comment
Share on other sites

33 minutes ago, Paul C said:

OK, the first 2 groups of errors with the long list of products are all basically caused by the same issue and it means that the default category stored in the products doesn't exist. Is this every product in your store or does your store have a lot more products then those listed? It could be that there is a single category missing or broken after the install.

If you look in the database for one of the product ids in the list you should see what the default category is (table ps_product). You can then check in the table ps_category and see if it exists in there (possibly not). You should also check the field `id_shop_default` in ps_category. Should probably be set to '1' for all products if you don't use the multi-shop feature. 

If the categories are completely missing then there's nothing you can do except recreate the category and edit each product to assign to the new category you created. If the categories all exist but have different ids then you can just edit the products (from the PrestaShop admin screen) and add the correct categories there.

I hate to say this but it looks to me like starting from scratch would be quicker.
 

My shop at the beginning of the problems had 28205 products from 8 different excel.


Yesterday in ps_category I corrected the nright value to 4 and today when importing it has changed again.

https://basajaun-yopmail.tinytake.com/msc/NjU0NTEzOV8xOTA0MjI2OA

It's what I said of the 311 categories does not appear until I give you to modify and save.


By start from 0 what do you mean to delete all products and categories or to throw the whole shop?

Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

42 minutes ago, Paul C said:

OK, the first 2 groups of errors with the long list of products are all basically caused by the same issue and it means that the default category stored in the products doesn't exist. Is this every product in your store or does your store have a lot more products then those listed? It could be that there is a single category missing or broken after the install.

If you look in the database for one of the product ids in the list you should see what the default category is (table ps_product). You can then check in the table ps_category and see if it exists in there (possibly not). You should also check the field `id_shop_default` in ps_category. Should probably be set to '1' for all products if you don't use the multi-shop feature. 

If the categories are completely missing then there's nothing you can do except recreate the category and edit each product to assign to the new category you created. If the categories all exist but have different ids then you can just edit the products (from the PrestaShop admin screen) and add the correct categories there.

I hate to say this but it looks to me like starting from scratch would be quicker.
 

up to page 600 each with 25 products
are all in category 2

then from there they are in category 52 confused with the cross category and from there until 1100 they are all in their own category.

Link to comment
Share on other sites

I would remove all the products and categories at least and reset the autoincrement values in the tables. Your product id values are massive which shows that there has been a lot of stuff added and deleted from the tables. It would be easier for you to start again with a fresh install from scratch.

Product importing is and has always been a complete nightmare - which is why 3rd-party developers have made money selling product import and store manager modules. For years.

You don't need to worry about the nright and nleft fields. Those are used internally. Editing a category causes the tree to be rebuilt which is why they suddenly appear when you do that.

With import files you need to be very careful that things like category names match exactly with no spaces before or after.

Edited by Paul C (see edit history)
Link to comment
Share on other sites

8 minutes ago, Paul C said:

I would remove all the products and categories at least and reset the autoincrement values in the tables. Your product id values are massive which shows that there has been a lot of stuff added and deleted from the tables. It would be easier for you to start again with a fresh install from scratch.

Product importing is and has always been a complete nightmare - which is why 3rd-party developers have made money selling product import and store manager modules. For years.

You don't need to worry about the nright and nleft fields. Those are used internally. Editing a category causes the tree to be rebuilt which is why they suddenly appear when you do that.

With import files you need to be very careful that things like category names match exactly with no spaces before or after.

What does this mean? "Their product identification values are huge, which shows that a lot of things have been added and removed from the tables".

The problem with the imports is when it gives error in the middle of an upload without knowing where the error is, repeating the process several times.

at this rate I'm going to have to do an upload per day and if it gives error back to the backup.

Link to comment
Share on other sites

On 2/20/2022 at 11:26 PM, Paul C said:

I would remove all the products and categories at least and reset the autoincrement values in the tables. Your product id values are massive which shows that there has been a lot of stuff added and deleted from the tables. It would be easier for you to start again with a fresh install from scratch.

Product importing is and has always been a complete nightmare - which is why 3rd-party developers have made money selling product import and store manager modules. For years.

You don't need to worry about the nright and nleft fields. Those are used internally. Editing a category causes the tree to be rebuilt which is why they suddenly appear when you do that.

With import files you need to be very careful that things like category names match exactly with no spaces before or after.

Regarding MySQL error 1054, it refers to a field that does not exist.

The field "id_shop" does not appear. The closest is in these screenshots is the field "id_shop_default".

Do you have a simple way to fix it?

Link to comment
Share on other sites

On 2/20/2022 at 9:02 PM, RCTSH said:

MySQL error 1054: Unknown column 'id_shop' in 'where clause'
Generated by URL '/pctools/integrity-checks.php'
with Query 'SELECT count(*) AS rowcount FROM ps_pagenotfound WHERE id_shop=0'

Do you mean the above? It refers to a table that belongs to a module. In the back office does the modules page work? If it does you should maybe uninstall any modules in there that you don't immediately need to just import and maintain your products.

I think earlier I said you should look through all the tables and make sure that id_shop and/or id_shop_default  and/or id_shop_group is set correctly - they should most likely be set = 1 everywhere when not using the multi-shop feature.

Try just removing that specific module though and see what error appears next (if any). Did you manage to fix the errors with the products and categories ok?

Link to comment
Share on other sites

I have deleted all products and categories.
Evidently the first two points of failures have disappeared. The errors of the categories and the tables have not.

these errors are not indicated to me.

 

 

Tables with missing indexes:

Your indexes are compared with a standard set. Some differences can be expected as not all PS/TB versions are the same.See the manual how you can create a reference for your webshop software version.
table favorite_product missing
table ganalytics missing
table layered_category missing
table layered_filter missing
table layered_filter_shop missing
table layered_indexable_attribute_group missing
table layered_indexable_attribute_group_lang_value missing
table layered_indexable_attribute_lang_value missing
table layered_indexable_feature missing
table layered_indexable_feature_lang_value missing
table layered_indexable_feature_value_lang_value missing
table layered_price_index missing
table layered_product_attribute missing
table linksmenutop missing
table linksmenutop_lang missing
table pagenotfound has 0 indexes in this shop and 2 in the reference.
table sekeyword missing
table statssearch has 0 indexes in this shop and 1 in the reference.
table wishlist missing
table wishlist_email missing
table wishlist_product missing
table wishlist_product_cart missing
Tables without a unique index: pagenotfound, statssearch
Note that cart_product and image_shop before PS 1.6.1 often didn't have a unique index

Link to comment
Share on other sites

All of those tables should have been created during the install/upgrade process and are related to the standard modules shipped with Prestashop. Even the ones that do exist have missing indexes. They are not, in themselves an issue as they are all optional (unless you need them for your store) though.

If you go to Configure -> Advanced Parameters -> Information it should tell you if the core installation is damaged.

Link to comment
Share on other sites

10 minutes ago, Paul C said:

All of those tables should have been created during the install/upgrade process and are related to the standard modules shipped with Prestashop. Even the ones that do exist have missing indexes. They are not, in themselves an issue as they are all optional (unless you need them for your store) though.

If you go to Configure -> Advanced Parameters -> Information it should tell you if the core installation is damaged.

I am having a hard time entering information, I have been doing it for a long time and it does not enter.

If I did a manual installation again with the same version, would it work?

Link to comment
Share on other sites

23 minutes ago, Paul C said:

All of those tables should have been created during the install/upgrade process and are related to the standard modules shipped with Prestashop. Even the ones that do exist have missing indexes. They are not, in themselves an issue as they are all optional (unless you need them for your store) though.

If you go to Configure -> Advanced Parameters -> Information it should tell you if the core installation is damaged.

I think prestashop is mixing installations
I have 2, the main one and the backup one without any articles or anything that I did for an experiment of the theme and to mount a cdn, I just installed it and installed the theme and nothing else.

In info it said that there were 2 missing files located in the other prestashop's directory.

I will check again and if so I will do a manual installation.


Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

Hi! I has been long time since I have this issue so I can't recall how I exactly fixed it. But I do recall that for avoiding this kind of issues in later attempts, instead of upgrading directly to latest version I upgraded it to some newer versions at the time by downloading the versions from https://www.prestashop.com/en/versions and using the "upgrade from file" option from the back office. Ie: for going from 1.5 to 1.7 I went -> 1.5.5 -> 1.6 -> 1.6.5 -> 1.7.

Link to comment
Share on other sites

4 hours ago, Coluccini said:

Hi! I has been long time since I have this issue so I can't recall how I exactly fixed it. But I do recall that for avoiding this kind of issues in later attempts, instead of upgrading directly to latest version I upgraded it to some newer versions at the time by downloading the versions from https://www.prestashop.com/en/versions and using the "upgrade from file" option from the back office. Ie: for going from 1.5 to 1.7 I went -> 1.5.5 -> 1.6 -> 1.6.5 -> 1.7.

well in this case it's not possible I started on 1.7.4
 they left me something wrong from the beginning
I think I have identified the break day as 8 but my server only keeps 7 days of backup.
there must be some way to repair it even if you lose the products.
i am deactivating plugins and trying to reinstall 1.7.8.3
manually but let's see...

Link to comment
Share on other sites

<p>MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND id_lang=1 LIMIT 1' at line 1<br>Generated by URL '/pctools/integrity-repair.php'<br>with Query 'SELECT * FROM ps_category_lang WHERE id_category= AND id_lang=1 LIMIT 1' <p>

Link to comment
Share on other sites

1 hour ago, RCTSH said:

<p>MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND id_lang=1 LIMIT 1' at line 1<br>Generated by URL '/pctools/integrity-repair.php'<br>with Query 'SELECT * FROM ps_category_lang WHERE id_category= AND id_lang=1 LIMIT 1' <p>

I suspect that the table ps_category_shop has a record with id_shop either 0 or NULL (blank). You should also check that "PS_SHOP_DEFAULT" is set to 1 in ps_configuration.

Edited by Paul C (see edit history)
Link to comment
Share on other sites

7 hours ago, Paul C said:

I suspect that the table ps_category_shop has a record with id_shop either 0 or NULL (blank). You should also check that "PS_SHOP_DEFAULT" is set to 1 in ps_configuration.

Thank you very much

When I was already desperate, I think your suspicions have hit the nail on the head.
although the ps_category_shop table is fine, the ps_configuration category is all null.
I was going to change it to 1 but it's 22oo records.
is there a simple way to set them all to 1
I send you screenshots of both things

ps_category_shop t

https://basajaun-yopmail.tinytake.com/msc/NjU1NDU1NV8xOTA1NzE3Ng

 

ps_configuration

https://basajaun-yopmail.tinytake.com/msc/NjU1NDU0MV8xOTA1NzE2MQ

 

 

 

imagen.png

imagen.png

Link to comment
Share on other sites

The NULL values in the ps_configuration table are fine - it means that the configuration applies to ALL shops and ALL shop groups. You need to look in the `name` field in that table to find PS_SHOP_DEFAULT (you can use the Search tab) and for that record check that the `value` field is set to 1.

Link to comment
Share on other sites

14 minutes ago, Paul C said:

The NULL values in the ps_configuration table are fine - it means that the configuration applies to ALL shops and ALL shop groups. You need to look in the `name` field in that table to find PS_SHOP_DEFAULT (you can use the Search tab) and for that record check that the `value` field is set to 1.

I send you a screenshot of what I get
I don't know if it's ok...

Sin título-1.jpg

Link to comment
Share on other sites

OK the configuration looks fine.

Did you say that you had deleted all the categories? If so the ps_category and ps_category_XXX tables should only have 2 records each. Perhaps more in ps_category_group table (default would be the 3 customer groups I think).

Link to comment
Share on other sites

I don't even know where I am yesterday I did a restore trying to go back to day 5 but I didn't get it.

I have deleted and regenerated them several times
even once I deleted all categories and products.

but I can't fix anything so at least you can see the products until I change everything.

if you want I delete them again

I have returned to 1.82 and I am checking that all the files are ok before upgrading to 1.83.


Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

Sorry I haven't been able to find the magic bullet for you. It's hard not being able to see the database, error logs etc. :D

If you have a working store pre-upgrade, then I'd maybe suggest using a paid module to move the products, orders etc. into an empty new install of the latest version. I've only ever used one (which I used to synchronise a staging site) and that was this one: 

https://addons.prestashop.com/en/data-migration-backup/48067-prestashop-migration-tool-upgrade-or-migrate-to-17.html

It did what I needed it to do at that time but that might not be the case for you! It does require you to have both the old and new stores running at the same time.

Link to comment
Share on other sites

You are a great person and I appreciate enormously everything you are helping me, even if we have not been successful yet.
For me the problem is not to pass the products, it is long but it is something known
the problem is to lose all the design details the static pages created and all that I would lose if I start from 0.

Link to comment
Share on other sites

1 minute ago, RCTSH said:

You are a great person and I appreciate enormously everything you are helping me, even if we have not been successful yet.
For me the problem is not to pass the products, it is long but it is something known
the problem is to lose all the design details the static pages created and all that I would lose if I start from 0.

These modules can move over almost all of your data (at least all that you need) and you can always export the theme on the old store and import it into the new one. In theory all you should lose is unnecessary junk.

Link to comment
Share on other sites

so I will test it in a subdirectory
I will install prestashop the theme and see what it recovers the same if all the gprd pages appear and everything else is ok for me.

it seems that we have solved theproblem
the step from 1.82 to 1.82 desamrcando the fourth box has made to appear all categories and two extra categories undesirable
when I delete them I get error 500 and it hangs like when I rebuild the index with a lot of products.
I'm going to reinstall all categories and keep looking but now looks better

Translated with www.DeepL.com/Translator (free version)

Link to comment
Share on other sites

  • 3 months later...
Quote

 

1.7.8 An unexpected error occurred. 

PrestaShop\PrestaShop\Core\Domain\Category\Exception\CategoryException code 0: Invalid data for updating category root

 

Solution

"Home" category has ID 2 (default) and is_root_category = 1, id_parent = 1 in category table.

Screenshot from 2022-06-28 22-33-31.png

If you could change the default category name "Home" to "Home Page" (or other names except "Home") , could save without error. Then return "Home Page" to "Home". After that, you could save without error, even if the name is "Home".

Screenshot from 2022-06-28 22-31-06.png

Edited by ficusonlinestore (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
On 8/11/2019 at 4:40 AM, Cawe said:

I think I find the solution. You have to create new root category in you data base. 

Probably, my solution is same as the above post.

Only when I edit "Home" category, this error occuered. So, changed "Home" to "Home Page", then this error is disappered.

I wanted the root category name to define as "Home", returned "Home Page" back to "Home".

That's it.

Am I misunderstanding for this topic? 

Edited by ficusonlinestore (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Good Day Guys

I m really surprise about this issue:

Prestashop Store : 1.7.8.10

i m unable to delete products as well i mean product will be deleted but i always get error so in debug Mode i found the following error:

AdminProductDataUpdater->deleteProduct() received an unknown ID.[Exception 5005]

 public function deleteProduct($productId)
    {
        $product = new Product($productId);
        if (!Validate::isLoadedObject($product)) {
            throw new \Exception('AdminProductDataUpdater->deleteProduct() received an unknown ID.', 5005);
        }
        // dumb? no: delete() makes a lot of things, and can reject deletion in specific cases.
        // Hooks: will trigger actionProductDelete
        $result = $product->delete();

I kindly ask if above mentioned error can be even involved by Cloudflare service

Thanks in adevance

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...