Multiple GraphQL Errors trying to delete entities

Initially I assumed this issue was due to background DB activity “catching up” to processing a large number of records, but it has now been over 15 hours and I am still unable to delete records.

QUERY='mutation { calls( 
    callStartTime: {less: "2022-01-01"} )
    {executeAsBackgroundJob {jobId actions{
        delete {message}
    }}}}'

...
Thu Mar  7 16:44:15 PST 2024
{"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. 3350 row(s) processed","actions":null}}}
Thu Mar  7 16:44:30 PST 2024
{"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. 3400 row(s) processed","actions":null}}}
Thu Mar  7 16:44:45 PST 2024
{"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. 3450 row(s) processed","actions":null}}}
Thu Mar  7 16:44:59 PST 2024
{"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. 3500 row(s) processed","actions":null}}}
Thu Mar  7 16:45:14 PST 2024    rc=9    
{"data":{"job":{"status":"FAILED","message":"jwt expired","actions":null}}}
...
Thu Mar  7 17:00:25 PST 2024
{"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. Delete execution divided into 3978 part(s)","actions":null}}}      
Thu Mar  7 17:00:39 PST 2024
{"data":{"job":{"status":"FAILED","message":"Statement affected 0 row(s), but was expected to affect 50.","actions":null}}}
...
Thu Mar  7 17:06:58 PST 2024
{"data":{"calls":{"executeAsBackgroundJob":{"jobId":"5c442b68-5215-4e0b-b84e-5c23ad63763d","actions":null}}}}
Thu Mar  7 17:07:13 PST 2024
{"data":{"job":{"status":"FAILED","message":"Cannot delete not found entities {"fibery/id":"b3301435-7f75-487e-ace6-20f85ab94df3"} of 'Zoho GC/Calls' database.","actions":null}}}
...
Fri Mar  8 07:26:14 PST 2024
{"data":{"calls":{"executeAsBackgroundJob":{"jobId":"dd82cada-4a92-448f-9ae1-3ae5277f1976","actions":null}}}}
Fri Mar  8 07:26:28 PST 2024
{"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. Delete execution divided into 1122 part(s)","actions":null}}}
Fri Mar  8 07:26:43 PST 2024
{"data":{"job":{"status":"FAILED","message":"Statement affected 0 row(s), but was expected to affect 50.","actions":null}}}

FYI: Things seemed to work better when I added orderBy:

QUERY='mutation { calls( 
    callStartTime: {less: "2022-01-01"}
    orderBy:       {callStartTime: ASC} )
    {executeAsBackgroundJob {jobId actions{
        delete {message}
    }}}}'

But only for a while, then I get these again:

Fri Mar  8 09:07:29 PST 2024  {"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. 750 row(s) processed","actions":null}}}
Fri Mar  8 09:07:29 PST 2024  {"data":{"job":{"status":"EXECUTING","message":"Executing "Delete" action. 750 row(s) processed","actions":null}}}
Fri Mar  8 09:07:44 PST 2024  {"data":{"job":{"status":"FAILED","message":"Cannot delete not found entities {"fibery/id":"59b4a854-27e5-47aa-b12f-4f5c5d95f7c2"} of 'Zoho GC/Calls' database.","actions":null}}}
...
{"data":{"job":{"status":"FAILED","message":"jwt expired","actions":null}}}
...
{"data":{"job":{"status":"FAILED","message":"Statement affected 0 row(s), but was expected to affect 50.","actions":null}}}

UPDATE: Two days later, it appears that the entity deletion query/queries did eventually do what they were supposed to do, and deleting all entities older than a certain date.


So I guess the real issue is the inability to get accurate status reports for long-running batch operations - and receiving incorrect/misleading error/status messages.