pim-community-dev
pim-community-dev copied to clipboard
Products page error on loadDataGrid. Unexpected end of JSON input
🐛 I'm reporting a Bug 🐛
When i try to access to products listing page, i have a javascript error that makes the page inaccessible.
the error :
VM15892:1 Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at child.loadDataGrid (table.js:67) at fire (jquery.js:3291) at Object.fireWith [as resolveWith] (jquery.js:3421) at done (jquery.js:9523) at XMLHttpRequest.<anonymous> (jquery.js:9775)
the function concerned (in table.js line 67) :
$("#grid-".concat(gridName)).data({ metadata: resp.metadata, data: JSON.parse(resp.data) });
The problem is that, at this time, resp.data is an empty string. That's why i have got an error.
After an investigation, i found that the empty string comes from this call :
http://localhost:8080/datagrid/product-grid/load?dataLocale=fr_FR¶ms%5BdataLocale%5D=fr_FR&product-grid%5B_parameters%5D%5Bview%5D%5Bcolumns%5D=identifier%2Cimage%2Clabel%2Cfamily%2Cenabled%2Ccompleteness%2Ccreated%2Cupdated%2Ccomplete_variant_products%2Csuccess%2C%5Bobject+Object%5D
Maybe it's because of the object param at the end of query. I don't know what's going on here and why do I have an empty string as response while I have products created
I'm using CE version 4.032 through Docker install. I have done several things since install (adding categories, attributes, families, and add product model with two variations) it was working well and then boom 💥
Oups did not want to close issue 😅 I found something that could be linked to my problem ! When I try to export products I have the error below :
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [akeneo_pim_product_and_product_model]","resource.type":"index_or_alias","resource.id":"akeneo_pim_product_and_product_model","index_uuid":"_na_","index":"akeneo_pim_product_and_product_model"}],"type":"index_not_found_exception","reason":"no such index [akeneo_pim_product_and_product_model]","resource.type":"index_or_alias","resource.id":"akeneo_pim_product_and_product_model","index_uuid":"_na_","index":"akeneo_pim_product_and_product_model"},"status":404}
have you found a solution to this?
Facing the exact same problem, any solution ?
Hey,
you can try to reset the elasticsearch index.
php bin/console akeneo:elasticsearch:reset-indexes --env=prod && \
php bin/console pim:product-model:index --all --env=prod && \
php bin/console pim:product:index --all --env=prod
@Flou21 that did the trick for me, thanks a lot!
still facing the issue
after running
php bin/console akeneo:elasticsearch:reset-indexes --env=prod &&
php bin/console pim:product-model:index --all --env=prod &&
php bin/console pim:product:index --all --env=prod
please help
Hey,
you can try to reset the elasticsearch index.
php bin/console akeneo:elasticsearch:reset-indexes --env=prod && \ php bin/console pim:product-model:index --all --env=prod && \ php bin/console pim:product:index --all --env=prod
@Flou21, I try this but unfortunatly it's showing same issues.
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [updated] in order to sort on","index_uuid":"tk-xk1DZTnunk9AWaqgjsA","index":"akeneo_pim_product_and_product_model"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"akeneo_pim_product_and_product_model","node":"ckW_Yf5cR92yebvAXEBAVA","reason":{"type":"query_shard_exception","reason":"No mapping found for [updated] in order to sort on","index_uuid":"tk-xk1DZTnunk9AWaqgjsA","index":"akeneo_pim_product_and_product_model"}}]},"status":400}