Fixing the "Your search cannot be completed because of a service error." error
Tue, 03/08/2011 - 11:55 — sylvainToday I kept running into this nasty exception. It happened after I had modified the custom advanced search page to something more graphical. Instead of having the users select metadata properties from a dropdown, they can use this nice table, which they are used to, to provide metadata property values to the search engine.
Weird solutions
Some blog/forum post seemed to suggest fixing this issue by resetting the index, reconfiguring the SSP and stuff like that. Since the other search pages were just working fine, I didn't think this would solve my issue. The problem had to be that table...
First thing I tried was change the names of all the fields so that they have a name in this format: ctl00$m$g_67280178_f5e9_476b_9024_d695fb4d3fde$ASB_PS_plb_0. Still, that dreaded error.
The only thing that changed at that time, was the lack of the majority of the ASB_PS_plb_ and ASB_PS_olb_ fields. For testing purposes I only added the hidden ASB_PS_plb_ and ASB_PS_olb_ fields for my first metadata property. After some snooping in reflector, to check out the way the post was handled exactly, I figured it shouldn't be the issue. For completeness sake, I added them nonetheless. It didn't seem to change things...
Next thing was an inspection of the logs. There was a "Data or literal value could not be converted to the type of the column in the data source, and the provider was unable to determine which columns could not be converted. Data overflow or sign mismatch was not the cause." error recorded. This looked an awful lot like an error I came across a while ago. Quickly checking my code, I noticed that there were 2 fields missing from the ASB_TextDT_Props field. After adding those, the search started working. Well, working... At least it didn't give that error anymore. The results returned aren't really OK, but that's something to fix at a later stage :)
Note: I tried reproducing the error which, funnily enough, didn't really work. So I still haven't found out what exactly causes this error. All I can say is: check that POST data. Not once, but at least twice and then one more time.