omniphx / forrest

A Laravel library for Salesforce
https://omniphx.github.io/forrest/
MIT License
259 stars 120 forks source link

The recent fix for bulk uploads broke ability to get results #233

Closed ryanrca closed 3 years ago

ryanrca commented 4 years ago

Hi! I used to be able to call these methods to get the results of finished jobs:

        $ret['success'] = Forrest::jobs('ingest/' . $jobId . '/successfulResults/',  [
            'method' => 'get'
        ]);

        $ret['fail'] = Forrest::jobs('ingest/' . $jobId . '/failedResults/',  [
            'method' => 'get'
        ]);

        $ret['unprocessed'] = Forrest::jobs('ingest/' . $jobId . '/unprocessedrecords/',  [
            'method' => 'get'
        ]);

When I upgraded to Forrest v2.5.3 (Thank you for addressing this, BTW), I no longer get error information.

So now after I push a new CSV job, if there are errors, the above results always return null:

Here's the output of my script:

id : 7504P00000RjGI4QAN
operation : upsert
object : Contact
createdById : 0054P00000AJCZNQA5
createdDate : 2019-12-13T22:01:38.000+0000
systemModstamp : 2019-12-13T22:01:53.000+0000
state : JobComplete
externalIdFieldName : ID__c
concurrencyMode : Parallel
contentType : CSV
apiVersion : 47
jobType : V2Ingest
lineEnding : LF
columnDelimiter : COMMA
numberRecordsProcessed : 4
numberRecordsFailed : 4
retries : 0
totalProcessingTime : 51
apiActiveProcessingTime : 0
apexProcessingTime : 0
--------------- Details:
Successes   :
fails       :
unprocessed :

0/4 records failed, but no details stats are returned.

Thanks!

omniphx commented 4 years ago

Hey @ryanrca,

I'm pretty puzzled by this. I tried fetching results from Postman + Workbench and always get an empty/null response.

Screen Shot 2020-10-16 at 9 13 08 AM

Screen Shot 2020-10-16 at 9 25 40 AM

Which version was working for you?

omniphx commented 4 years ago

Tried forrest v2.5.2 and v2.4.7 as well... and got the same result.

Tried a number of different implementations:

Forrest::jobs('ingest/7503l00000XSzwx/successfulResults/', [
        'method' => 'get'
]);

Forrest::get('/services/data/v50.0/jobs/ingest/7503l00000XSzwx/successfulResults/');

Forrest::jobs('ingest/7503l00000XSzwx/successfulResults/');
devaygun commented 3 years ago

I am also having this issue.

omniphx commented 3 years ago

Unfortunately, @denizaygun this seems like it might possibly be a Salesforce bug. Might have been a coincidence that it started occurring right as forrest v2.5 was released but doesn't seem to work with v2.4 either

devaygun commented 3 years ago

Hi @omniphx , thanks for the quick reply.

That's a shame, do you have any workaround suggestions? Would be handy to verify the status of jobs.

I wonder if Bulk API 1.0 has this issue.

devaygun commented 3 years ago

I have realised you can get the errorMessage for a job overall, if the job itself fails, however if there's issues with individual entries then you just won't know as those API endpoints seem to work.

This issue seems to be present in the Salesforce CMS itself too, as when records fail, you're only told the number that have failed and not why.