I faced the following situation:

I tweaked cck field mapping using hook_apachesolr_cck_fields_alter. But I made a mistake when formatting a cck field which causes an exception on solr's side. But on drupal's side the only thing you see is a watchdog entry "500 Internal Server Error" but no further information. If you don't have access to solr's logfile it's impossible to find the reason why no more nodes get indexed.

So I created a patch that hands over detailed error messages from solr to drupal as exception which causes a more detailed watchdog entry. In my case it starts like this:

"500 Internal Server Error" Status:
HTTP Status 500 - Error while creating field 'ds_cck_field_event_date{type=date,properties=indexed,stored,omitNorms,sortMissingLast}' from value '2009-05-16T00:00:00'
...

Comments

pwolanin’s picture

Looks reasonable, though I might exclude 403 and 404.

mkalkbrenner’s picture

StatusFileSize
new3.78 KB

OK, here's a modified version.

pwolanin’s picture

StatusFileSize
new2.85 KB

Looking though the code - it would be kind of nice to push this upstream to the library.

Here's an alternate patch to try - I'm not sure I like throwing exceptions in different places.

mkalkbrenner’s picture

Status: Needs review » Reviewed & tested by the community

I'm fine with your patch from comment #3. Detailed error messages occur in watchdog.

What do you mean with "push this upstream to the library"? If you talk about solr-php-client, they don't seem to be very responsive. I opened http://code.google.com/p/solr-php-client/issues/detail?id=5 two months ago and didn't receive any feedback so far.

pwolanin’s picture

I committed this to CVS, but forgot to update the CHANGELOG - I'll do that yet, so leaving it rtbc.

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed
pwolanin’s picture

StatusFileSize
new8.68 KB

Committing also this follow-up patch to make sure we sanitize messages coming from the webserver, and that we don't log extra on 403 or 404.

pwolanin’s picture

StatusFileSize
new8.26 KB

One more follow-up: add nl2br() so that stack traces, etc, don't run all on one line.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.