NationStates Jolt Archive


Weird search error

New Empire
02-11-2003, 03:43
Well, this is something. I try to view my posts, and I get this-

General Error

Could not insert search results

DEBUG MODE

SQL Error : 1062 Duplicate entry '1983509471' for key 1

INSERT INTO phpbb_search_results (search_id, session_id, search_array) VALUES(1983509471, '8e4100361e6a12cafbbae3da492b5342', 'a:7:{s:14:"search_results";s:2210:"14538, 15957, 19768, 30753, 31132, 32487, 32538, 34703, 34997, 39061, 40112, 40509, 40635, 40961, 41280, 42459, 43237, 43389, 43487, 43753, 43908, 44149, 44207, 44348, 44349, 44359, 44375, 44385, 44768, 44823, 45159, 45683, 45686, 45784, 46104, 46576, 47564, 48096, 48294, 48475, 48603, 48861, 48926, 49188, 49349, 49503, 49968, 50211, 50233, 51432, 51565, 51580, 51650, 51683, 51976, 53280, 53290, 53557, 56549, 56926, 57484, 57993, 58008, 58033, 58054, 58077, 58134, 58140, 58323, 58372, 58374, 59142, 60074, 60140, 60526, 60734, 60782, 61498, 61539, 61606, 61885, 62326, 62528, 62571, 62578, 62610, 62822, 62892, 63009, 63021, 63024, 63039, 63073, 63076, 63300, 63391, 63416, 63700, 63815, 63886, 63888, 63890, 64050, 64055, 64173, 64285, 64544, 64631, 64656, 65993, 66554, 67255, 67291, 67427, 67531, 67556, 67603, 67615, 67640, 67951, 67991, 68262, 68276, 68293, 68294, 68298, 68308, 68312, 68335, 68677, 68679, 68868, 68882, 68899, 68909, 68956, 68963, 69011, 69041, 69171, 69265, 69315, 69367, 69541, 69553, 69853, 69875, 69884, 69907, 69939, 69974, 70204, 70214, 70318, 70534, 70535, 70632, 70662, 70804, 70806, 71094, 71107, 71164, 71207, 71210, 71404, 71439, 71684, 71967, 72195, 72211, 72216, 72339, 72560, 73013, 73295, 73667, 73747, 73869, 74011, 74103, 74284, 74638, 74663, 74719, 74792, 74935, 74953, 75000, 75060, 75250, 75271, 75306, 75316, 75479, 75506, 75550, 75686, 75900, 75924, 75941, 76243, 76304, 76474, 76504, 76749, 77132, 77166, 77185, 77208, 77582, 77627, 77838, 77847, 77868, 77885, 77892, 77899, 77914, 77924, 77987, 78031, 78061, 78120, 78187, 78190, 78222, 78246, 78295, 78369, 78518, 78643, 78653, 78667, 79195, 79407, 79665, 79786, 79815, 79978, 79981, 80016, 80085, 80180, 80235, 80253, 80266, 80374, 80439, 80558, 80580, 80625, 80720, 80752, 80762, 80877, 80938, 80942, 80951, 81164, 81232, 81245, 81526, 81563, 81595, 81645, 81734, 81888, 82062, 82099, 82100, 82101, 82327, 82332, 82699, 82701, 83039, 83045, 83148, 83180, 83184, 83215, 83232, 83623, 83979, 84125, 84650, 84657, 84701, 84717, 84759, 85352, 85419, 85421, 85433, 85434, 85569, 85595, 85724, 85747, 85771, 85822, 85839, 85860, 85932, 85957, 87188, 87806, 87863, 87880, 87944, 88064, 88081, 88161, 88206, 88216";s:17:"total_match_count";i:316;s:12:"split_search";N;s:7:"sort_by";i:0;s:8:"sort_dir";s:4:"DESC";s:12:"show_results";s:6:"topics";s:12:"return_chars";i:200;}')

Line : 598
File : /home/nation/public_html/forum/search.php
Phoebos
02-11-2003, 13:36
It does this every time?

I can't see an obvious reason why it should...
New Empire
02-11-2003, 13:42
No. But last night it did for 2 hours.
SalusaSecondus
02-11-2003, 18:31
Yeah, this happens some times. If I recall correctly, it should fix itself after a bit.

http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
02-11-2003, 21:34
It's seeing SQL queries like that make you realise why the server's on its knees most of the time.

Apart from that, It seems to be trying to insert a record which already exists. It's having a problem with the search_id. If this is set to unique or primary key in the table then it will bring up problems. Someone who knows PHPBB, how is the search_id generated? is it possible for the same search id to come up more than once?

Since session_id is also involved, you might like to try logging out and in again when this happens.
Peng-Pau
03-11-2003, 04:58
It's seeing SQL queries like that make you realise why the server's on its knees most of the time.

Apart from that, It seems to be trying to insert a record which already exists. It's having a problem with the search_id. If this is set to unique or primary key in the table then it will bring up problems. Someone who knows PHPBB, how is the search_id generated? is it possible for the same search id to come up more than once?

Since session_id is also involved, you might like to try logging out and in again when this happens.

Actually, this has nothing to do with why the server's on its knees all the time...

It simply can't cope with the amount of queries issued, much like the phpBB website (http://www.phpbb.com), which had to resort to using Zeus as their webserver to prevent the site from slowing to a halt.

Anyway, this error is simply because two people issued a search at exactly the same time. The scripts both returned a correct number for search_id, but whichever one managed to insert the query first would have gotten correct results, and whoever came second would get this error.

There really is nothing you can do about it except for removing the search function, which would lessen the load on the server for a start, so it'd work faster, hehehe. ;)