Skip to content

Boto should return detailed response data from CloudSearch errors #1446

Open
jthayer opened this Issue Apr 17, 2013 · 2 comments

3 participants

@jthayer
jthayer commented Apr 17, 2013

When CloudSearch encounters an error while indexing documents, it returns fairly detailed responses, for example:

{"status": "error", "errors": [{"message": "The value of \"fields\" must be a JSON object, not an array (near operation with index 1)"}], "adds": 0, "deletes": 0}

However, these are all handled by boto with blanket errors:

boto.cloudsearch.document.CommitMismatchError: Incorrect number of adds returned. Commit: 2 Respose: 0

It would be useful if boto could propagate the error detail to the calling application. Otherwise it is necessary to resort to sniffing packets on the network in order to debug CloudSearch errors when using boto.

@zaus
zaus commented Dec 30, 2014

Somewhat related question -- anybody know if the index is 0 based? As in, near operation with index 1 is the first or second item submitted? It would be useful in matching up the errors/warnings back to the actual document; this random link seems to indicate that the message could include the document_id, but it's not clear from the JSON Schema what to expect in the message.

@rrx
rrx commented Sep 14, 2015

This appears to have been handled at some point. I'm using boto==2.37.0, and the errors variable is being passed with the exception

try:
    doc_service.commit()
except boto.cloudsearch2.document.CommitMismatchError as e:
    print e.errors

This will give you errors, I had to dig into the code to find this out, so I'm posting it here. I would say this issue is resolved, but the documentation should be updated to make this clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.