Closed ccchapman closed 1 year ago
What sort of request of action are you doing when seeing this error @ccchapman?
@janhenckens I believe it was for every single web request.
Hello I think we are experiencing this issue as well, is there any chance for a fix for this anytime soon? We've just upgraded to Craft 4. Can provide any info necessary, I've just reached the conclusion that Scout is causing the errors. Technically we get a pretty long log entry in our web.log file related to this ElementQuery error in almost every second.
Here is stack trace of one request:
[{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/elements/db/ElementQuery.php","line":1242,"function":"warning","class":"yii\\BaseYii","type":"::"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/db/Query.php","line":275,"function":"one","class":"yii\\db\\Query","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/elements/db/ElementQuery.php","line":1506,"function":"one","class":"craft\\db\\Query","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/elements/User.php","line":527,"function":"one","class":"craft\\elements\\db\\ElementQuery","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/web/User.php","line":489,"function":"renewAuthStatus","class":"yii\\web\\User","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/web/User.php","line":204,"function":"getIsGuest","class":"yii\\web\\User","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/services/Sites.php","line":1237,"function":"getIsGuest","class":"craft\\web\\User","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/services/Sites.php","line":417,"function":"_allSites","class":"craft\\services\\Sites","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/elements/db/ElementQuery.php","line":880,"function":"getAllSiteIds","class":"craft\\services\\Sites","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/config/scout.php","line":26,"function":"site","class":"craft\\elements\\db\\ElementQuery","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/studioespresso/craft-scout/src/ScoutIndex.php","line":56,"function":"{closure}","class":"craft\\services\\Config","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/config/scout.php","line":29,"function":"criteria","class":"rias\\scout\\ScoutIndex","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/services/Config.php","line":289,"function":"include"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/services/Config.php","line":281,"function":"_configFromFileInternal","class":"craft\\services\\Config","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/services/Plugins.php","line":934,"function":"getConfigFromFile","class":"craft\\services\\Config","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/services/Plugins.php","line":228,"function":"createPlugin","class":"craft\\services\\Plugins","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/base/ApplicationTrait.php","line":1494,"function":"loadPlugins","class":"craft\\services\\Plugins","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/web/Application.php","line":105,"function":"_postInit","class":"craft\\web\\Application","type":"->"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/src/Craft.php","line":53,"function":"createObject","class":"yii\\BaseYii","type":"::"},{"file":"/home/748786.cloudwaysapps.com/xnpnrkejxu/public_html/vendor/craftcms/cms/bootstrap/bootstrap.php","line":252,"function":"createObject","class":"Craft","type":"::"}],"memory":8090352}
You should be able to get the fix for now by using the develop branch, as:
"studioespresso/craft-scout": "develop as 3.0.0",
It would be nice to have this change tagged as a beta version as the logs are quite noisy. Also the develop branch has the requirement as Craft 4.3, which I'm not sure is actually required. I'm working on upgrading to Craft 4 now as well, to get some of the deadlock fixes.
Hey everyone, sorry about the delay, I had the fix ready on develop but totally forgot to make a release for it. I just tagged 3.1.0 which includes this fix.
The fix referenced here was added in Craft 4.3.5 so I'm bumping the minimum version for this release to that.
A warning can be logged when the
ScoutIndex::criteria
calls$query->site()
.config/scout.php
storage/logs/web.log
Refs