Hi,
On a fresh drupal 4.7.4 installation, search form never return result.
When cron.php is running (and poormancron.module also), error log include a lot of errors like this one (french error message because i'm using french drupal translation) :
"Erreur de syntaxe pr賠de '015239966556737 WHERE word = 'coeur'' ࠬa ligne 1 query: UPDATE search_total SET count = 0,015239966556737 WHERE word = 'coeur' dans /philippe/includes/database.mysql.inc à la ligne 121.".
Forcing drupal to re-index site (by admin/search) don't solve problem and i don't see any reason in my settings for this bug.
Other users reports same problem :
http://drupal.org/node/104971
http://drupal.org/search/node/UPDATE+search_total+SET+count
Could some drupal additionnals modules generate this bug ?
Can you please help me on this issue ?
Thanks a lot !
Comments
Comment #1
Anonymous (not verified) commentedCould it be related to http://drupal.org/node/41412?
Comment #2
derieppe commentedI don't think so because i never add error during searching. Only during indexing...
I think Drupal never find just because is index in invalid.
Thanks for help.
Comment #3
cog.rusty commentedIt could be the comma in the float... Definitely "near 015239966556737".
http://php.net/manual/en/language.types.float.php#58824
Here is a similar one from the forum: http://drupal.org/node/104971
Comment #4
derieppe commentedHello,
I alredy understand that there is a bug somewhere ;=))
But how to workaround this problem ? Nobody seems to propose a patch or solution by new release... Node 104971 just go back .. to thos node !
Could it be the MySql or Php version ? Or a language problem ?
I got 2 site on same server this same bug (and with sames add_on modules too...).
Thanks for helping.
Comment #5
cog.rusty commentedApparently the developers can't reproduce it. Maybe some more information would help.
What is your MySQL version?
Can you check the table 'search_total' in your database with phpMyAdmin to see its locale settings?
Comment #6
alexandreracine commentedI have two drupal installation on the same server (share hosting with two domains with hostgator). One is very popular and the other one is not. The problem is on the popular one, and you'll see that with the stats below. I am putting some stats, just to show you that maybe, just maybe this bug is related to a lot of requests or something similar. (or is more prone to appear when there is more requests).
In December 2006, the pageviews where like this :
alexandreracine.com, 1779 pages views
salsamontreal.com, 496939 pages views
Both domain are on the same server, so the versions are the same and both table have the same locale
search_total -> utf8_general_ci
Mysql 4.1.21-standard
PHP 4.4.4
Drupal 4.7.x
Just like comment #1, I also am using a French drupal locale.
Looking deeper in the logs, I can see that when cron (poormancron) execute, everything is fine, except if a node has changed. So what I am thinking is that it is doing an update of the search database the problem would come from somewhere near that :(
Looking at the logs and changing stuff on alexandreracine.com does not have that problem. even if I deactivate the English language since this one is testing i18n module.
Comment #7
derieppe commentedHi CogRusty,
As i'm not a MySql expert, i can only get this information by an export of sear_total table :
-- phpMyAdmin SQL Dump
-- version 2.6.2
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mercredi 10 Janvier 2007 à 08:50
-- Version du serveur: 4.0.20
-- Version de PHP: 5.0.4
--
-- Base de données: `drupal_philippe`
--
-- --------------------------------------------------------
--
-- Structure de la table `search_total`
--
CREATE TABLE `search_total` (
`word` varchar(50) NOT NULL default '',
`count` float default NULL,
PRIMARY KEY (`word`)
) TYPE=MyISAM;
--
-- Contenu de la table `search_total`
--
Versions informations are :
System : System ppphp-2v.cs.clubint.net 5.9 Generic_117172-12 i86pc
Php : 5.0.4
MySql : 4.0.20
Drupal : 4.7.4 + NO Patchs.
Site A modules :
CCK
PoorMansCron
Views
Site B modules :
I18n
PoormanCron
For information : My sites a a very fee traffic for i can't follow AlexandreRacine hypothesis.
Other information : The tracker.mudule don't update on site 1 when i add a new node ! It seems to be broken by new node type creation (by CCK)...
On Site B tracker.module run fine !
Thanks for help.
Comment #8
alexandreracine commentedLooking further in the logs. It seems that there is as many error that they is words in the new node that is to be indexed in the search.
Further, in the logs, I have this happening in that order (chronological).
[I add a new node]
Column count doesn't match value count at row 1 query: INSERT INTO search_index (word, sid, type, score) VALUES ('danse', 1011, 'node', 191,201536224) à la ligne 120 du fichier /[PATH TO DRUPAL]/includes/database.mysql.inc.
[all other errors from all other words in the node]
[cron has been completed here]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '000178787587144 WHERE word = 'danse'' at line 1 query: UPDATE search_total SET count = 0,000178787587144 WHERE word = 'danse' à la ligne 120 du fichier /[PATH TO DRUPAL]/includes/database.mysql.inc.
[all other errors from all other words in the node]
I don't always have the first errors...
Looking in my mySQL database, this is my structure for search
--
-- Table structure for table `search_total`
--
DROP TABLE IF EXISTS `search_total`;
CREATE TABLE `search_total` (
`word` varchar(50) NOT NULL default '',
`count` float default NULL,
PRIMARY KEY (`word`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Table structure for table `search_index`
--
DROP TABLE IF EXISTS `search_index`;
CREATE TABLE `search_index` (
`word` varchar(50) NOT NULL default '',
`sid` int(10) unsigned NOT NULL default '0',
`type` varchar(16) default NULL,
`fromsid` int(10) unsigned NOT NULL default '0',
`fromtype` varchar(16) default NULL,
`score` float default NULL,
KEY `sid_type` (`sid`,`type`),
KEY `from_sid_type` (`fromsid`,`fromtype`),
KEY `word` (`word`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Derlepe do you have something like this?
Comment #9
cog.rusty commentedalexandreracine: you have MySQL 4.1
derieppe has MySQL 4.0 which does not support the "DEFAULT CHARSET=utf8" clause in the table definitions.
It is that comma again. It splits the float number into two arguments in: "Column count doesn't match value count at row 1 query: INSERT INTO search_index (word, sid, type, score) VALUES ('danse', 1011, 'node', 191,201536224)"
Not sure why this happens.
You already said that your 'search_total table' has utf8_general_ci collation.
Does its 'search_index' column (which contains that float) have a collation too? (in mine it doesn't).
What's your whole database's default collation?
If everything seems ok, then it could be something with your MySQL connection's collation.
Comment #10
alexandreracine commentedYes they are all the same, and my database default is : utf8_general_ci
This is "search_index" table...
word varchar(50) utf8_general_ci
sid int(10)
type varchar(16) utf8_general_ci
fromsid int(10)
fromtype varchar(16) utf8_general_ci
score float
This is the "search_total" table
word varchar(50) utf8_general_ci
count float
The weird part is that the database for alexandreracine.com and salsamontreal.com have the same structure... and errors are only on salsamontreal.com.
First test
I just did another test. I created a new node "test99" with the word "bachibouzouque" in it, Just to test if I could search for it. After a manual cron.php (going to the website.com/cron.php), it all work fine. No errors and I can search for it, and results are correct. But, going in the search module config (admin/settings/search), 100% of the site is indexed, but there is still one article to index.
So changing the same test99 node, adding some text, and going back in the search module config, I now have 99% of the site indexed, 1 article to index.
Doing the poormanscron instead of manually gives the same results. Looking on alexandreracine.com, the "1 article to index" as the same behavior.
In all thoses cases, I could search for the new word replacing "bachibouzouque" search time I changed it. After that, it was "aaaa", "bbbb", etc.
Second test
I think I just nailed further this problem!
Watever I do as the administrator, everything is fine.
Now, the fun part. When a anonymous user manually start the cron.php, everything is fine too. But when that user start the cron from the poormanscron "Cron run completed (via poormanscron).", then he has the error (on screen). Trying to search for the new word does not work and the next time that a anonymous user will start the poormanscron, everything will be fine.
HOW TO REPRODUCE - what works, what does not (and please confirm)
0- Open up two different web browsers. IE and Firefox, or Firefox and Konqueror. More important, one as admin the other as anonymous.
1- Configure poormanscron so that he runs at each 5 minutes.
2- Create a new node. It does not have to be frontpage, but publish it for inclusion in the search.module. Use fewer words, as this will give you less errors. Actually, just put "bbbb" in it.
3- Look in admin/settings when your next cron job will occur and when you are near enough, use your anonymous browser to reload any of your webpage rapidly until you have the error. I say rapidly since that there is a lot of people on my website, but if your website has not a lot of traffic, this will be likely easier.
Note that, if you use the anonymous browser to run the cron.php manually, there will be no errors...
After all has been said...
Can someone confirm that this methodology is correct to get errors? Thanks.
If this is correct, now, why would that happen only from poormanscron with anonymous?
Comment #11
alexandreracine commented...and I'll try that on my other website later.
Comment #12
alexandreracine commentedOn my other website, Doing this procedure does not create the problem.
Comment #13
derieppe commentedFor french readers, you can follow this link:
http://www.drupalfr.org/forum/support/527-drupal_4_7_2_impossible_de_se_...
My problem is not exacly the same than alexandreracine's problem but perhaps reason could be the same ?
Cheers.
Comment #14
alexandreracine commentedok, I have move this here since my problem seems to be more poormanscron related then search.
http://drupal.org/node/114329
Comment #15
pasqualleThis version is not supported. Reopen or create a new issue if the problem exists in any recent version (version equal or above Drupal 5)