ElasticSearch Essentials

ElasticSearch Essentials [Paid] 3.15.12

No permission to buy ($30.00)
got this after update

Журнал ошибок сервера
  • ErrorException: Template error: [E_WARNING] Invalid argument supplied for foreach()
  • src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php:96

Трассировка стека​

Code:
#0 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(96): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Inv...', '/var/www/admin/...', 96, Array)
#1 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(75): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadIdsFromEss(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#2 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(55): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadFromEss(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#3 src/addons/XFES/Widget/SimilarThreads.php(61): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadsCache(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#4 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(38): XFES\Widget\SimilarThreads->render()
#5 internal_data/code_cache/widgets/_41_xfes_thread_view_below_quick_reply_similar_threads.php(5): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->render()
#6 src/XF/Template/Templater.php(7722): XF\SubContainer\Widget->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, Array)
#7 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#8 src/XF/Template/Templater.php(1939): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#9 internal_data/code_cache/templates/l9/s14/public/thread_view.php(1407): XF\Template\Templater->widgetPosition('sv_thread_view_...', Array)
#10 src/XF/Template/Templater.php(1654): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#11 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
#12 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#13 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#14 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#17 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#18 src/XF.php(524): XF\App->run()
#19 index.php(20): XF::runApp('XF\\Pub\\App')
#20 {main}
 
Ooops, typed the version. I've updated it but notifications will be wrong.

got this after update

Журнал ошибок сервера
  • ErrorException: Template error: [E_WARNING] Invalid argument supplied for foreach()
  • src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php:96
I think this bug has existed before the 3.15.6 update, and could have occured during an update for previous version. Should be fixed however
 
@Xon why Index are automatically deleted? ES Version: 8.8.2

Server error log

Code:
XFES\Elasticsearch\RequestException: Elasticsearch error: no such index [nadda_forumdata] DSL:{"sort":["_score",{"date":"desc"}],"docvalue_fields":["discussion_id","user","date"],"_source":false,"size":10,"query":{"bool":{"filter":[{"term":{"type":"thread"}}],"must_not":[{"exists":{"field":"hidden"}},{"term":{"node":93}},{"term":{"thread":7493}}],"must":[{"function_score":{"query":{"multi_match":{"type":"most_fields","query":"\u0986\u09ae\u09be\u09b0 \u09ac\u09cc \u09ac\u09dc\u09cb \u099a\u09cb\u09a6\u09a8\u0996\u09cb\u09b0 \u2013 \u0997\u09cb\u09aa\u09be\u09b0 \u099a\u09cb\u09a6\u09be\u099a\u09c1\u09a6\u09bf","operator":"or","fields":["title","elasticess_title","title.exact^1.5"]}},"functions":[{"exp":{"date":{"origin":1690023003,"decay":0.5,"scale":31536000}}},{"filter":{"term":{"node":91}},"weight":1.5}]}}]}}} src/addons/XFES/Elasticsearch/Api.php:424

    Generated by: Beral Jul 22, 2023 at 4:50 PM

Stack trace

