SharePoint CAML “Cannot complete this action”

If you are getting this error where using CAML to query a list, it is usually an indicator that the CAML is not valid syntax.

In my case, for a CAML query to get documents within a document set where no file extension is set, it was that I had forgotten to add the closing / to the FieldRef element as so (displayed in bold):

<Where><And><Neq><FieldRef Name='ContentType'/><Value Type='Computed'>Document Set</Value></Neq><IsNull><FieldRef Name='File_x0020_Type'/></IsNull></And></Where></Query></View>

Easy to miss when it’s not there!