-
Re: Instant Search
Using Zen Cart 1.58a and PHP 8.1 I have occasionally seen huge numbers of the following error logged, usually within the space of 1 or 2 seconds:
Code:
PHP Warning: mysqli_connect(): (42000/1203): User saabcom_zencart already has more than 'max_user_connections' active connections in /home/saabcom/saabits.com/includes/classes/db/mysql/query_factory.php on line 76.
When this happens, of course the user sees nddbc.html ("problem connecting to our database") and can't do anything.
Sometimes there is more information showing which function was trying to access the database but it varies and I'm not sure any of them are relevant. It looks like something is hitting the database really hard and locking everything else out. I have the Typesense plug-in installed and I'm not sure if that is the culprit or not. I wondered if the full-sync was doing it since we have about 18,000 products and that's a fair amount of data to look up. However, last night's episode was at 00:42 while the last full-sync was at 05:45. Full-sync is set to run every 12 hours.
-
Re: Instant Search
>more than 'max_user_connections' active connections
https://github.com/zencart/zencart/issues/1344
I also get this error occasionally. The raw access logs show a legitimate IP.
my max_user_connections is 25, set by the hosting.
I was until recently on a over-specified VPS, but I'd set this to 25 for a long time, as a test, with no occurrences, so reverted to shared hosting. Now I've had a couple of cases in the last two weeks.
-
Re: Instant Search
Barebones 2.0.1 with PHP 8.2 but had the same problem elsewhere with other versions.
Latest Instant Search from Plugins 4.0.3
example at topkDOTjeandretDOTcom
Enter Phase3 in the search set for model-broad,category,manufacturer,name-description
With a max 12 for the dropdown, the dropdown is full as there are over twenty combinations
The dropdown display is fine UNTIL you click on search.
Then the system presents you with only four results and the first result in the Instant Search dropdown is number 4! :dontgetit
I need to have the result include all items that were found in the Instant Search and it appears that clicking on Search drops all results from model numbers.
I had this working on an older version of IS and 1.5.7c but it got munged in a migration.
I realize 2.0.1 now has deprecated the advanced_search files for search but I'm not seeing any simple setting in those files either. The search page includes/modules/pages/search/header.php does a lot in lines 16-25 but model id is not there. Model numbers are what most of the customers are searching for.
This is a must for this one store.
Suggestions or solutions greatfully appreciated.
-
Re: Instant Search
I had to pull instant search out of the topkDOTjeandretDOTcom for other problems.
Still, on topkayakerDOTcom, entering n gets maximum results naturally. na gets the max again. nau still gets the max. naut starts narrowing the results and you'll note that after na, the top item has naturally been the Nautical Protractor.
Inputting nautical in any case results in the same two items with the Nautical Protractor on top clearly showing its products_mdel entry of CTR-255 (SR4)
BUT....
When you enter just c (upper or lower case) that corresponds with the first digit of the products_model entry, there is no mention of the Nautical Protractor.
What needs to be done to force instant search to find me the Nautical Protractor by products_model?!?
I am not sure which version of instant search is on this site. It's 1.5.7d with SBA, but I have tried all versions of Instant Search that are supposed to work with 1.5.7d on a test site. All have done the same thing.
-
Re: Instant Search
Have a look at the branch I've just pushed:
https://github.com/torvista/zencart_...tree/mods_POSM
When you compare with main, hopefully the comments are self-explanatory.
-
Re: Instant Search
I am installing v.4.0.3 in on my local computer for upgrading my site to v.2.0.1...so it is a fresh install.
I have installed all of the files inside the Includes folder and placed the Instant Search folder (and all of its contents) directly into the zc_plugins folder in my site.
I log into Admin, go to Modules-> Plugin Manager and click on the Instant Search that I see there. I click on the Install button and I get a white screen.
The error log report shows:
[15-Jan-2025 22:22:32 UTC] PHP Fatal error: Declaration of ScriptedInstaller::doUpgrade(string $oldVersion = ''): bool must be compatible with Zencart\PluginSupport\ScriptedInstaller::doUpgrade($oldVersion): ?bool in C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\Installer\ScriptedInstaller. php on line 27
I have obviously done something wrong....can you point me in the right direction as to what to do to fix this install??
Thanks,
Jeff
-
Re: Instant Search
In looking over the the error log this morning, the error appears to be because it is trying to "upgrade" instead of fresh install.
I have removed everything from line 27 down, till it gets to //Fresh install code. I then went to Admin->Modules->Plugins and Installed it, and it all installed fine!
When trying to use the Search in my sidebox to test this I receive the following in the error log:
Request URI: /new21/, IP address: 127.0.0.1, Language id not set
#1 define() called at [C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\catalog\includes\extra_dataf iles\instant_search_filenames.php:10]
#2 require_once(C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\catalog\include s\extra_datafiles\instant_search_filenames.php) called at [C:\wamp64\www\new21\includes\classes\FileSystem.php:24]
#3 Zencart\FileSystem\FileSystem->loadFilesFromDirectory() called at [C:\wamp64\www\new21\includes\classes\FileSystem.php:60]
#4 Zencart\FileSystem\FileSystem->loadFilesFromPluginsDirectory() called at [C:\wamp64\www\new21\includes\application_top.php:302]
#5 require(C:\wamp64\www\new21\includes\application_top.php) called at [C:\wamp64\www\new21\index.php:25]
--> PHP Warning: Constant FILENAME_INSTANT_SEARCH_RESULT already defined in C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\catalog\includes\extra_dataf iles\instant_search_filenames.php on line 10.
As well as a second error log of:
Request URI: /new21/admin/index.php?cmd=sqlpatch&action=execute, IP address: 127.0.0.1, Language id 1
#1 zen_check_config_key() called at [C:\wamp64\www\new21\admin\sqlpatch.php:164]
#2 executeSql() called at [C:\wamp64\www\new21\admin\sqlpatch.php:747]
#3 require(C:\wamp64\www\new21\admin\sqlpatch.php) called at [C:\wamp64\www\new21\admin\index.php:16]
--> PHP Warning: Undefined array key 1 in C:\wamp64\www\new21\admin\sqlpatch.php on line 675.
[16-Jan-2025 13:42:27 UTC] Request URI: /new21/admin/index.php?cmd=sqlpatch&action=execute, IP address: 127.0.0.1, Language id 1
#1 zen_check_config_key() called at [C:\wamp64\www\new21\admin\sqlpatch.php:164]
#2 executeSql() called at [C:\wamp64\www\new21\admin\sqlpatch.php:747]
#3 require(C:\wamp64\www\new21\admin\sqlpatch.php) called at [C:\wamp64\www\new21\admin\index.php:16]
--> PHP Warning: Undefined array key 3 in C:\wamp64\www\new21\admin\sqlpatch.php on line 676.
Would anyone be able to shed some light on these errors and how to fix them??
Thanks,
Jeff
-
Re: Instant Search
Since having issues with this plugin....I decided to install this plugin once again in a fresh version of ZC v.2.1 with a new database in my local computer. I then installed this plugin immediately before adding in my merged custom files or current store database.
It always throws the error as I have posted in post#226, so once again I removed this code. It still did not install correctly so I removed v.4 of this plugin, installed v.3.0.1 and then tried installing v.4 (following the instructions with certain file removals before install). I now was able to get it installed!
I configured the settings in Admin->Instant Search (as per my live site of ZC v1.5.8 and Instant Search v.3.0.1). When I go to this new development site and try using the Search to insure the Instant Search is working, I get the following error (and no Instant Search results are displayed):
PHP Fatal error: Uncaught Error: Class "Zencart\Plugins\Catalog\InstantSearch\InstantSearchLogger" not found in C:\wamp64\www\newsite\includes\classes\ajax\zcAjaxInstantSearch.php:60
Stack trace:
#0 C:\wamp64\www\newsite\ajax.php(71): zcAjaxInstantSearch->__construct()
#1 {main}
thrown in C:\wamp64\www\newsite\includes\classes\ajax\zcAjaxInstantSearch.php on line 60
It appears the error is related to logging the Search term I typed in, in the Search log which I had set to true in my settings in Admin->Instant Search I set this to false so that it does not log this, but still received the same error.
Could someone point me in the right direction to fix this??
Thanks.
-
Re: Instant Search
I have the latest Github version working with ZC210, php8.4 and using strict reporting. It requires multiple fixes.
I've uploaded it to this branch:
https://github.com/torvista/zencart_...torvista_fixes
-
Re: Instant Search
Thanks Torvista for your continued help with this plugin! I will head to Github for the latest version and give it a go.