#0 src/addons/XFES/Elasticsearch/Api.php(338): XFES\Elasticsearch\Api->request('get', 'nadda_forumdata...', '{
    "sort": [...')
#1 src/addons/XFES/Elasticsearch/Api.php(236): XFES\Elasticsearch\Api->requestFromIndex('get', '_search', Array)
#2 src/addons/SV/SearchImprovements/XFES/Elasticsearch/Api.php(34): XFES\Elasticsearch\Api->search(Array)
#3 src/addons/XFES/Search/Source/Elasticsearch.php(750): SV\SearchImprovements\XFES\Elasticsearch\Api->search(Array)
#4 src/addons/SV/SearchImprovements/XFES/Search/Source/Elasticsearch.php(297): XFES\Search\Source\Elasticsearch->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, 10)
#5 src/addons/XFES/Search/Source/Elasticsearch.php(145): SV\SearchImprovements\XFES\Search\Source\Elasticsearch->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), Array, 10)
#6 src/XF/Search/Search.php(185): XFES\Search\Source\Elasticsearch->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10)
#7 src/XF/Search/Search.php(214): XF\Search\Search->XF\Search\{closure}(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10)
#8 src/addons/SV/ElasticSearchEssentials/XF/Search/Search.php(45): XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10, Object(Closure), true)
#9 src/XF/Search/Search.php(180): SV\ElasticSearchEssentials\XF\Search\Search->executeSearch(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10, Object(Closure), true)
#10 src/addons/SV/ElasticSearchEssentials/Service/AutoCompleter.php(506): XF\Search\Search->search(Object(SV\ElasticSearchEssentials\XF\Search\Query\KeywordQuery), 10, true)
#11 src/addons/SV/ElasticSearchEssentials/Service/SimilarContentFinder.php(357): SV\ElasticSearchEssentials\Service\AutoCompleter->getResults()
#12 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(94): SV\ElasticSearchEssentials\Service\SimilarContentFinder->getSimilarContents()
#13 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(75): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadIdsFromEss(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#14 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(55): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadFromEss(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#15 src/addons/XFES/Widget/SimilarThreads.php(61): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->getSimilarThreadsCache(Object(SV\SearchImprovements\XF\Entity\ThreadCollab))
#16 src/addons/SV/ElasticSearchEssentials/XFES/Widget/SimilarThreads.php(38): XFES\Widget\SimilarThreads->render()
#17 internal_data/code_cache/widgets/_75_xfes_thread_view_below_quick_reply_similar_threads.php(5): SV\ElasticSearchEssentials\XFES\Widget\SimilarThreads->render()
#18 src/XF/Template/Templater.php(7722): XF\SubContainer\Widget->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, Array)
#19 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#20 src/XF/Template/Templater.php(1939): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#21 internal_data/code_cache/templates/l1/s6/public/thread_view.php(1116): XF\Template\Templater->widgetPosition('thread_view_bel...', Array)
#22 src/XF/Template/Templater.php(1654): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#23 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
#24 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#25 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#26 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#27 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#28 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#29 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#30 src/XF.php(524): XF\App->run()
#31 index.php(20): XF::runApp('XF\\Pub\\App')
#32 {main}

Request state

array(4) {
  ["url"] => string(14) "/threads/7493/"
  ["referrer"] => string(57) "/forums/collected.91/page-133"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
If a search index occurs between the delete & create this is the expected error.

This is likely stock behavior when you optimize or rebuild an index with deleting it. XenForo deletes the index and then creates it, this is required to change a number of elasticsearch schema options.
 
If a search index occurs between the delete & create this is the expected error.

This is likely stock behavior when you optimize or rebuild an index with deleting it. XenForo deletes the index and then creates it, this is required to change a number of elasticsearch schema options.

Yes I know that but when new rebuild is completed then this index will be deleted automatically without doing anything.
 
None of my add-ons would delete the index without explicitly done so by an admin.

If the "optimize now" button keeps popping up, expand the "Elastic Search Type mappings" on the index page and check what is in red. This means an add-on has submitted data to the index which has resulted in an unexpected type miss-match.
 
If the "optimize now" button keeps popping up, expand the "Elastic Search Type mappings" on the index page and check what is in red. This means an add-on has submitted data to the index which has resulted in an unexpected type miss-match.

lot of red but after rebuild this red are gone. Please note, I am using PHP version 8.2.8

oBgMm3B.png
 
Last edited:
This type mapping display is just displaying what XenForo is doing to determine the 'optimize now' button to display.

It is possible there is an add-on incorrectly extending some of the search infrastructure and failing to define the items to be put into the elasticsearch index before they are inserted.
 
Autocomplete works with @Bob's AMS, but doesn't support his other add-ons. Contact me if you are interested in add-on autocomple (or similar content for that matter) for his other add-ons.
Is this an issue with this add-on, or with Bob's AMS?

Code:
ErrorException: Template error: [E_USER_WARNING] Method canViewArticleAttachments is not callable on the given object (SV\ElasticSearchEssentials\XenAddons\AMS\Entity\ArticleItem) src/XF/Template/Templater.php:1189
Generated by: Unknown account July 26, 2023 at 9:03 AM
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/nginx/dom...', 1189)
#1 src/XF/Template/Templater.php(1189): trigger_error('Method canViewA...', 512)
#2 internal_data/code_cache/templates/l1/s20/public/xa_ams_article_wrapper_macros.php(24): XF\Template\Templater->method(Object(SV\ElasticSearchEssentials\XenAddons\AMS\Entity\ArticleItem), 'canViewArticleA...', Array)
#3 src/XF/Template/Templater.php(827): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, NULL)
#4 internal_data/code_cache/templates/l1/s20/public/xa_ams_thread_view_type_article.php(31): XF\Template\Templater->callMacro('xa_ams_article_...', 'header', Array, Array)
#5 src/XF/Template/Templater.php(990): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#6 src/XF/Template/Templater.php(926): XF\Template\Templater->renderExtensionInternal('content_top', Array, Array, Object(XF\Template\ExtensionSet))
#7 internal_data/code_cache/templates/l1/s20/public/thread_view.php(812): XF\Template\Templater->renderExtension('content_top', Array, Object(XF\Template\ExtensionSet))
#8 src/XF/Template/Templater.php(1654): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#9 src/XF/Template/Templater.php(1645): XF\Template\Templater->renderTemplate('thread_view', Array, true, Object(XF\Template\ExtensionSet))
#10 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xa_ams_thread_v...', Array)
#11 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#12 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XenAddons\\AMS:T...', 'public:xa_ams_t...', Array)
#13 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#14 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#16 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#17 src/XF.php(524): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}
Request state
array(4) {
  ["url"] => string(66) "/threads/setting-up-an-orange-pi-3-lts-with-ekos-indi-kstars.9316/"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/threads/setting-up-an-orange-pi-3-lts-with-ekos-indi-kstars_9316/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

I've gotten this several times over the last few days... since I installed the recent update.
 
Is this an issue with this add-on, or with Bob's AMS?

Code:
ErrorException: Template error: [E_USER_WARNING] Method canViewArticleAttachments is not callable on the given object (SV\ElasticSearchEssentials\XenAddons\AMS\Entity\ArticleItem) src/XF/Template/Templater.php:1189
Generated by: Unknown account July 26, 2023 at 9:03 AM
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', '/home/nginx/dom...', 1189)
#1 src/XF/Template/Templater.php(1189): trigger_error('Method canViewA...', 512)
#2 internal_data/code_cache/templates/l1/s20/public/xa_ams_article_wrapper_macros.php(24): XF\Template\Templater->method(Object(SV\ElasticSearchEssentials\XenAddons\AMS\Entity\ArticleItem), 'canViewArticleA...', Array)
#3 src/XF/Template/Templater.php(827): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, NULL)
#4 internal_data/code_cache/templates/l1/s20/public/xa_ams_thread_view_type_article.php(31): XF\Template\Templater->callMacro('xa_ams_article_...', 'header', Array, Array)
#5 src/XF/Template/Templater.php(990): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#6 src/XF/Template/Templater.php(926): XF\Template\Templater->renderExtensionInternal('content_top', Array, Array, Object(XF\Template\ExtensionSet))
#7 internal_data/code_cache/templates/l1/s20/public/thread_view.php(812): XF\Template\Templater->renderExtension('content_top', Array, Object(XF\Template\ExtensionSet))
#8 src/XF/Template/Templater.php(1654): XF\Template\Templater->{closure}(Object(SV\WarningImprovements\XF\Template\Templater), Array, Object(XF\Template\ExtensionSet))
#9 src/XF/Template/Templater.php(1645): XF\Template\Templater->renderTemplate('thread_view', Array, true, Object(XF\Template\ExtensionSet))
#10 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('xa_ams_thread_v...', Array)
#11 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#12 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XenAddons\\AMS:T...', 'public:xa_ams_t...', Array)
#13 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#14 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#16 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#17 src/XF.php(524): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}
Request state
array(4) {
  ["url"] => string(66) "/threads/setting-up-an-orange-pi-3-lts-with-ekos-indi-kstars.9316/"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/threads/setting-up-an-orange-pi-3-lts-with-ekos-indi-kstars_9316/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

I've gotten this several times over the last few days... since I installed the recent update.
That is due to outdated template(s). Method canViewArticleAttachments is not callable <--- that is because the Method changed to canViewAttachments in the Article Entity and you have outdated template(s) that didn't properly merge the template change(s) that call the new method.
 
That is due to outdated template(s). Method canViewArticleAttachments is not callable <--- that is because the Method changed to canViewAttachments in the Article Entity and you have outdated template(s) that didn't properly merge the template change(s) that call the new method.
Thanks... no outdated templates shown so that may be what was throwing me off...

Screen Shot 2023-07-27 at 9.58.02 AM.png
Will go in and start checking. First step... rebuild the master data for AMS.

I wonder... this also started after I added the FF AMS Enhancements add-on.

EDIT:
And there is the apparent culprit

Screen Shot 2023-07-27 at 10.11.39 AM.png

Thread posted in the add-on.
 
Last edited:
This type mapping display is just displaying what XenForo is doing to determine the 'optimize now' button to display.

It is possible there is an add-on incorrectly extending some of the search infrastructure and failing to define the items to be put into the elasticsearch index before they are inserted.

Today also deleted index after 3 days rebuild completed.

From Elasticsearch support: It looks like you have made your cluster available to external hosts without having enabled security. This is very bad as anyone can access your cluster and do anything with it, e.g. delete all data. You should look to secure your cluster immediately.

But Xenforo does not support enabled security: https://xenforo.com/community/threads/elasticsearch-version-8-0-0.203227/
 
You absolutely should not have elasticsearch open to the internet. The easiest way is to bind it to localhost and not a public IP.
 
Top Bottom