I have discovered that I have had the "Disable expired relationships" job producing the following error. Triggering the job manually yields the same result.
How can I find out more information about what is tripping up the system so that I can rectify the problem?
This is a Drupal implementation.
2015-07-12 16:20:46 Disable expired relationships
0 Summary Finished execution of Disable expired relationships with result: Failure, Error message: Relationship is not valid DetailsParameters parsed (and passed to API method): a:1:{s:7:"version";i:3;}
Full message: Finished execution of Disable expired relationships with result: Failure, Error message: Relationship is not valid
EDIT: While I had hoped that jumping into error logs would yield more information, the output of the following SQL statement was helpful to jump in and fix some errant data:
SELECT
RELATIONSHIP.id as relationship_id,
RELATIONSHIP.contact_id_a,
RELATIONSHIP.contact_id_b,
RELATIONSHIP.relationship_type_id,
CONTACT1.contact_type AS contact_type_a,
RELTYPE.contact_type_a as expected_type_a,
CONTACT1.contact_sub_type as contact_subtype_a,
RELTYPE.contact_sub_type_a as expected_sub_type_a,
CONTACT2.contact_type AS contact_type_b,
RELTYPE.contact_type_b as expected_type_b,
CONTACT2.contact_sub_type as contact_subtype_b,
RELTYPE.contact_sub_type_b as expected_sub_type_b
FROM civicrm_relationship AS RELATIONSHIP
LEFT JOIN civicrm_contact AS CONTACT1
ON RELATIONSHIP.contact_id_A = CONTACT1.id
LEFT JOIN civicrm_contact AS CONTACT2
ON RELATIONSHIP.contact_id_B = CONTACT2.id
LEFT JOIN civicrm_relationship_type as RELTYPE
ON RELATIONSHIP.relationship_type_id = RELTYPE.id
I took the export of this into Excel and used the AND function to compare what contact types/subtypes were expected for each contact and what was really sitting in there. When I fixed the data, the cron job ran successfully.