Search by Page suddenly stopped returning results on a production Drupal site. No major changes were made to the site in terms of upgrades or maintenance, so the fact that module stopped working suddenly is kind of a shock.
http://www.courtinnovation.org/search-results/research
Meanwhile, the site's core search works fine.
http://www.courtinnovation.org/search/node/research
Anyone else ever see anything like this? Here's a short list of the overrides we current have on SBP:
search-by-page-form.tpl.php (for custom HTML)
hook_form_search_by_page_form_alter (added a wrapper div)
theme_preprocess_search_by_page_form (used to re-write the keys and submit elements of the form)
theme_search_by_page_results_title (used to rewrite the title)
Comments
Comment #1
jhodgdonI am not sure what would make Search by Page suddenly stop working....
Core search and Search by Page do not use the same indexes. You might go to the Search Settings page and verify that Search by Page says that it is completely indexed, and/or run cron a few times to make sure it is.
You might also verify your Search by Page environment settings, and make sure the node types etc. are set correctly. Possibly someone visited that page and changed something?
Comment #2
chromix commentedSome things I've already tried:
Comment #3
jhodgdonSo you are saying that when you created a different search environment, ran cron until the Search Settings page showed everything was fully indexed, and then tried a search in your new search environment, you still got no results?
In that case, all I can suggest is that maybe you have a database or server problem. I don't know why else teh Search by Page module would suddenly stop working.
Comment #4
chromix commentedYeah I tried starting over with a whole new environment and enabled only a couple simple nodes for the search and then ran cron repeatedly until the index was fully completed. I still couldn't get search by page to show any results at all.
http://www.courtinnovation.org/search_pages/research
I'm not sure where the breakdown would be at this point.
Comment #5
jhodgdonSorry, I don't have any more ideas for you. Software doesn't generally just stop working completely unless you have a problem with your server or MySQL or something like that. Which is why this is likely a support request and not a bug report. You might also look at your Drupal logs to see if there are any error messages...
Comment #6
chromix commentedThat's what I was afraid of. Should we try the dev release or is that unlikely to contain any fixes for this?
Comment #7
chromix commentedGotcha. I was just holding out hope that someone had seen the same thing. If I ever figure out what caused this problem I'll report back.
Comment #8
chromix commentedI found the following error iterated over and over in the logs:
Table 'cci.sbptt958905734' doesn't exist query: SELECT SUM(i.score * t.count) AS score FROM search_index i INNER JOIN search_total t ON i.word = t.word INNER JOIN sbp_path sp ON i.sid = sp.pid LEFT JOIN (sbpa_files saf INNER JOIN (node sbpa_n INNER JOIN node_access sbpa_na ON sbpa_na.nid = sbpa_n.nid) ON sbpa_n.nid = saf.nid AND sbpa_n.vid = saf.vid ) ON sp.modid = saf.fid LEFT JOIN (node sbpn_n INNER JOIN node_access sbpn_na ON sbpn_na.nid = sbpn_n.nid) ON sbpn_n.nid = sp.modid LEFT JOIN sbptt958905734 sbpp ON sbpp.pid = sp.modid WHERE ((0=1 OR (sp.from_module = 'sbp_attach' AND 1=1 AND (0=1 OR (saf.source = 'cck' AND (1=1))) AND sbpa_n.status = 1 AND (sbpa_na.grant_view >= 1 AND ((sbpa_na.gid = 0 AND sbpa_na.realm = 'all') OR (sbpa_na.gid = 0 AND sbpa_na.realm = 'og_public')))) OR (sp.from_module = 'sbp_nodes' AND sbpn_n.status = 1 AND (sbpn_na.grant_view >= 1 AND ((sbpn_na.gid = 0 AND sbpn_na.realm = 'all') OR (sbpn_na.gid = 0 AND sbpn_na.realm = 'og_public')))) OR (sp.from_module = 'sbp_paths' AND sbpp.perm = 1)) AND sp.environment=1 AND sp.language='en') AND (i.word = 'sample' OR i.word = 'documents') AND i.type = 'search_by_page' GROUP BY i.type, i.sid HAVING COUNT(*) >= 2 ORDER BY score DESC LIMIT 0, 1 in modules/search/search.module on line 946.Comment #9
chromix commentedYeah there's definitely something going on in the database... I'll switch this to support request... sorry to bother you about this, but thank you for your help.
Comment #10
jhodgdonI think that is a temporary table that it is complaining doesn't exist -- a table that a query is creating as part of the search process.
You might verify that the Drupal database user has "create temporary tables" permissions on your database. Maybe your web host changed that recently?
Comment #11
chromix commentedYep. I can see that permissions on the MySQL db have definitely been locked down recently. That's more than likely the problem. Thanks for your help!
Comment #12
chromix commentedAdding temporary table creation access for Drupal's user in MySQL fixed the problem. Thanks again!
Comment #14
gregglesRe-opening this. In Drupal 5 and below temporary tables were required so it was common to have that permission. For 6.x and above it is not common any more and I think the README.txt (or an INSTALL.txt) should mention the need for this permission.
For what it's worth, this command worked for me:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES
ON databasename.*
TO 'username'@'localhost' IDENTIFIED BY 'password';
Comment #15
jhodgdonOK, I'll make sure that is added to the README for 6/7. Thanks!
Comment #16
jhodgdonAnd by the way this is only required for the Search by Page Paths sub-module, I think (will verify before adding to readme).
Comment #17
jhodgdonThis has been added to 6.x's README file in the development version. It has also been taken care of for 7.x, but as I'm in the middle of another issue, the change has not been committed yet (should be later today, in conjunction with #815864: Update Search by Page for current version of Internationalization Strings).
Comment #18
jhodgdonActually, I went ahead and committed the change to the README file for 7.x now.