Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexStatsProvider::sizeFormatted() must be of the type string, null returned #1865

Closed
jocielandrade opened this issue Jun 27, 2020 · 10 comments
Assignees
Labels

Comments

@jocielandrade
Copy link

Preconditions

Magento Version : Magento Cloud 2.3
ElasticSuite Version : 2.9.0
Environment : Developer
Third party modules : None

Steps to reproduce

  1. On Admin, open ELASTICSUITE > System > Indices

Expected result

  1. The system list indices

Actual result

  1. The system shows:

Fatal error: Uncaught TypeError: Return value of Smile\ElasticsuiteIndices\Model\IndexStatsProvider::sizeFormatted() must be of the type string, null returned in /app/vendor/smile/elasticsuite/src/module-elasticsuite-indices/Model/IndexStatsProvider.php:170 Stack trace: #0 /app/vendor/smile/elasticsuite/src/module-elasticsuite-indices/Model/IndexStatsProvider.php(126): Smile\ElasticsuiteIndices\Model\IndexStatsProvider->sizeFormatted(NULL) #1 /app/vendor/smile/elasticsuite/src/module-elasticsuite-indices/Model/ResourceModel/Index/Collection.php(85): Smile\ElasticsuiteIndices\Model\IndexStatsProvider->indexStats('magento2_mexico...', NULL) #2 /app/vendor/magento/framework/Data/Collection.php(691): Smile\ElasticsuiteIndices\Model\ResourceModel\Index\Collection->loadData(false, false) #3 /app/vendor/magento/framework/Data/Collection.php(333): Magento\Framework\Data\Collection->load() #4 /app/vendor/smile/elasticsuite/src/module-elasticsuite-indices/Model/Index/Collection.php(87): Magento\Framework\Data\Collection->getItems() in /app/vendor/smile/elasticsuite/src/module-elasticsuite-indices/Model/IndexStatsProvider.php on line 170

@androshchuk androshchuk self-assigned this Jun 29, 2020
@androshchuk
Copy link
Contributor

Hello @jocielandrade
Could you provide your Elasticsearch Server version?

@jocielandrade
Copy link
Author

jocielandrade commented Jun 29, 2020

Follow:
curl elasticsearch.internal:9200
{ "name" : "ZhWtrg2", "cluster_name" : "elasticsearch", "cluster_uuid" : "UmjCapzPRi-yuR6JjsObRA", "version" : { "number" : "6.5.4", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "82a8aa7", "build_date" : "2019-01-23T12:07:18.760675Z", "build_snapshot" : false, "lucene_version" : "7.5.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }

@androshchuk
Copy link
Contributor

I can't reproduce it in my environment.
Can you provide me the output of $indexStats array for the problem index in this line
https://github.com/Smile-SA/elasticsuite/blob/2.9.x/src/module-elasticsuite-indices/Model/IndexStatsProvider.php#L125 ?

Regards

@romainruaud
Copy link
Collaborator

Maybe there is something different on Magento Cloud hosted Elasticsearch server that would make the response being different ?

@davidandersson1
Copy link

Hello @androshchuk

We have same issue and we are using magento version 2.3.5 and elastic suite version 2.9.1

As per your above question for output of $indexStats array, in my case its completely empty output of this line
https://github.com/Smile-SA/elasticsuite/blob/2.9.x/src/module-elasticsuite-indices/Model/IndexStatsProvider.php#L125

We are using separate elastic server and defined in "Elasticsearch Servers List" like 178.33.4.248:9200

Is there anything else that would help us to sort out the issue.

Can you please provide your view for same.

Thanks,
David

@androshchuk
Copy link
Contributor

Hello @davidandersson1

Unfortunately, I was never able to reproduce this error.
I can only suggest this solution androshchuk@eb43423

Regards

@davidandersson1
Copy link

Hi @androshchuk

Thanks, it's work with above suggested solution and i can Indices with Index status.

Some index status with EXTERNAL, some with GHOST and some with LIVE.

So what does it means exactly? is it fine if we remove Indices with status "EXTERNAL"?

Can you please provide your view for the same.

Thanks,
David

@romainruaud
Copy link
Collaborator

Please read the original feature/issue ticket : #1606

Quick recap :

  • live indices : they are actually used by your website, cannot be deleted (the delete action is not visible/possible)
  • external indices : they are not belonging to your website (they have a different alias, or no alias at all, or even not related with Elasticsuite), cannot be deleted (the delete action is not visible/possible)
  • ghost indices : indices belonging to your website but that never finished indexing properly, they can be safely deleted through the admin panel.

@davidandersson1
Copy link

Hi @romainruaud

Thanks for your reply.

I understand about external indices like we are not able to delete through back office and they are not belonging to website.

But somehow if we have to delete those external indices forcefully then is it good to use below syntax?

curl -XDELETE http://localhost:9200/{Index Title}

Where {Index Title} same as display on back office grid.

Thanks,
David Andersson

@no-response
Copy link

no-response bot commented Jul 23, 2020

This issue was waiting update from the author for too long.
Without any update, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants